summaryrefslogtreecommitdiffstats
path: root/ansible/roles/docker/tasks/main.yml
blob: 9851d4dc555f428d0b2633d64a884f446181db95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: Install docker
  package:
    name: 'docker-ce'
    state: present
  notify:
    - Restart Docker

- name: Install docker python module
  package:
    name: 'python2-docker'
    state: present

- name: Ensure /etc/docker exists
  file:
    path: /etc/docker
    state: directory

- name: Setup docker dns settings
  json_add:
    path: /etc/docker/daemon.json
    key: dns
    value: "{{ hostvars[groups.infrastructure[0]].ansible_default_ipv4.address }}"
  notify:
    - Restart Docker

- name: Force notified handlers to run at this point
  meta: flush_handlers

- name: Ensure docker is started
  systemd:
    name: docker
    state: started
    enabled: yes