chore: mini refacto
This commit is contained in:
parent
66ac6e704a
commit
8450009836
1 changed files with 3 additions and 12 deletions
|
@ -21,17 +21,8 @@
|
||||||
limits: '{{ item.limits|default({}) }}'
|
limits: '{{ item.limits|default({}) }}'
|
||||||
env: '{{ item.env|default({}) }}'
|
env: '{{ item.env|default({}) }}'
|
||||||
container_labels: '{{ item.labels|default({}) }}'
|
container_labels: '{{ item.labels|default({}) }}'
|
||||||
state: present
|
state: '{{ item.state|default("present") }}'
|
||||||
loop: '{{ swarm_services }}'
|
loop: '{{ swarm_services }}'
|
||||||
when: '"state" not in item or item.state != "absent"'
|
loop_control:
|
||||||
no_log: false
|
label: '{{ item.name }}'
|
||||||
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
|
|
||||||
tags: swarm
|
tags: swarm
|
||||||
|
|
Loading…
Reference in a new issue