David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 1 | - name: Apt Information |
| 2 | become: yes |
| 3 | apt: name={{ item }} state=latest force=yes |
| 4 | with_items: |
| 5 | - apt-transport-https |
| 6 | - ca-certificates |
| 7 | |
| 8 | - name: Docker Apt Key |
| 9 | become: yes |
| 10 | apt_key: |
| 11 | keyserver: hkp://p80.pool.sks-keyservers.net:80 |
| 12 | id: 58118E89F3A912897C070ADBF76221572C52609D |
| 13 | |
| 14 | - name: Docker repository |
| 15 | become: yes |
| 16 | apt_repository: |
| 17 | repo: deb https://apt.dockerproject.org/repo ubuntu-trusty main |
| 18 | update_cache: yes |
| 19 | state: present |
| 20 | |
| 21 | - name: Docker Engine |
| 22 | become: yes |
| 23 | apt: |
| 24 | name: docker-engine |
| 25 | state: latest |
| 26 | force: yes |
| 27 | |
David K. Bainbridge | f62e70d | 2016-06-13 17:23:01 -0700 | [diff] [blame] | 28 | - name: Docker Exposed via TCP |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 29 | become: yes |
| 30 | lineinfile: |
| 31 | dest=/etc/default/docker |
| 32 | state=present |
| 33 | insertafter='#DOCKER_OPTS' |
| 34 | line='DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"' |
| 35 | register: docker_config |
| 36 | |
| 37 | - name: Docker Restart |
| 38 | become: yes |
| 39 | service: |
| 40 | name=docker |
| 41 | state=restarted |
| 42 | when: docker_config.changed |
| 43 | |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 44 | - name: Enable Docker for User |
| 45 | become: yes |
| 46 | user: |
| 47 | name={{ ansible_user }} |
| 48 | group=docker |
| 49 | append=yes |
| 50 | |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 51 | - name: Docker Compose |
| 52 | become: yes |
| 53 | get_url: |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 54 | url=https://github.com/docker/compose/releases/download/1.7.1/docker-compose-Linux-x86_64 |
| 55 | dest=/usr/local/bin/docker-compose |
| 56 | owner=root |
| 57 | group=root |
| 58 | mode=0755 |