Skip to content

Commit 1dac35f

Browse files
danpawlikmichburk
authored andcommitted
[cifmw_helpers] Set facts cacheable to be parametrized
In come case, we would like to not make the facts to be cached. Let's set it as a parameter. Signed-off-by: Daniel Pawlik <dpawlik@redhat.com>
1 parent 4f13abf commit 1dac35f

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

roles/cifmw_helpers/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
cifmw_helpers_project_dir: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}"
33
cifmw_helpers_ansible_collection_dir: "{{ ansible_user_dir }}/.ansible/collections/ansible_collections"
44
cifmw_helpers_no_log: true
5+
cifmw_helpers_cacheable_facts: true

roles/cifmw_helpers/tasks/set_dir_facts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
when: "'content' in dir_item"
44
ansible.builtin.set_fact:
55
"{{ _file_content.key }}": "{{ _file_content.value }}"
6-
cacheable: true
6+
cacheable: "{{ cifmw_helpers_cacheable_facts }}"
77
loop: "{{ dir_item['content'] | b64decode | from_yaml | dict2items }}"
88
loop_control:
99
loop_var: _file_content

roles/cifmw_helpers/tasks/var_file.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
when: "'content' in _parsed_vars"
2424
ansible.builtin.set_fact:
2525
"{{ file_item.key }}": "{{ file_item.value }}"
26-
cacheable: true
26+
cacheable: "{{ cifmw_helpers_cacheable_facts }}"
2727
loop: "{{ _parsed_vars['content'] | b64decode | from_yaml | dict2items }}"
2828
no_log: "{{ cifmw_helpers_no_log }}"
2929
loop_control:

roles/cifmw_helpers/tasks/various_vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- name: Filter just dict and set as fact
1212
ansible.builtin.set_fact:
1313
"{{ various_item.key }}": "{{ various_item.value }}"
14-
cacheable: true
14+
cacheable: "{{ cifmw_helpers_cacheable_facts }}"
1515
loop: "{{ (various_vars | select('mapping') | list) | map('dict2items') | flatten }}"
1616
loop_control:
1717
loop_var: various_item

0 commit comments

Comments
 (0)