Merge "Configure the pci_passthrough_whitelist via THT"
[apex-tripleo-heat-templates.git] / puppet / all-nodes-config.yaml
1 heat_template_version: 2016-10-14
2 description: 'All Nodes Config for Puppet'
3
4 parameters:
5   hosts:
6     type: comma_delimited_list
7   # FIXME(shardy) this can be comma_delimited_list when
8   # https://bugs.launchpad.net/heat/+bug/1617019 is fixed
9   enabled_services:
10     type: string
11   controller_ips:
12     type: comma_delimited_list
13   service_ips:
14     type: json
15   controller_names:
16     type: comma_delimited_list
17   rabbit_node_ips:
18     type: comma_delimited_list
19   memcache_node_ips:
20     type: comma_delimited_list
21   keystone_public_api_node_ips:
22     type: comma_delimited_list
23   keystone_admin_api_node_ips:
24     type: comma_delimited_list
25   ceph_mon_node_ips:
26     type: comma_delimited_list
27   ceph_mon_node_names:
28     type: comma_delimited_list
29   DeployIdentifier:
30     type: string
31     description: >
32       Setting this to a unique value will re-run any deployment tasks which
33       perform configuration on a Heat stack-update.
34   UpdateIdentifier:
35     type: string
36     description: >
37       Setting to a previously unused value during stack-update will trigger
38       package update on all nodes
39   StackAction:
40     type: string
41     description: >
42       Heat action on performed top-level stack.
43     constraints:
44     - allowed_values: ['CREATE', 'UPDATE']
45
46 resources:
47
48   allNodesConfigImpl:
49     type: OS::Heat::StructuredConfig
50     properties:
51       group: os-apply-config
52       config:
53         hosts:
54           list_join:
55           - "\n"
56           - {get_param: hosts}
57         hiera:
58           datafiles:
59             bootstrap_node:
60               mapped_data:
61                 bootstrap_nodeid: {get_input: bootstrap_nodeid}
62                 bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
63             all_nodes:
64               mapped_data:
65                 map_merge:
66                   - enabled_services: {get_param: enabled_services}
67                   # This writes out a mapping of service_name_enabled: 'true'
68                   # For any services not enabled, hiera foo_enabled will
69                   # return nil, as it's undefined
70                   - map_merge:
71                       repeat:
72                         template:
73                           # Note this must be string 'true' due to
74                           # https://bugs.launchpad.net/heat/+bug/1617203
75                           SERVICE_enabled: 'true'
76                         for_each:
77                           SERVICE:
78                             str_split: [',', {get_param: enabled_services}]
79                   # provides a mapping of service_name_ips to a list of IPs
80                   - {get_param: service_ips}
81                   - controller_node_ips:
82                       list_join:
83                       - ','
84                       - {get_param: controller_ips}
85                     controller_node_names:
86                       list_join:
87                       - ','
88                       - {get_param: controller_names}
89                     galera_node_names:
90                       list_join:
91                       - ','
92                       - {get_param: controller_names}
93                     rabbitmq_node_ips: &rabbit_nodes_array
94                       str_replace:
95                         template: "['SERVERS_LIST']"
96                         params:
97                           SERVERS_LIST:
98                             list_join:
99                             - "','"
100                             - {get_param: rabbit_node_ips}
101                     memcached_node_ips_v6:
102                       str_replace:
103                         template: "['inet6:[SERVERS_LIST]']"
104                         params:
105                           SERVERS_LIST:
106                             list_join:
107                             - "]','inet6:["
108                             - {get_param: memcache_node_ips}
109                     keystone_public_api_node_ips:
110                       str_replace:
111                         template: "['SERVERS_LIST']"
112                         params:
113                           SERVERS_LIST:
114                             list_join:
115                             - "','"
116                             - {get_param: keystone_public_api_node_ips}
117                     keystone_admin_api_node_ips:
118                       str_replace:
119                         template: "['SERVERS_LIST']"
120                         params:
121                           SERVERS_LIST:
122                             list_join:
123                             - "','"
124                             - {get_param: keystone_admin_api_node_ips}
125                     tripleo::profile::base::ceph::ceph_mon_initial_members:
126                       list_join:
127                       - ','
128                       - {get_param: ceph_mon_node_names}
129                     tripleo::profile::base::ceph::ceph_mon_host:
130                       list_join:
131                       - ','
132                       - {get_param: ceph_mon_node_ips}
133                     tripleo::profile::base::ceph::ceph_mon_host_v6:
134                       str_replace:
135                         template: "'[IPS_LIST]'"
136                         params:
137                           IPS_LIST:
138                             list_join:
139                             - '],['
140                             - {get_param: ceph_mon_node_ips}
141                     # NOTE(gfidente): interpolation with %{} in the
142                     # hieradata file can't be used as it returns string
143                     ceilometer::rabbit_hosts: *rabbit_nodes_array
144                     aodh::rabbit_hosts: *rabbit_nodes_array
145                     cinder::rabbit_hosts: *rabbit_nodes_array
146                     glance::notify::rabbitmq::rabbit_hosts: *rabbit_nodes_array
147                     manila::rabbit_hosts: *rabbit_nodes_array
148                     heat::rabbit_hosts: *rabbit_nodes_array
149                     neutron::rabbit_hosts: *rabbit_nodes_array
150                     nova::rabbit_hosts: *rabbit_nodes_array
151                     keystone::rabbit_hosts: *rabbit_nodes_array
152                     sahara::rabbit_hosts: *rabbit_nodes_array
153                     ironic::rabbit_hosts: *rabbit_nodes_array
154
155                     deploy_identifier: {get_param: DeployIdentifier}
156                     update_identifier: {get_param: UpdateIdentifier}
157                     stack_action: {get_param: StackAction}
158
159 outputs:
160   config_id:
161     description: The ID of the allNodesConfigImpl resource.
162     value:
163       {get_resource: allNodesConfigImpl}
164   hosts_entries:
165     description: |
166       The content that should be appended to your /etc/hosts if you want to get
167       hostname-based access to the deployed nodes (useful for testing without
168       setting up a DNS).
169     value: {get_attr: [allNodesConfigImpl, config, hosts]}