Skip to content

Commit d4b2b80

Browse files
authored
fix checking issues in the when clauses (#189)
* fix checking issues in the when clauses * add changelog fragment
1 parent 4b0d22f commit d4b2b80

35 files changed

+150
-34
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
bugfixes:
3+
- Fix checking issues in the when clauses in `filetree_read` role
4+
...

roles/filetree_create/templates/controller_settings.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ controller_settings:
66
{{ key | indent(width=6, first=True) }}:
77
{{ value | to_nice_yaml(indent=2, sort_keys=false) | indent(width=8, first=True) }}
88
{% elif key is match('AUTOMATION_ANALYTICS_LAST_ENTRIES') %}
9-
{{ key | indent(width=6, first=True) }}: {{ value | from_json }}
9+
{{ key | indent(width=6, first=True) }}: "{{ value | from_json }}"
1010
{% else %}
1111
{{ key | indent(width=6, first=True) }}: "{{ value | replace('True', 'true') | replace('False', 'false') | replace('None', 'null') }}"
1212
{% endif %}

roles/filetree_read/tasks/controller_credential_input_sources.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
loop_control:
2626
loop_var: __populate_input_sources_list_item
2727
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
28-
when: __contents_filetree_controller_credential_input_sources.results is defined and __populate_input_sources_list_item.ansible_facts.controller_credential_input_sources is defined
28+
when:
29+
- __contents_filetree_controller_credential_input_sources is defined
30+
- __contents_filetree_controller_credential_input_sources.results is defined
31+
- __contents_filetree_controller_credential_input_sources.results | length > 0
32+
- __populate_input_sources_list_item.ansible_facts.controller_credential_input_sources is defined
2933

3034
- name: "Set Credential Input Sources Data Structure"
3135
ansible.builtin.set_fact:

roles/filetree_read/tasks/controller_credential_types.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
loop_control:
2626
loop_var: __populate_credentials_list_item
2727
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
28-
when: __contents_filetree_controller_credential_types.results is defined and __populate_credentials_list_item.ansible_facts.controller_credential_types is defined
28+
when:
29+
- __contents_filetree_controller_credential_types is defined
30+
- __contents_filetree_controller_credential_types.results is defined
31+
- __contents_filetree_controller_credential_types.results | length > 0
32+
- __populate_credentials_list_item.ansible_facts.controller_credential_types is defined
2933

3034
- name: "Set Projects Data Structure"
3135
ansible.builtin.set_fact:

roles/filetree_read/tasks/controller_credentials.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
ansible.builtin.flatten
2929
}}
3030
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
31-
when: __contents_filetree_controller_credentials.results
31+
when:
32+
- __contents_filetree_controller_credentials is defined
33+
- __contents_filetree_controller_credentials.results is defined
34+
- __contents_filetree_controller_credentials.results | length > 0
3235

3336
- name: "Segregated Credentials list when controller_location is defined"
3437
when: controller_location is defined and __populate_controller_credentials is defined

roles/filetree_read/tasks/controller_execution_environments.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
loop_control:
2626
loop_var: __populate_execution_environments_list_item
2727
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
28-
when: __contents_filetree_controller_execution_environments.results is defined and __populate_execution_environments_list_item.ansible_facts.controller_execution_environments is defined
28+
when:
29+
- __contents_filetree_controller_execution_environments is defined
30+
- __contents_filetree_controller_execution_environments.results is defined
31+
- __contents_filetree_controller_execution_environments.results | length > 0
32+
- __populate_execution_environments_list_item.ansible_facts.controller_execution_environments is defined
2933

3034
- name: "Segregated Execution Environments list when controller_location is defined"
3135
when: controller_location is defined and __populate_controller_execution_environments is defined

roles/filetree_read/tasks/controller_host_groups.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
loop_control:
2626
loop_var: __populate_groups_list_item
2727
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
28-
when: __contents_filetree_controller_groups.results is defined and __populate_groups_list_item.ansible_facts.controller_groups is defined
28+
when:
29+
- __contents_filetree_controller_groups is defined
30+
- __contents_filetree_controller_groups.results is defined
31+
- __contents_filetree_controller_groups.results | length > 0
32+
- __populate_groups_list_item.ansible_facts.controller_groups is defined
2933

3034
- name: "Set Groups Data Structure"
3135
ansible.builtin.set_fact:

roles/filetree_read/tasks/controller_hosts.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
ansible.builtin.flatten
2929
}}
3030
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
31-
when: __contents_filetree_controller_hosts.results
31+
when:
32+
- __contents_filetree_controller_hosts is defined
33+
- __contents_filetree_controller_hosts.results is defined
34+
- __contents_filetree_controller_hosts.results | length > 0
3235

3336
- name: "Segregated Hosts list when controller_location is defined"
3437
when: controller_location is defined and __populate_controller_hosts is defined

roles/filetree_read/tasks/controller_instance_groups.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
loop_control:
2626
loop_var: __populate_instance_groups_list_item
2727
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
28-
when: __contents_filetree_controller_instance_groups.results is defined and __populate_instance_groups_list_item.ansible_facts.controller_instance_groups is defined
28+
when:
29+
- __contents_filetree_controller_instance_groups is defined
30+
- __contents_filetree_controller_instance_groups.results is defined
31+
- __contents_filetree_controller_instance_groups.results | length > 0
32+
- __populate_instance_groups_list_item.ansible_facts.controller_instance_groups is defined
2933

3034
- name: "Segregated Instance Groups list when controller_location is defined"
3135
when: controller_location is defined and __populate_controller_instance_groups is defined

roles/filetree_read/tasks/controller_inventories.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@
2828
ansible.builtin.flatten
2929
}}
3030
no_log: "{{ controller_configuration_filetree_read_secure_logging }}"
31-
when: __contents_filetree_controller_inventories.results
31+
when:
32+
- __contents_filetree_controller_inventories is defined
33+
- __contents_filetree_controller_inventories.results is defined
34+
- __contents_filetree_controller_inventories.results | length > 0
3235
...

0 commit comments

Comments
 (0)