Move all Docker tasks under services tag
This commit is contained in:
parent
9a63d6a529
commit
b5f028f7ed
|
@ -1,23 +0,0 @@
|
|||
# vim: ft=yaml.ansible
|
||||
---
|
||||
- name: Copy Docker daemon config file
|
||||
template:
|
||||
src: daemon.json.j2
|
||||
dest: /etc/docker/daemon.json
|
||||
owner: root
|
||||
mode: u=rw,g=r,o=r
|
||||
register: daemon_config
|
||||
|
||||
- name: Disable and (re)start Docker daemon
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
enabled: false
|
||||
state: "{{ 'restarted' if daemon_config.changed else 'started' }}"
|
||||
loop:
|
||||
- docker.socket
|
||||
- docker.service
|
||||
|
||||
- name: Set up Docker services
|
||||
import_tasks: services.yml
|
||||
tags:
|
||||
- services
|
|
@ -37,7 +37,8 @@
|
|||
- docker
|
||||
- docker-compose
|
||||
|
||||
- name: Set up Docker
|
||||
import_tasks: docker.yml
|
||||
- name: Set up Docker services
|
||||
import_tasks: services.yml
|
||||
tags:
|
||||
- services
|
||||
- reboot
|
||||
|
|
|
@ -1,5 +1,22 @@
|
|||
# vim: ft=yaml.ansible
|
||||
---
|
||||
- name: Copy Docker daemon config file
|
||||
template:
|
||||
src: daemon.json.j2
|
||||
dest: /etc/docker/daemon.json
|
||||
owner: root
|
||||
mode: u=rw,g=r,o=r
|
||||
register: daemon_config
|
||||
|
||||
- name: Disable and (re)start Docker daemon
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
enabled: false
|
||||
state: "{{ 'restarted' if daemon_config.changed else 'started' }}"
|
||||
loop:
|
||||
- docker.socket
|
||||
- docker.service
|
||||
|
||||
- name: Create base directory for Docker volumes
|
||||
file:
|
||||
name: "{{ base_volume }}"
|
||||
|
|
Reference in a new issue