prevent service state action in chroot

This commit is contained in:
Eric Keller 2020-07-21 13:35:45 +02:00
parent f6f6cf55fb
commit b6c33c3da9
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,4 @@
---
- name: restart docker
service: "name=docker state={{ docker_restart_handler_state }}"
when: not ansible_is_chroot

View File

@ -11,11 +11,16 @@
state: "{{ docker_package_state }}"
notify: restart docker
- name: Ensure Docker is started and enabled at boot.
- name: Ensure Docker is enabled at boot.
service:
name: docker
enabled: "{{ docker_service_enabled }}"
- name: Ensure Docker is started.
service:
name: docker
state: "{{ docker_service_state }}"
enabled: "{{ docker_service_enabled }}"
when: not ansible_is_chroot
- name: Ensure handlers are notified now to avoid firewall conflicts.
meta: flush_handlers