2020-02-29 00:49:55 +03:00
---
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
2020-02-29 00:49:55 +03:00
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 :
2020-02-29 00:49:55 +03:00
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 :
2020-02-29 00:49:55 +03:00
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) }}'
2020-06-08 16:57:16 +03:00
register : result
ignore_errors : true
- assert :
that :
- "'Unable to update settings' in result.msg"