chore: mini refacto

This commit is contained in:
Adrien Waksberg 2021-11-22 11:47:20 +01:00
parent 66ac6e704a
commit 8450009836

View file

@ -21,17 +21,8 @@
limits: '{{ item.limits|default({}) }}'
env: '{{ item.env|default({}) }}'
container_labels: '{{ item.labels|default({}) }}'
state: present
state: '{{ item.state|default("present") }}'
loop: '{{ swarm_services }}'
when: '"state" not in item or item.state != "absent"'
no_log: false
tags: swarm
- name: remove services
community.docker.docker_swarm_service:
name: '{{ item.name }}'
state: absent
loop: '{{ swarm_services }}'
when: '"state" in item and item.state == "absent"'
no_log: true
loop_control:
label: '{{ item.name }}'
tags: swarm