|
|
|
---
|
|
|
|
- name: Create a Swarm cluster
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
advertise_addr: "{{ansible_default_ipv4.address | default('127.0.0.1')}}"
|
|
|
|
name: default
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## autolock_managers ###############################################
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
- name: autolock_managers (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
autolock_managers: yes
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: autolock_managers
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
autolock_managers: yes
|
|
|
|
register: output_2
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: autolock_managers (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
autolock_managers: yes
|
|
|
|
register: output_3
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: autolock_managers (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
autolock_managers: yes
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: autolock_managers (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
autolock_managers: no
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: autolock_managers (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
autolock_managers: no
|
|
|
|
register: output_6
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: assert autolock_managers changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
when: docker_py_version is version('2.6.0', '>=')
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- output_1 is failed
|
|
|
|
- "('version is ' ~ docker_py_version ~'. Minimum version required is 2.6.0') in output_1.msg"
|
|
|
|
when: docker_py_version is version('2.6.0', '<')
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## ca_force_rotate #################################################
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
- name: ca_force_rotate (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
ca_force_rotate: 1
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: ca_force_rotate
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
ca_force_rotate: 1
|
|
|
|
register: output_2
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: ca_force_rotate (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
ca_force_rotate: 1
|
|
|
|
register: output_3
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: ca_force_rotate (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
ca_force_rotate: 1
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: ca_force_rotate (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
ca_force_rotate: 0
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: ca_force_rotate (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
ca_force_rotate: 0
|
|
|
|
register: output_6
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: assert ca_force_rotate changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
when: docker_py_version is version('2.6.0', '>=')
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- output_1 is failed
|
|
|
|
- "('version is ' ~ docker_py_version ~'. Minimum version required is 2.6.0') in output_1.msg"
|
|
|
|
when: docker_py_version is version('2.6.0', '<')
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## dispatcher_heartbeat_period #####################################
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
- name: dispatcher_heartbeat_period (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
dispatcher_heartbeat_period: 10
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: dispatcher_heartbeat_period
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
dispatcher_heartbeat_period: 10
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: dispatcher_heartbeat_period (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
dispatcher_heartbeat_period: 10
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: dispatcher_heartbeat_period (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
dispatcher_heartbeat_period: 10
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: dispatcher_heartbeat_period (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
dispatcher_heartbeat_period: 23
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: dispatcher_heartbeat_period (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
dispatcher_heartbeat_period: 23
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert dispatcher_heartbeat_period changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## election_tick ###################################################
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
- name: election_tick (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
election_tick: 20
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: election_tick
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
election_tick: 20
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: election_tick (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
election_tick: 20
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: election_tick (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
election_tick: 20
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: election_tick (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
election_tick: 5
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: election_tick (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
election_tick: 5
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert election_tick changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## heartbeat_tick ##################################################
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
- name: heartbeat_tick (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
heartbeat_tick: 2
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: heartbeat_tick
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
heartbeat_tick: 2
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: heartbeat_tick (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
heartbeat_tick: 2
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: heartbeat_tick (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
heartbeat_tick: 2
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: heartbeat_tick (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
heartbeat_tick: 3
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: heartbeat_tick (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
heartbeat_tick: 3
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert heartbeat_tick changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## keep_old_snapshots ##############################################
|
|
|
|
####################################################################
|
|
|
|
- name: keep_old_snapshots (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
keep_old_snapshots: 1
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: keep_old_snapshots
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
keep_old_snapshots: 1
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: keep_old_snapshots (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
keep_old_snapshots: 1
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: keep_old_snapshots (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
keep_old_snapshots: 1
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: keep_old_snapshots (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
keep_old_snapshots: 2
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: keep_old_snapshots (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
keep_old_snapshots: 2
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert keep_old_snapshots changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## labels ##########################################################
|
|
|
|
####################################################################
|
|
|
|
- name: labels (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
b: v2
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
b: v2
|
|
|
|
register: output_2
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
b: v2
|
|
|
|
register: output_3
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
b: v2
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
c: v3
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
c: v3
|
|
|
|
register: output_6
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (not specifying, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
check_mode: yes
|
|
|
|
diff: yes
|
|
|
|
register: output_7
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (not specifying)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
diff: yes
|
|
|
|
register: output_8
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (idempotency, check that labels are still there)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels:
|
|
|
|
a: v1
|
|
|
|
c: v3
|
|
|
|
diff: yes
|
|
|
|
register: output_9
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (empty, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels: {}
|
|
|
|
check_mode: yes
|
|
|
|
diff: yes
|
|
|
|
register: output_10
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (empty)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels: {}
|
|
|
|
diff: yes
|
|
|
|
register: output_11
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (empty, idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels: {}
|
|
|
|
check_mode: yes
|
|
|
|
diff: yes
|
|
|
|
register: output_12
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: labels (empty, idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
labels: {}
|
|
|
|
diff: yes
|
|
|
|
register: output_13
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: assert labels changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_7 is not changed'
|
|
|
|
- 'output_7.actions[0] == "No modification"'
|
|
|
|
- 'output_8 is not changed'
|
|
|
|
- 'output_8.actions[0] == "No modification"'
|
|
|
|
- 'output_9 is not changed'
|
|
|
|
- 'output_9.actions[0] == "No modification"'
|
|
|
|
- 'output_10 is changed'
|
|
|
|
- 'output_10.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_11 is changed'
|
|
|
|
- 'output_11.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_12 is not changed'
|
|
|
|
- 'output_12.actions[0] == "No modification"'
|
|
|
|
- 'output_13 is not changed'
|
|
|
|
- 'output_13.actions[0] == "No modification"'
|
|
|
|
when: docker_py_version is version('2.6.0', '>=')
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- output_1 is failed
|
|
|
|
- "('version is ' ~ docker_py_version ~'. Minimum version required is 2.6.0') in output_1.msg"
|
|
|
|
when: docker_py_version is version('2.6.0', '<')
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## log_entries_for_slow_followers ##################################
|
|
|
|
####################################################################
|
|
|
|
- name: log_entries_for_slow_followers (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
log_entries_for_slow_followers: 42
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: log_entries_for_slow_followers
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
log_entries_for_slow_followers: 42
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: log_entries_for_slow_followers (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
log_entries_for_slow_followers: 42
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: log_entries_for_slow_followers (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
log_entries_for_slow_followers: 42
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: log_entries_for_slow_followers (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
log_entries_for_slow_followers: 23
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: log_entries_for_slow_followers (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
log_entries_for_slow_followers: 23
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert log_entries_for_slow_followers changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## name ############################################################
|
|
|
|
####################################################################
|
|
|
|
- name: name (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
name: default
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: name (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
name: default
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
# The name 'default' is hardcoded in docker swarm. Trying to change
|
|
|
|
# it causes a failure. This might change in the future, so we also
|
|
|
|
# accept a change for this test.
|
|
|
|
- name: name (change, should fail)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
name: foobar
|
|
|
|
register: output_3
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: assert name changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is not changed'
|
|
|
|
- 'output_1.actions[0] == "No modification"'
|
|
|
|
- 'output_2 is not changed'
|
|
|
|
- 'output_2.actions[0] == "No modification"'
|
|
|
|
- 'output_3 is failed or output_3 is changed'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## node_cert_expiry ################################################
|
|
|
|
####################################################################
|
|
|
|
- name: node_cert_expiry (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
node_cert_expiry: 7896000000000000
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: node_cert_expiry
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
node_cert_expiry: 7896000000000000
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: node_cert_expiry (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
node_cert_expiry: 7896000000000000
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: node_cert_expiry (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
node_cert_expiry: 7896000000000000
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: node_cert_expiry (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
node_cert_expiry: 8766000000000000
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: node_cert_expiry (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
node_cert_expiry: 8766000000000000
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert node_cert_expiry changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## rotate_manager_token ############################################
|
|
|
|
####################################################################
|
|
|
|
- name: rotate_manager_token (true, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_manager_token: yes
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: rotate_manager_token (true)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_manager_token: yes
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: rotate_manager_token (false, idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_manager_token: no
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: rotate_manager_token (false, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_manager_token: no
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: assert rotate_manager_token changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## rotate_worker_token #############################################
|
|
|
|
####################################################################
|
|
|
|
- name: rotate_worker_token (true, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_worker_token: yes
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: rotate_worker_token (true)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_worker_token: yes
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: rotate_worker_token (false, idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_worker_token: no
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: rotate_worker_token (false, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
rotate_worker_token: no
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: assert rotate_worker_token changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## snapshot_interval ###############################################
|
|
|
|
####################################################################
|
|
|
|
- name: snapshot_interval (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
snapshot_interval: 12345
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: snapshot_interval
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
snapshot_interval: 12345
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: snapshot_interval (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
snapshot_interval: 12345
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: snapshot_interval (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
snapshot_interval: 12345
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: snapshot_interval (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
snapshot_interval: 54321
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: snapshot_interval (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
snapshot_interval: 54321
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert snapshot_interval changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
## task_history_retention_limit ####################################
|
|
|
|
####################################################################
|
|
|
|
- name: task_history_retention_limit (check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
task_history_retention_limit: 23
|
|
|
|
check_mode: yes
|
|
|
|
register: output_1
|
|
|
|
|
|
|
|
- name: task_history_retention_limit
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
task_history_retention_limit: 23
|
|
|
|
register: output_2
|
|
|
|
|
|
|
|
- name: task_history_retention_limit (idempotent)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
task_history_retention_limit: 23
|
|
|
|
register: output_3
|
|
|
|
|
|
|
|
- name: task_history_retention_limit (idempotent, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
task_history_retention_limit: 23
|
|
|
|
check_mode: yes
|
|
|
|
register: output_4
|
|
|
|
|
|
|
|
- name: task_history_retention_limit (change, check mode)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
task_history_retention_limit: 7
|
|
|
|
check_mode: yes
|
|
|
|
register: output_5
|
|
|
|
|
|
|
|
- name: task_history_retention_limit (change)
|
|
|
|
docker_swarm:
|
|
|
|
state: present
|
|
|
|
task_history_retention_limit: 7
|
|
|
|
register: output_6
|
|
|
|
|
|
|
|
- name: assert task_history_retention_limit changes
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'output_1 is changed'
|
|
|
|
- 'output_1.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_2 is changed'
|
|
|
|
- 'output_2.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_3 is not changed'
|
|
|
|
- 'output_3.actions[0] == "No modification"'
|
|
|
|
- 'output_4 is not changed'
|
|
|
|
- 'output_4.actions[0] == "No modification"'
|
|
|
|
- 'output_5 is changed'
|
|
|
|
- 'output_5.actions[0] == "Swarm cluster updated"'
|
|
|
|
- 'output_6 is changed'
|
|
|
|
- 'output_6.actions[0] == "Swarm cluster updated"'
|