-
Notifications
You must be signed in to change notification settings - Fork 6
/
sagenv-common-inventory.yaml
36 lines (31 loc) · 1.96 KB
/
sagenv-common-inventory.yaml
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
---
### minimum params:
### cce_provisioning_inventory_inventory_scope (type: string - where this inventory fetching operation should be run
####### and as a result, where will the variable "cce_provisioning_inventory_hosts_var" be available)
### cce_provisioning_inventory_hosts_pattern (type: string - the target ansible group to install the CCE template)
### cce_provisioning_inventory_hosts_property (type: string - the property to lookup to find the actual network host of an alias)
### cce_provisioning_inventory_hosts_add_prefix (type: string - the prefix to add to the host)
### cce_provisioning_inventory_hosts_add_suffix (type: string - the suffix to add to the host)
### cce_provisioning_inventory_hosts_join_string (type: string - the join string to use when concatenating the hosts into a single string)
### cce_provisioning_inventory_hosts_var (type: string - the variable to save the inventory hosts into)
##construct some urls from the inventory
- hosts: "{{ cce_provisioning_inventory_inventory_scope }}"
become: true
become_user: "{{ webmethods_user }}"
tasks:
- name: set initial facts
set_fact: {"{{ cce_provisioning_inventory_hosts_var }}": "[]"}
- import_role:
name: get-inventory-hosts
vars:
inventory_pattern: "{{ cce_provisioning_inventory_hosts_pattern }}"
inventory_hosts_property: "{{ cce_provisioning_inventory_hosts_property }}"
inventory_hosts_add_prefix: "{{ cce_provisioning_inventory_hosts_add_prefix }}"
inventory_hosts_add_suffix: "{{ cce_provisioning_inventory_hosts_add_suffix }}"
inventory_hosts_clear_first: true
- name: Print the params
debug:
msg:
- "get_inventory_hosts_joined = {{ get_inventory_hosts | join( cce_provisioning_inventory_hosts_join_string ) }}"
- name: assign hosts to specific facts variable
set_fact: {"{{ cce_provisioning_inventory_hosts_var }}":"{{ get_inventory_hosts | join( cce_provisioning_inventory_hosts_join_string ) }}"}