mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-18 19:10:43 +01:00
Do not touch docker.json if not option provided
This commit is contained in:
parent
0df75aea53
commit
47a271e39a
@ -28,5 +28,5 @@ docker_yum_repo_enable_test: 0
|
|||||||
# A list of users who will be added to the docker group.
|
# A list of users who will be added to the docker group.
|
||||||
docker_users: []
|
docker_users: []
|
||||||
|
|
||||||
# Docker daemon options
|
# Docker daemon options as a dict
|
||||||
docker_daemon_options: {}
|
docker_daemon_options: {}
|
||||||
|
@ -11,24 +11,27 @@
|
|||||||
state: "{{ docker_package_state }}"
|
state: "{{ docker_package_state }}"
|
||||||
notify: restart docker
|
notify: restart docker
|
||||||
|
|
||||||
- name: Ensure Docker is started and enabled at boot.
|
|
||||||
service:
|
|
||||||
name: docker
|
|
||||||
state: "{{ docker_service_state }}"
|
|
||||||
enabled: "{{ docker_service_enabled }}"
|
|
||||||
|
|
||||||
- name: Ensure /etc/docker/ directory exists.
|
- name: Ensure /etc/docker/ directory exists.
|
||||||
file:
|
file:
|
||||||
path: /etc/docker
|
path: /etc/docker
|
||||||
state: directory
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
when: docker_daemon_options.keys() | length > 0
|
||||||
|
|
||||||
- name: Configure Docker daemon options.
|
- name: Configure Docker daemon options.
|
||||||
copy:
|
copy:
|
||||||
content: "{{ docker_daemon_options | to_nice_json }}"
|
content: "{{ docker_daemon_options | to_nice_json }}"
|
||||||
dest: /etc/docker/daemon.json
|
dest: /etc/docker/daemon.json
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
when: docker_daemon_options.keys() | length > 0
|
||||||
notify: restart docker
|
notify: restart docker
|
||||||
|
|
||||||
|
- name: Ensure Docker is started and enabled at boot.
|
||||||
|
service:
|
||||||
|
name: docker
|
||||||
|
state: "{{ docker_service_state }}"
|
||||||
|
enabled: "{{ docker_service_enabled }}"
|
||||||
|
|
||||||
- name: Ensure handlers are notified now to avoid firewall conflicts.
|
- name: Ensure handlers are notified now to avoid firewall conflicts.
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user