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