summaryrefslogtreecommitdiffstats
path: root/awx_collection/tests/integration/targets/settings/tasks/main.yml
blob: 65ae45c639a319a43deb7c5a01119f4a80fa8de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
- name: Set the value of AWX_ISOLATION_SHOW_PATHS to a baseline
  settings:
    name: AWX_ISOLATION_SHOW_PATHS
    value: '["/var/lib/awx/projects/"]'

- name: Set the value of AWX_ISOLATION_SHOW_PATHS to get an error back from the controller
  settings:
    settings:
      AWX_ISOLATION_SHOW_PATHS:
        'not': 'a valid'
        'tower': 'setting'
  register: result
  ignore_errors: true

- assert:
    that:
      - "result is failed"

- name: Set the value of AWX_ISOLATION_SHOW_PATHS
  settings:
    name: AWX_ISOLATION_SHOW_PATHS
    value: '["/var/lib/awx/projects/", "/tmp"]'
  register: result

- assert:
    that:
      - "result is changed"

- name: Attempt to set the value of AWX_ISOLATION_BASE_PATH to what it already is
  settings:
    name: AWX_ISOLATION_BASE_PATH
    value: /tmp
  register: result

- debug:
    msg: "{{ result }}"

- assert:
    that:
      - "result is not changed"

- name: Apply a single setting via settings
  settings:
    name: AWX_ISOLATION_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
  settings:
    settings:
      AWX_ISOLATION_BASE_PATH: /tmp
      AWX_ISOLATION_SHOW_PATHS: ["/var/lib/awx/projects/", "/var/tmp"]
  register: result

- debug:
    msg: "{{ result }}"

- assert:
    that:
      - "result is not changed"

- name: Apply multiple setting via settings with change
  settings:
    settings:
      AWX_ISOLATION_BASE_PATH: /tmp
      AWX_ISOLATION_SHOW_PATHS: []
  register: result

- assert:
    that:
      - "result is changed"

- name: Handle an omit value
  settings:
    name: AWX_ISOLATION_BASE_PATH
    value: '{{ junk_var | default(omit) }}'
  register: result
  ignore_errors: true

- assert:
    that:
      - "'Unable to update settings' in result.msg"