Public
Snippet $25 authored by Ludwig Wacker

Ansible Bootstrap

bootstrap.yml
- name: Bootstrapping CoreOS
  hosts: all
  gather_facts: False
  tasks:
    - name: Run bootstrap
      script: bootstrap.sh

    - name: Checking for pip
      shell: "{{ansible_python_interpreter}} -m pip --version"
      register: need_pip
      ignore_errors: True
      changed_when: false

    - name: Install pip
      shell: "{{ansible_python_interpreter}} ~/get-pip.py"
      when: need_pip | failed

    - name: Remove get-pip.py
      command: rm -f ~/get-pip.py

    - name: Install pip launcher
      copy: src=pip dest=~/bin/pip mode=0755
      when: need_pip | failed

    - name: Install docker-py
      pip: name=docker-py version=0.6.0

    - name: Pulling Mongo Container
      raw: docker pull mongo:3.0.2

    - name: Pulling local Docker registry
      raw: docker pull registry:2.0

    - name: Building LOTH Container
      raw: docker build -t loth:latest /var/www/.

    - name: Removing Java Base Image
      raw: docker rmi -f dockerfile/java:oracle-java8