Diff feature is only available in devel.

pull/53192/head
Felix Fontein 6 years ago committed by Toshio Kuratomi
parent 25ca40de88
commit 8b9c96aad5

@ -10,7 +10,6 @@
docker_swarm:
state: absent
force: true
diff: no
ignore_errors: yes
- name: Restart docker daemon
@ -25,7 +24,6 @@
docker_swarm:
state: absent
force: true
diff: no
when: docker_py_version is version('2.6.0', '>=') and docker_api_version is version('1.25', '>=')

@ -3,6 +3,5 @@
docker_swarm:
state: absent
force: true
diff: no
- name: "Loading tasks from {{ item }}"
include_tasks: "{{ item }}"

@ -36,21 +36,18 @@
state: present
advertise_addr: "{{ansible_default_ipv4.address | default('127.0.0.1')}}"
check_mode: yes
diff: yes
register: output_1
- name: Create a Swarm cluster
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address | default('127.0.0.1')}}"
diff: yes
register: output_2
- name: Create a Swarm cluster (idempotent)
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address | default('127.0.0.1')}}"
diff: yes
register: output_3
- name: Create a Swarm cluster (idempotent, check mode)
@ -58,7 +55,6 @@
state: present
advertise_addr: "{{ansible_default_ipv4.address | default('127.0.0.1')}}"
check_mode: yes
diff: yes
register: output_4
- name: Create a Swarm cluster (force re-create)
@ -66,7 +62,6 @@
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
force: yes
diff: yes
register: output_5
- name: Create a Swarm cluster (force re-create, check mode)
@ -75,33 +70,20 @@
advertise_addr: "{{ansible_default_ipv4.address}}"
force: yes
check_mode: yes
diff: yes
register: output_6
- name: assert changed when create a new swarm cluster
assert:
that:
- 'output_1 is changed'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] | regex_search("New Swarm cluster created: ")'
- 'output_2.swarm_facts.JoinTokens.Manager'
- 'output_2.swarm_facts.JoinTokens.Worker'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## Removal #########################################################
@ -112,21 +94,18 @@
state: absent
force: true
check_mode: yes
diff: yes
register: output_1
- name: Remove a Swarm cluster
docker_swarm:
state: absent
force: true
diff: yes
register: output_2
- name: Remove a Swarm cluster (idempotent)
docker_swarm:
state: absent
force: true
diff: yes
register: output_3
- name: Remove a Swarm cluster (idempotent, check mode)
@ -134,22 +113,13 @@
state: absent
force: true
check_mode: yes
diff: yes
register: output_4
- name: assert changed when remove a swarm cluster
assert:
that:
- 'output_1 is changed'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Node has left the swarm cluster"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'

@ -48,7 +48,6 @@
signing_ca_key: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key1.key') }}"
timeout: 120
check_mode: yes
diff: yes
register: output_1
- name: signing_ca_cert and signing_ca_key
@ -58,7 +57,6 @@
signing_ca_cert: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key1.pem') }}"
signing_ca_key: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key1.key') }}"
timeout: 120
diff: yes
register: output_2
- name: Private key
@ -74,7 +72,6 @@
# signing_ca_cert: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key1.pem') }}"
# signing_ca_key: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key1.key') }}"
# timeout: 120
# diff: yes
# register: output_3
#- name: signing_ca_cert and signing_ca_key (idempotent, check mode)
@ -84,7 +81,6 @@
# signing_ca_key: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key1.key') }}"
# timeout: 120
# check_mode: yes
# diff: yes
# register: output_4
- name: signing_ca_cert and signing_ca_key (change, check mode)
@ -94,7 +90,6 @@
signing_ca_key: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key2.key') }}"
timeout: 120
check_mode: yes
diff: yes
register: output_5
- name: signing_ca_cert and signing_ca_key (change)
@ -103,7 +98,6 @@
signing_ca_cert: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key2.pem') }}"
signing_ca_key: "{{ lookup('file', role_path ~ '/' ~ output_dir ~ '/ansible_key2.key') }}"
timeout: 120
diff: yes
register: output_6
- name: assert signing_ca_cert and signing_ca_key
@ -111,28 +105,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] | regex_search("New Swarm cluster created: ")'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] | regex_search("New Swarm cluster created: ")'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
#- 'output_3 is not changed'
#- 'output_3.actions[0] == "No modification"'
#- 'output_3.diff.before is defined'
#- 'output_3.diff.after is defined'
#- 'output_4 is not changed'
#- 'output_4.actions[0] == "No modification"'
#- 'output_4.diff.before is defined'
#- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
# https://github.com/ansible/ansible/issues/34054: openssl_certificate unusable on RHEL 7
when: pyopenssl_version.stdout is version('0.15', '>=')

