Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 1 | - name: Debian add Docker repository and update apt cache |
| 2 | apt_repository: |
| 3 | repo: deb https://apt.dockerproject.org/repo ubuntu-{{ debian_version }} main |
| 4 | update_cache: yes |
| 5 | state: present |
| 6 | tags: [docker] |
| 7 | |
| 8 | - name: Debian Docker is present |
| 9 | apt: |
| 10 | name: docker-engine |
| 11 | state: latest |
| 12 | force: yes |
| 13 | tags: [docker] |
| 14 | |
| 15 | - name: Debian python-pip is present |
| 16 | apt: name=python-pip state=present |
| 17 | tags: [docker] |
| 18 | |
| 19 | - name: Debian docker-py is present |
| 20 | pip: |
| 21 | name: docker-py |
| 22 | version: 1.6.0 |
| 23 | state: present |
| 24 | tags: [docker] |
| 25 | |
Nathan Knuth | 676ebbb | 2016-10-13 22:16:10 -0700 | [diff] [blame] | 26 | - name: netifaces pip package is present |
| 27 | pip: |
| 28 | name: netifaces |
| 29 | version: 0.10.4 |
| 30 | state: present |
| 31 | tags: [docker] |
| 32 | |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 33 | - name: Debian files are present |
| 34 | template: |
| 35 | src: "{{ docker_cfg }}" |
| 36 | dest: "{{ docker_cfg_dest }}" |
| 37 | register: copy_result |
| 38 | tags: [docker] |
| 39 | |
Sergio Slobodrian | 9521fed | 2017-05-30 16:31:21 -0400 | [diff] [blame] | 40 | - name: Enable insecure install registry |
| 41 | template: |
| 42 | src: "{{ docker_daemon_json }}" |
| 43 | dest: "{{ docker_daemon_json_dest }}" |
| 44 | register: copy_result |
| 45 | tags: [docker] |
| 46 | |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 47 | - name: Debian Daemon is reloaded |
| 48 | command: systemctl daemon-reload |
| 49 | when: copy_result|changed and is_systemd is defined |
| 50 | tags: [docker] |
| 51 | |
| 52 | - name: vagrant user is added to the docker group |
| 53 | user: |
| 54 | name: "{{ ansible_env['SUDO_USER'] }}" |
| 55 | group: docker |
| 56 | register: user_result |
| 57 | tags: [docker] |
| 58 | |
| 59 | - name: Debian Docker service is restarted |
| 60 | service: |
| 61 | name: docker |
| 62 | state: restarted |
| 63 | when: copy_result|changed or user_result|changed |
| 64 | tags: [docker] |