Restart Docker daemon if config changed
This commit is contained in:
parent
6b7636a4ed
commit
c85fdf12b5
|
@ -1,3 +1,4 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
base_domain: sapti.me
|
base_domain: sapti.me
|
||||||
base_volume: "{{ hdd_mount_point }}/apps"
|
base_volume: "{{ hdd_mount_point }}/apps"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
- name: Add Docker PGP key
|
- name: Add Docker PGP key
|
||||||
apt_key:
|
apt_key:
|
||||||
|
@ -36,13 +37,6 @@
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: Set up Docker services
|
- name: Set up Docker services
|
||||||
import_tasks: services.yml
|
import_tasks: services.yml
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
- name: Start but disable Docker daemon
|
- 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) start Docker daemon
|
||||||
service:
|
service:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
enabled: false
|
enabled: false
|
||||||
state: started
|
state: "{{ 'restarted' if daemon_config.changed else 'started' }}"
|
||||||
loop:
|
loop:
|
||||||
- docker.socket
|
- docker.socket
|
||||||
- docker.service
|
- docker.service
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
ssh_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPd/4fQV7CL8/KVwbo/phiV5UdXFBIDlkZ+ps8C7FeRf
|
ssh_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPd/4fQV7CL8/KVwbo/phiV5UdXFBIDlkZ+ps8C7FeRf
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
- name: Configure system packages
|
- name: Configure system packages
|
||||||
import_tasks: pkgs.yml
|
import_tasks: pkgs.yml
|
||||||
|
|
Reference in a new issue