Skip to content

Commit d168528

Browse files
author
Alan Christie
committed
test: Fix for check-mode
1 parent 5c2e1e9 commit d168528

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

roles/k8s_database_dump/tasks/main.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737

3838
- name: Dump database
3939
ansible.builtin.include_tasks: dump-database.yaml
40-
when: k8s_database_dump_version_ok
40+
when:
41+
- k8s_database_dump_version_ok is defined
42+
- k8s_database_dump_version_ok
4143

4244
# Always kill the async command
4345

@@ -72,14 +74,17 @@
7274
fail_msg: >-
7375
Dump of the '{{ kdd_db_database }}' database failed.
7476
Error is '{{ kdd_db_error_message }}'
77+
when: not ansible_check_mode
7578

7679
- name: Stat the written file
7780
ansible.builtin.stat:
7881
path: "{{ dump_file }}"
7982
register: dump_file_stat
83+
when: not ansible_check_mode
8084

8185
- name: Display summary
8286
ansible.builtin.debug:
8387
msg:
8488
- The '{{ kdd_db_database }}' database has been dumped to '{{ dump_file }}'
8589
- Size {{ ansible_check_mode | ternary(0, dump_file_stat.stat.size) }} bytes
90+
when: not ansible_check_mode

0 commit comments

Comments
 (0)