@ -4,7 +4,6 @@
state: present
advertise_addr: "{{ansible_default_ipv4.address | default('127.0.0.1')}}"
name: default
diff: yes
####################################################################
## autolock_managers ###############################################
@ -15,21 +14,18 @@
state: present
autolock_managers: yes
check_mode: yes
diff: yes
register: output_1
- name: autolock_managers
docker_swarm:
state: present
autolock_managers: yes
diff: yes
register: output_2
- name: autolock_managers (idempotent)
docker_swarm:
state: present
autolock_managers: yes
diff: yes
register: output_3
- name: autolock_managers (idempotent, check mode)
@ -37,7 +33,6 @@
state: present
autolock_managers: yes
check_mode: yes
diff: yes
register: output_4
- name: autolock_managers (change, check mode)
@ -45,14 +40,12 @@
state: present
autolock_managers: no
check_mode: yes
diff: yes
register: output_5
- name: autolock_managers (change)
docker_swarm:
state: present
autolock_managers: no
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -60,28 +53,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## ca_force_rotate #################################################
@ -92,21 +73,18 @@
state: present
ca_force_rotate: 1
check_mode: yes
diff: yes
register: output_1
- name: ca_force_rotate
docker_swarm:
state: present
ca_force_rotate: 1
diff: yes
register: output_2
- name: ca_force_rotate (idempotent)
docker_swarm:
state: present
ca_force_rotate: 1
diff: yes
register: output_3
- name: ca_force_rotate (idempotent, check mode)
@ -114,7 +92,6 @@
state: present
ca_force_rotate: 1
check_mode: yes
diff: yes
register: output_4
- name: ca_force_rotate (change, check mode)
@ -122,14 +99,12 @@
state: present
ca_force_rotate: 0
check_mode: yes
diff: yes
register: output_5
- name: ca_force_rotate (change)
docker_swarm:
state: present
ca_force_rotate: 0
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -137,28 +112,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## dispatcher_heartbeat_period #####################################
@ -169,21 +132,18 @@
state: present
dispatcher_heartbeat_period: 10
check_mode: yes
diff: yes
register: output_1
- name: dispatcher_heartbeat_period
docker_swarm:
state: present
dispatcher_heartbeat_period: 10
diff: yes
register: output_2
- name: dispatcher_heartbeat_period (idempotent)
docker_swarm:
state: present
dispatcher_heartbeat_period: 10
diff: yes
register: output_3
- name: dispatcher_heartbeat_period (idempotent, check mode)
@ -191,7 +151,6 @@
state: present
dispatcher_heartbeat_period: 10
check_mode: yes
diff: yes
register: output_4
- name: dispatcher_heartbeat_period (change, check mode)
@ -199,14 +158,12 @@
state: present
dispatcher_heartbeat_period: 23
check_mode: yes
diff: yes
register: output_5
- name: dispatcher_heartbeat_period (change)
docker_swarm:
state: present
dispatcher_heartbeat_period: 23
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -214,28 +171,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## election_tick ###################################################
@ -246,21 +191,18 @@
state: present
election_tick: 20
check_mode: yes
diff: yes
register: output_1
- name: election_tick
docker_swarm:
state: present
election_tick: 20
diff: yes
register: output_2
- name: election_tick (idempotent)
docker_swarm:
state: present
election_tick: 20
diff: yes
register: output_3
- name: election_tick (idempotent, check mode)
@ -268,7 +210,6 @@
state: present
election_tick: 20
check_mode: yes
diff: yes
register: output_4
- name: election_tick (change, check mode)
@ -276,14 +217,12 @@
state: present
election_tick: 5
check_mode: yes
diff: yes
register: output_5
- name: election_tick (change)
docker_swarm:
state: present
election_tick: 5
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -291,28 +230,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## heartbeat_tick ##################################################
@ -323,21 +250,18 @@
state: present
heartbeat_tick: 2
check_mode: yes
diff: yes
register: output_1
- name: heartbeat_tick
docker_swarm:
state: present
heartbeat_tick: 2
diff: yes
register: output_2
- name: heartbeat_tick (idempotent)
docker_swarm:
state: present
heartbeat_tick: 2
diff: yes
register: output_3
- name: heartbeat_tick (idempotent, check mode)
@ -345,7 +269,6 @@
state: present
heartbeat_tick: 2
check_mode: yes
diff: yes
register: output_4
- name: heartbeat_tick (change, check mode)
@ -353,14 +276,12 @@
state: present
heartbeat_tick: 3
check_mode: yes
diff: yes
register: output_5
- name: heartbeat_tick (change)
docker_swarm:
state: present
heartbeat_tick: 3
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -368,28 +289,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## keep_old_snapshots ##############################################
@ -399,21 +308,18 @@
state: present
keep_old_snapshots: 1
check_mode: yes
diff: yes
register: output_1
- name: keep_old_snapshots
docker_swarm:
state: present
keep_old_snapshots: 1
diff: yes
register: output_2
- name: keep_old_snapshots (idempotent)
docker_swarm:
state: present
keep_old_snapshots: 1
diff: yes
register: output_3
- name: keep_old_snapshots (idempotent, check mode)
@ -421,7 +327,6 @@
state: present
keep_old_snapshots: 1
check_mode: yes
diff: yes
register: output_4
- name: keep_old_snapshots (change, check mode)
@ -429,14 +334,12 @@
state: present
keep_old_snapshots: 2
check_mode: yes
diff: yes
register: output_5
- name: keep_old_snapshots (change)
docker_swarm:
state: present
keep_old_snapshots: 2
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -444,28 +347,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## labels ##########################################################
@ -477,7 +368,6 @@
a: v1
b: v2
check_mode: yes
diff: yes
register: output_1
- name: labels
@ -486,7 +376,6 @@
labels:
a: v1
b: v2
diff: yes
register: output_2
- name: labels (idempotent)
@ -495,7 +384,6 @@
labels:
a: v1
b: v2
diff: yes
register: output_3
- name: labels (idempotent, check mode)
@ -505,7 +393,6 @@
a: v1
b: v2
check_mode: yes
diff: yes
register: output_4
- name: labels (change, check mode)
@ -515,7 +402,6 @@
a: v1
c: v3
check_mode: yes
diff: yes
register: output_5
- name: labels (change)
@ -524,7 +410,6 @@
labels:
a: v1
c: v3
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -532,28 +417,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## log_entries_for_slow_followers ##################################
@ -563,21 +436,18 @@
state: present
log_entries_for_slow_followers: 42
check_mode: yes
diff: yes
register: output_1
- name: log_entries_for_slow_followers
docker_swarm:
state: present
log_entries_for_slow_followers: 42
diff: yes
register: output_2
- name: log_entries_for_slow_followers (idempotent)
docker_swarm:
state: present
log_entries_for_slow_followers: 42
diff: yes
register: output_3
- name: log_entries_for_slow_followers (idempotent, check mode)
@ -585,7 +455,6 @@
state: present
log_entries_for_slow_followers: 42
check_mode: yes
diff: yes
register: output_4
- name: log_entries_for_slow_followers (change, check mode)
@ -593,14 +462,12 @@
state: present
log_entries_for_slow_followers: 23
check_mode: yes
diff: yes
register: output_5
- name: log_entries_for_slow_followers (change)
docker_swarm:
state: present
log_entries_for_slow_followers: 23
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -608,28 +475,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## name ############################################################
@ -639,14 +494,12 @@
state: present
name: default
check_mode: yes
diff: yes
register: output_1
- name: name (idempotent)
docker_swarm:
state: present
name: default
diff: yes
register: output_2
# The name 'default' is hardcoded in docker swarm. Trying to change
@ -656,7 +509,6 @@
docker_swarm:
state: present
name: foobar
diff: yes
register: output_3
ignore_errors: yes
@ -665,12 +517,8 @@
that:
- 'output_1 is not changed'
- 'output_1.actions[0] == "No modification"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is not changed'
- 'output_2.actions[0] == "No modification"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is failed or output_3 is changed'
####################################################################
@ -681,21 +529,18 @@
state: present
node_cert_expiry: 7896000000000000
check_mode: yes
diff: yes
register: output_1
- name: node_cert_expiry
docker_swarm:
state: present
node_cert_expiry: 7896000000000000
diff: yes
register: output_2
- name: node_cert_expiry (idempotent)
docker_swarm:
state: present
node_cert_expiry: 7896000000000000
diff: yes
register: output_3
- name: node_cert_expiry (idempotent, check mode)
@ -703,7 +548,6 @@
state: present
node_cert_expiry: 7896000000000000
check_mode: yes
diff: yes
register: output_4
- name: node_cert_expiry (change, check mode)
@ -711,14 +555,12 @@
state: present
node_cert_expiry: 8766000000000000
check_mode: yes
diff: yes
register: output_5
- name: node_cert_expiry (change)
docker_swarm:
state: present
node_cert_expiry: 8766000000000000
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -726,28 +568,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## rotate_manager_token ############################################
@ -757,21 +587,18 @@
state: present
rotate_manager_token: yes
check_mode: yes
diff: yes
register: output_1
- name: rotate_manager_token (true)
docker_swarm:
state: present
rotate_manager_token: yes
diff: yes
register: output_2
- name: rotate_manager_token (false, idempotent)
docker_swarm:
state: present
rotate_manager_token: no
diff: yes
register: output_3
- name: rotate_manager_token (false, check mode)
@ -779,7 +606,6 @@
state: present
rotate_manager_token: no
check_mode: yes
diff: yes
register: output_4
- name: assert changed when remove a swarm cluster
@ -787,20 +613,12 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
####################################################################
## rotate_worker_token #############################################
@ -810,21 +628,18 @@
state: present
rotate_worker_token: yes
check_mode: yes
diff: yes
register: output_1
- name: rotate_worker_token (true)
docker_swarm:
state: present
rotate_worker_token: yes
diff: yes
register: output_2
- name: rotate_worker_token (false, idempotent)
docker_swarm:
state: present
rotate_worker_token: no
diff: yes
register: output_3
- name: rotate_worker_token (false, check mode)
@ -832,7 +647,6 @@
state: present
rotate_worker_token: no
check_mode: yes
diff: yes
register: output_4
- name: assert changed when remove a swarm cluster
@ -840,20 +654,12 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
####################################################################
## snapshot_interval ###############################################
@ -863,21 +669,18 @@
state: present
snapshot_interval: 12345
check_mode: yes
diff: yes
register: output_1
- name: snapshot_interval
docker_swarm:
state: present
snapshot_interval: 12345
diff: yes
register: output_2
- name: snapshot_interval (idempotent)
docker_swarm:
state: present
snapshot_interval: 12345
diff: yes
register: output_3
- name: snapshot_interval (idempotent, check mode)
@ -885,7 +688,6 @@
state: present
snapshot_interval: 12345
check_mode: yes
diff: yes
register: output_4
- name: snapshot_interval (change, check mode)
@ -893,14 +695,12 @@
state: present
snapshot_interval: 54321
check_mode: yes
diff: yes
register: output_5
- name: snapshot_interval (change)
docker_swarm:
state: present
snapshot_interval: 54321
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -908,28 +708,16 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'
####################################################################
## task_history_retention_limit ####################################
@ -939,21 +727,18 @@
state: present
task_history_retention_limit: 23
check_mode: yes
diff: yes
register: output_1
- name: task_history_retention_limit
docker_swarm:
state: present
task_history_retention_limit: 23
diff: yes
register: output_2
- name: task_history_retention_limit (idempotent)
docker_swarm:
state: present
task_history_retention_limit: 23
diff: yes
register: output_3
- name: task_history_retention_limit (idempotent, check mode)
@ -961,7 +746,6 @@
state: present
task_history_retention_limit: 23
check_mode: yes
diff: yes
register: output_4
- name: task_history_retention_limit (change, check mode)
@ -969,14 +753,12 @@
state: present
task_history_retention_limit: 7
check_mode: yes
diff: yes
register: output_5
- name: task_history_retention_limit (change)
docker_swarm:
state: present
task_history_retention_limit: 7
diff: yes
register: output_6
- name: assert changed when remove a swarm cluster
@ -984,25 +766,13 @@
that:
- 'output_1 is changed'
- 'output_1.actions[0] == "Swarm cluster updated"'
- 'output_1.diff.before is defined'
- 'output_1.diff.after is defined'
- 'output_2 is changed'
- 'output_2.actions[0] == "Swarm cluster updated"'
- 'output_2.diff.before is defined'
- 'output_2.diff.after is defined'
- 'output_3 is not changed'
- 'output_3.actions[0] == "No modification"'
- 'output_3.diff.before is defined'
- 'output_3.diff.after is defined'
- 'output_4 is not changed'
- 'output_4.actions[0] == "No modification"'
- 'output_4.diff.before is defined'
- 'output_4.diff.after is defined'
- 'output_5 is changed'
- 'output_5.actions[0] == "Swarm cluster updated"'
- 'output_5.diff.before is defined'
- 'output_5.diff.after is defined'
- 'output_6 is changed'
- 'output_6.actions[0] == "Swarm cluster updated"'
- 'output_6.diff.before is defined'
- 'output_6.diff.after is defined'

Loading…
Cancel
Save