test: fix new rules for ansible lint

This commit is contained in:
Adrien Waksberg 2022-07-20 11:53:28 +02:00
parent 3889dfd0b4
commit f3da4eb183
2 changed files with 18 additions and 18 deletions

View file

@ -10,7 +10,7 @@
- name: join swarm cluster
community.docker.docker_swarm: # noqa no-handler
advertise_addr: '{{ swarm_advertise_addr }}'
join_token: '{{ swarm_manager|ternary(swarm_join_token_manager, swarm_join_token_worker) }}'
join_token: '{{ swarm_manager | ternary(swarm_join_token_manager, swarm_join_token_worker) }}'
remote_addrs: '{{ swarm_remote_addrs }}'
state: join
when: not result.changed

View file

@ -5,8 +5,8 @@
username: '{{ item.value.registry_username }}'
password: '{{ item.value.registry_password }}'
become: true
become_user: '{{ item.value.user|default(ansible_user_id) }}'
loop: '{{ swarm_registry_logins|dict2items }}'
become_user: '{{ item.value.user | default(ansible_user_id) }}'
loop: '{{ swarm_registry_logins | dict2items }}'
loop_control:
label: '{{ item.key }}'
tags: swarm
@ -14,10 +14,10 @@
- name: manage networks
community.docker.docker_network:
name: '{{ item.key }}'
driver: '{{ item.value.driver|default("bridge") }}'
driver: '{{ item.value.driver | default("bridge") }}'
scope: swarm
state: '{{ item.value.state|default("present") }}'
loop: '{{ swarm_networks|dict2items }}'
state: '{{ item.value.state | default("present") }}'
loop: '{{ swarm_networks | dict2items }}'
loop_control:
label: '{{ item.key }}'
when: swarm_manager
@ -28,18 +28,18 @@
community.docker.docker_swarm_service:
name: '{{ item.key }}'
image: '{{ item.value.image }}'
command: '{{ item.value.command|default([]) }}'
hostname: '{{ item.value.hostname|default(omit) }}'
args: '{{ item.value.args|default([]) }}'
mounts: '{{ item.value.mounts|default([]) }}'
networks: '{{ item.value.networks|default([]) }}'
publish: '{{ item.value.publish|default([]) }}'
replicas: '{{ item.value.replicas|default(1) }}'
limits: '{{ item.value.limits|default({}) }}'
env: '{{ item.value.env|default({}) }}'
container_labels: '{{ item.value.labels|default({}) }}'
state: '{{ item.value.state|default("present") }}'
loop: '{{ swarm_services|dict2items }}'
command: '{{ item.value.command | default([]) }}'
hostname: '{{ item.value.hostname | default(omit) }}'
args: '{{ item.value.args | default([]) }}'
mounts: '{{ item.value.mounts | default([]) }}'
networks: '{{ item.value.networks | default([]) }}'
publish: '{{ item.value.publish | default([]) }}'
replicas: '{{ item.value.replicas | default(1) }}'
limits: '{{ item.value.limits | default({}) }}'
env: '{{ item.value.env | default({}) }}'
container_labels: '{{ item.value.labels | default({}) }}'
state: '{{ item.value.state | default("present") }}'
loop: '{{ swarm_services | dict2items }}'
loop_control:
label: '{{ item.key }}'
when: swarm_manager