|
1 | 1 | ---
|
2 | 2 | - name: Add inventory
|
3 | 3 | awx.awx.inventory:
|
4 |
| - name: "Production" |
5 |
| - description: "{{ nfc_pb_awx_inventory.description | default('') }}" |
6 | 4 | controller_host: "{{ nfc_pb_awx_controller_host | default(omit) }}"
|
7 | 5 | controller_oauthtoken: "{{ nfc_pb_awx_controller_oauthtoken | default(omit) }}"
|
8 | 6 | controller_username: "{{ nfc_pb_awx_controller_username | default(omit) }}"
|
9 | 7 | controller_password: "{{ nfc_pb_awx_controller_password | default(omit) }}"
|
10 | 8 | organization: "{{ nfc_pb_awx_organization.name }}"
|
11 |
| - state: present |
12 | 9 | validate_certs: "{{ validate_certs | default(true) }}"
|
| 10 | + |
| 11 | + name: "{{ nfc_pb_awx_inventory.name }}" |
| 12 | + description: "{{ nfc_pb_awx_inventory.description | default('') }}" |
| 13 | + host_filter: "{{ nfc_pb_awx_inventory.host_filter | default('') }}" |
| 14 | + instance_groups: "{{ nfc_pb_awx_inventory.instance_groups | default([]) }}" |
| 15 | + prevent_instance_group_fallback: "{{ nfc_pb_awx_inventory.prevent_instance_group_fallback | default(false) | bool }}" |
| 16 | + state: "{{ nfc_pb_awx_inventory.state | default('present') }}" |
| 17 | + kind: "{{ nfc_pb_awx_inventory.kind | default(omit) }}" |
13 | 18 | # no_log: true
|
14 | 19 | diff: true
|
15 | 20 |
|
16 | 21 |
|
17 | 22 | - name: Add an inventory source
|
18 | 23 | awx.awx.inventory_source:
|
19 |
| - name: "{{ nfc_pb_awx_project.name }}" |
20 |
| - description: "{{ nfc_pb_awx_inventory.description | default('') }}" |
21 | 24 | controller_host: "{{ nfc_pb_awx_controller_host | default(omit) }}"
|
22 | 25 | controller_oauthtoken: "{{ nfc_pb_awx_controller_oauthtoken | default(omit) }}"
|
23 | 26 | controller_username: "{{ nfc_pb_awx_controller_username | default(omit) }}"
|
24 | 27 | controller_password: "{{ nfc_pb_awx_controller_password | default(omit) }}"
|
25 | 28 | validate_certs: "{{ validate_certs | default(true) }}"
|
| 29 | + |
26 | 30 | organization: "{{ nfc_pb_awx_organization.name }}"
|
27 |
| - inventory: "Production" |
| 31 | + source_project: "{{ nfc_pb_awx_project.name }}" |
| 32 | + inventory: "{{ nfc_pb_awx_inventory.name }}" |
| 33 | + name: "{{ nfc_pb_awx_inventory_source.name }}" |
| 34 | + description: "{{ nfc_pb_awx_inventory_source.description | default('') }}" |
| 35 | + |
28 | 36 | # credential: previously-created-credential
|
29 | 37 | # overwrite: True
|
30 | 38 | # update_on_launch: True
|
31 |
| - source_project: "{{ nfc_pb_awx_project.name }}" |
32 |
| - source_path: inventory/production/ |
33 |
| - source: scm |
34 |
| - state: present |
35 |
| - verbosity: 2 |
36 |
| - overwrite: "{{ nfc_pb_awx_inventory.inventory_overwrite | default(true) | bool }}" |
37 |
| - overwrite_vars: "{{ nfc_pb_awx_inventory.inventory_overwrite_vars | default(true) | bool }}" |
38 |
| - scm_branch: "{{ nfc_pb_awx_inventory.scm_branch | default(omit) }}" |
| 39 | + |
| 40 | + source_path: "{{ nfc_pb_awx_inventory_source.source_path | default(omit) }}" |
| 41 | + source: "{{ nfc_pb_awx_inventory_source.source | default('scm') }}" |
| 42 | + state: "{{ nfc_pb_awx_inventory_source.state | default('present') }}" |
| 43 | + overwrite: "{{ nfc_pb_awx_inventory_source.overwrite | default(true) | bool }}" |
| 44 | + overwrite_vars: "{{ nfc_pb_awx_inventory_source.overwrite_vars | default(true) | bool }}" |
| 45 | + scm_branch: >- |
| 46 | + {%- if nfc_pb_awx_project.scm_branch_allow_override | default(false) | bool -%} |
| 47 | + {{ nfc_pb_awx_inventory_source.scm_branch | default(nfc_pb_awx_project.scm_branch) }} |
| 48 | + {%- else -%} |
| 49 | + {{ omit }} |
| 50 | + {%- endif %} |
| 51 | + verbosity: "{{ nfc_pb_awx_inventory_source.verbosity | default(0) | int }}" |
39 | 52 | # no_log: true
|
40 | 53 | diff: true
|
| 54 | + loop: "{{ nfc_pb_awx_inventory.sources | default([]) | list }}" |
| 55 | + loop_control: |
| 56 | + loop_var: nfc_pb_awx_inventory_source |
41 | 57 |
|
42 | 58 |
|
43 |
| -- name: "Update inventory sources {{ nfc_pb_awx_project.name }}/{{ nfc_pb_awx_project.name }}" |
44 |
| - awx.awx.inventory_source_update: |
45 |
| - name: "{{ nfc_pb_awx_project.name }}" |
46 |
| - inventory: "Production" |
47 |
| - controller_host: "{{ nfc_pb_awx_controller_host | default(omit) }}" |
48 |
| - controller_oauthtoken: "{{ nfc_pb_awx_controller_oauthtoken | default(omit) }}" |
49 |
| - controller_username: "{{ nfc_pb_awx_controller_username | default(omit) }}" |
50 |
| - controller_password: "{{ nfc_pb_awx_controller_password | default(omit) }}" |
51 |
| - organization: "{{ nfc_pb_awx_organization.name }}" |
52 |
| - validate_certs: "{{ validate_certs | default(true) }}" |
53 |
| - # no_log: true |
54 |
| - diff: true |
| 59 | +# - name: "Update inventory sources {{ nfc_pb_awx_project.name }}/{{ nfc_pb_awx_project.name }}" |
| 60 | +# awx.awx.inventory_source_update: |
| 61 | +# name: "{{ nfc_pb_awx_project.name }}" |
| 62 | +# inventory: "Production" |
| 63 | +# controller_host: "{{ nfc_pb_awx_controller_host | default(omit) }}" |
| 64 | +# controller_oauthtoken: "{{ nfc_pb_awx_controller_oauthtoken | default(omit) }}" |
| 65 | +# controller_username: "{{ nfc_pb_awx_controller_username | default(omit) }}" |
| 66 | +# controller_password: "{{ nfc_pb_awx_controller_password | default(omit) }}" |
| 67 | +# organization: "{{ nfc_pb_awx_organization.name }}" |
| 68 | +# validate_certs: "{{ validate_certs | default(true) }}" |
| 69 | +# # no_log: true |
| 70 | +# diff: true |
55 | 71 |
|
56 | 72 |
|
57 | 73 | - name: "RBAC - {{ nfc_pb_awx_organization.name }}/Project/{{ nfc_pb_awx_project.name }}/Inventory"
|
|
0 commit comments