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({}) }}'
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue