Skip to content

Commit b614420

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix Opensearch role support for Ansible check mode"
2 parents 29f4fa5 + 33fa9c1 commit b614420

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ansible/roles/opensearch/tasks/post-config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
retries: 30
1414
delay: 2
1515
run_once: true
16+
when: not ansible_check_mode
1617

1718
- name: Check if a log retention policy exists
1819
become: true
@@ -46,7 +47,9 @@
4647
delegate_to: "{{ groups['opensearch'][0] }}"
4748
run_once: true
4849
changed_when: opensearch_retention_policy_create.status == 201
49-
when: opensearch_retention_policy_check.status == 404
50+
when:
51+
- not ansible_check_mode
52+
- opensearch_retention_policy_check.status == 404
5053

5154
- name: Apply retention policy to existing indices
5255
become: true
@@ -66,4 +69,6 @@
6669
delegate_to: "{{ groups['opensearch'][0] }}"
6770
run_once: true
6871
changed_when: opensearch_retention_policy_create.status == 201
69-
when: opensearch_retention_policy_check.status == 404
72+
when:
73+
- not ansible_check_mode
74+
- opensearch_retention_policy_check.status == 404

0 commit comments

Comments
 (0)