Tomáš Levora | a1d3e82 | 2018-12-19 15:39:22 +0100 | [diff] [blame] | 1 | --- |
| 2 | - name: Install docker |
| 3 | package: |
| 4 | name: 'docker-ce' |
| 5 | state: present |
| 6 | notify: |
| 7 | - Restart Docker |
| 8 | |
| 9 | - name: Install docker python module |
| 10 | package: |
| 11 | name: 'python2-docker' |
| 12 | state: present |
| 13 | |
| 14 | - name: Ensure /etc/docker exists |
| 15 | file: |
| 16 | path: /etc/docker |
| 17 | state: directory |
| 18 | |
| 19 | - name: Setup docker dns settings |
| 20 | json_add: |
| 21 | path: /etc/docker/daemon.json |
| 22 | key: dns |
Petr Ospalý | 946fd10 | 2019-01-08 12:00:20 +0100 | [diff] [blame] | 23 | value: "{{ hostvars[groups.infrastructure[0]].ansible_default_ipv4.address }}" |
Tomáš Levora | a1d3e82 | 2018-12-19 15:39:22 +0100 | [diff] [blame] | 24 | notify: |
| 25 | - Restart Docker |
| 26 | |
| 27 | - name: Force notified handlers to run at this point |
| 28 | meta: flush_handlers |
| 29 | |
| 30 | - name: Ensure docker is started |
| 31 | systemd: |
| 32 | name: docker |
| 33 | state: started |
| 34 | enabled: yes |