1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00
awx/awx_collection/tests/integration/targets/tower_settings/tasks/main.yml

88 lines
1.8 KiB
YAML
Raw Normal View History

---
2020-02-28 23:36:32 +03:00
- name: Set the value of AWX_PROOT_SHOW_PATHS to a baseline
tower_settings:
name: AWX_PROOT_SHOW_PATHS
value: '["/var/lib/awx/projects/"]'
- name: Set the value of AWX_PROOT_SHOW_PATHS to get an error back from Tower
tower_settings:
settings:
AWX_PROOT_SHOW_PATHS:
'not': 'a valid'
'tower': 'setting'
register: result
ignore_errors: true
2020-02-28 23:36:32 +03:00
- assert:
that:
- "result is failed"
- name: Set the value of AWX_PROOT_SHOW_PATHS
tower_settings:
name: AWX_PROOT_SHOW_PATHS
value: '["/var/lib/awx/projects/", "/tmp"]'
register: result
- assert:
that:
- "result is changed"
- name: Attempt to set the value of AWX_PROOT_BASE_PATH to what it already is
tower_settings:
name: AWX_PROOT_BASE_PATH
value: /tmp
register: result
- debug:
msg: "{{ result }}"
- assert:
that:
- "result is not changed"
- name: Apply a single setting via settings
tower_settings:
name: AWX_PROOT_SHOW_PATHS
value: '["/var/lib/awx/projects/", "/var/tmp"]'
register: result
- assert:
that:
- "result is changed"
- name: Apply multiple setting via settings with no change
tower_settings:
settings:
AWX_PROOT_BASE_PATH: /tmp
AWX_PROOT_SHOW_PATHS: ["/var/lib/awx/projects/", "/var/tmp"]
2020-02-28 23:36:32 +03:00
register: result
- debug:
msg: "{{ result }}"
- assert:
that:
- "result is not changed"
- name: Apply multiple setting via settings with change
tower_settings:
settings:
AWX_PROOT_BASE_PATH: /tmp
AWX_PROOT_SHOW_PATHS: []
2020-02-28 23:36:32 +03:00
register: result
- assert:
that:
- "result is changed"
2020-06-05 20:29:37 +03:00
- name: Handle an omit value
tower_settings:
name: AWX_PROOT_BASE_PATH
value: '{{ junk_var | default(omit) }}'
register: result
ignore_errors: true
- assert:
that:
- "'Unable to update settings' in result.msg"