| - name: Apt Information |
| become: yes |
| apt: name={{ item }} state=present force=yes |
| with_items: |
| - apt-transport-https=1.0* |
| - ca-certificates=20160104* |
| |
| - name: Docker Apt Key |
| become: yes |
| apt_key: |
| keyserver: hkp://p80.pool.sks-keyservers.net:80 |
| id: 58118E89F3A912897C070ADBF76221572C52609D |
| |
| - name: Docker repository |
| become: yes |
| apt_repository: |
| repo: deb https://apt.dockerproject.org/repo ubuntu-trusty main |
| update_cache: yes |
| state: present |
| |
| - name: Docker Engine |
| become: yes |
| apt: |
| name: docker-engine=1.12* |
| state: present |
| force: yes |
| |
| - name: Docker Exposed via TCP |
| become: yes |
| lineinfile: |
| dest=/etc/default/docker |
| state=present |
| insertafter='#DOCKER_OPTS' |
| line='DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"' |
| register: docker_config |
| |
| - name: Docker Restart |
| become: yes |
| service: |
| name=docker |
| state=restarted |
| when: docker_config.changed |
| |
| - name: Enable Docker for User |
| become: yes |
| user: |
| name={{ ansible_user }} |
| group=docker |
| append=yes |
| |
| - name: Docker Compose |
| become: yes |
| get_url: |
| url=https://github.com/docker/compose/releases/download/1.7.1/docker-compose-Linux-x86_64 |
| dest=/usr/local/bin/docker-compose |
| owner=root |
| group=root |
| mode=0755 |