Fix Boolean values defaulting to False in collection (#14493)

* Fix Boolean values defaulting to False in collection

* Remove null values in other cases, fix null handling for WFJT nodes

* Only remove null values if it is a boolean field

* Reset changes to WFJT node field processing

* Use test content from sean-m-sullivan to fix lookups in assert
This commit is contained in:
Alan Rominger
2023-10-24 14:29:16 -04:00
committed by GitHub
parent 20f5b255c9
commit b6b167627c
3 changed files with 37 additions and 0 deletions

View File

@@ -42,6 +42,16 @@
that:
- "result is not changed"
- name: Modify the host as a no-op
host:
name: "{{ host_name }}"
inventory: "{{ inv_name }}"
register: result
- assert:
that:
- "result is not changed"
- name: Delete a Host
host:
name: "{{ host_name }}"
@@ -68,6 +78,15 @@
that:
- "result is changed"
- name: Use lookup to check that host was enabled
ansible.builtin.set_fact:
host_enabled_test: "lookup('awx.awx.controller_api', 'hosts/{{result.id}}/').enabled"
- name: Newly created host should have API default value for enabled
assert:
that:
- host_enabled_test
- name: Delete a Host
host:
name: "{{ result.id }}"

View File

@@ -76,6 +76,15 @@
that:
- result is changed
- name: Use lookup to check that schedules was enabled
ansible.builtin.set_fact:
schedules_enabled_test: "lookup('awx.awx.controller_api', 'schedules/{{result.id}}/').enabled"
- name: Newly created schedules should have API default value for enabled
assert:
that:
- schedules_enabled_test
- name: Build a real schedule with exists
schedule:
name: "{{ sched1 }}"