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 - name: join swarm cluster
community.docker.docker_swarm: # noqa no-handler community.docker.docker_swarm: # noqa no-handler
advertise_addr: '{{ swarm_advertise_addr }}' 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 }}' remote_addrs: '{{ swarm_remote_addrs }}'
state: join state: join
when: not result.changed when: not result.changed

View file

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