Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 1 | --- |
| 2 | |
| 3 | - name: Prereqs and SSL support for apt for SSL |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 4 | become: yes |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 5 | apt: |
| 6 | name: "{{ item }}" |
| 7 | update_cache: yes |
| 8 | cache_valid_time: 3600 |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 9 | with_items: |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 10 | - apt-transport-https |
| 11 | - ca-certificates |
| 12 | - python-pip |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 13 | |
| 14 | - name: Docker Apt Key |
| 15 | become: yes |
| 16 | apt_key: |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 17 | data: "{{ lookup('file', 'docker_apt_key.gpg') }}" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 18 | |
| 19 | - name: Docker repository |
| 20 | become: yes |
| 21 | apt_repository: |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 22 | repo: "{{ docker_apt_repo }}" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 23 | |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 24 | - name: Install docker engine |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 25 | become: yes |
| 26 | apt: |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 27 | name: docker-engine=1.12* |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 28 | force: yes |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 29 | update_cache: yes |
| 30 | cache_valid_time: 3600 |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 31 | |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 32 | # docker fails without docker-py, docker-compose >1.9 fails with docker-py installed |
Andy Bavier | b79101e | 2017-06-14 17:28:30 -0700 | [diff] [blame^] | 33 | - name: Install docker-compose |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 34 | become: yes |
| 35 | pip: |
| 36 | name: "{{ item }}" |
| 37 | with_items: |
| 38 | - docker-py |
| 39 | - docker-compose==1.9 |
| 40 | |
| 41 | - name: Make current user part of the Docker group |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 42 | become: yes |
| 43 | user: |
Zack Williams | 4d09b3b | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 44 | name: "{{ ansible_user_id }}" |
| 45 | groups: "docker" |
| 46 | append: yes |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 47 | |