mirror of
https://github.com/Maks1mS/ansible-role-docker.git
synced 2024-12-24 00:33:04 +03:00
Fixes #42: Allow control over docker_service state.
This commit is contained in:
parent
2b31b694c0
commit
abd8e3625e
@ -23,6 +23,12 @@ The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterpri
|
|||||||
|
|
||||||
Whether to restart the Docker daemon after the Docker package is installed or updated. If this is set to `True`, this role will flush all handlers (run any of the handlers that have been notified by this and any other role up to this point in the play). The default setting helps avoid firewall clashes with Docker rules (e.g. when using custom `iptables` rules or the `geerlingguy.firewall` Ansible role).
|
Whether to restart the Docker daemon after the Docker package is installed or updated. If this is set to `True`, this role will flush all handlers (run any of the handlers that have been notified by this and any other role up to this point in the play). The default setting helps avoid firewall clashes with Docker rules (e.g. when using custom `iptables` rules or the `geerlingguy.firewall` Ansible role).
|
||||||
|
|
||||||
|
docker_service_state: started
|
||||||
|
docker_service_enabled: yes
|
||||||
|
docker_restart_handler_state: restarted
|
||||||
|
|
||||||
|
Variables to control the state of the `docker` service, and whether it should start on boot. If you're installing Docker inside a Docker container without systemd or sysvinit, you should set these to `stopped` and set the enabled variable to `no`.
|
||||||
|
|
||||||
docker_install_compose: True
|
docker_install_compose: True
|
||||||
docker_compose_version: "1.21.2"
|
docker_compose_version: "1.21.2"
|
||||||
docker_compose_path: /usr/local/bin/docker-compose
|
docker_compose_path: /usr/local/bin/docker-compose
|
||||||
|
@ -5,6 +5,11 @@ docker_package: "docker-{{ docker_edition }}"
|
|||||||
docker_package_state: present
|
docker_package_state: present
|
||||||
docker_restart_on_package_change: True
|
docker_restart_on_package_change: True
|
||||||
|
|
||||||
|
# Service options.
|
||||||
|
docker_service_state: started
|
||||||
|
docker_service_enabled: yes
|
||||||
|
docker_restart_handler_state: restarted
|
||||||
|
|
||||||
# Docker Compose options.
|
# Docker Compose options.
|
||||||
docker_install_compose: True
|
docker_install_compose: True
|
||||||
docker_compose_version: "1.21.2"
|
docker_compose_version: "1.21.2"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
- name: restart docker
|
- name: restart docker
|
||||||
service: name=docker state=restarted
|
service: "name=docker state={{ docker_restart_handler_state }}"
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
- name: Ensure Docker is started and enabled at boot.
|
- name: Ensure Docker is started and enabled at boot.
|
||||||
service:
|
service:
|
||||||
name: docker
|
name: docker
|
||||||
state: started
|
state: "{{ docker_service_state }}"
|
||||||
enabled: yes
|
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