diff options
Diffstat (limited to 'puppet/role.role.j2.yaml')
-rw-r--r-- | puppet/role.role.j2.yaml | 244 |
1 files changed, 133 insertions, 111 deletions
diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index 4911fbe9..e1a23ab3 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -1,18 +1,18 @@ heat_template_version: pike -description: 'OpenStack {{role}} node configured by Puppet' +description: 'OpenStack {{role.name}} node configured by Puppet' parameters: - Overcloud{{role}}Flavor: - description: Flavor for the {{role}} node. + Overcloud{{role.name}}Flavor: + description: Flavor for the {{role.name}} node. default: baremetal type: string -{% if disable_constraints is not defined %} +{% if role.disable_constraints is not defined %} constraints: - custom_constraint: nova.flavor {% endif %} - {{role}}Image: + {{role.name}}Image: type: string default: overcloud-full -{% if disable_constraints is not defined %} +{% if role.disable_constraints is not defined %} constraints: - custom_constraint: glance.image {% endif %} @@ -24,13 +24,17 @@ parameters: description: Name of an existing Nova key pair to enable SSH access to the instances type: string default: default -{% if disable_constraints is not defined %} +{% if role.disable_constraints is not defined %} constraints: - custom_constraint: nova.keypair {% endif %} + NeutronPhysicalBridge: + default: 'br-ex' + description: An OVS bridge to create for accessing tenant networks. + type: string NeutronPublicInterface: default: nic1 - description: What interface to bridge onto br-ex for network nodes. + description: Which interface to add to the NeutronPhysicalBridge. type: string ServiceNetMap: default: {} @@ -59,14 +63,14 @@ parameters: default: {} description: | Additional hiera configuration to inject into the cluster. Note - that {{role}}ExtraConfig takes precedence over ExtraConfig. + that {{role.name}}ExtraConfig takes precedence over ExtraConfig. type: json - {{role}}ExtraConfig: + {{role.name}}ExtraConfig: default: {} description: | Role specific additional hiera configuration to inject into the cluster. type: json - {{role}}IPs: + {{role.name}}IPs: default: {} type: json NetworkDeploymentActions: @@ -87,7 +91,7 @@ parameters: description: > The DNS domain used for the hosts. This must match the overcloud_domain_name configured on the undercloud. - {{role}}ServerMetadata: + {{role.name}}ServerMetadata: default: {} description: > Extra properties or metadata passed to Nova for the created nodes in @@ -102,7 +106,7 @@ parameters: the overcloud. It's accessible via the Nova metadata API. This applies to all roles and is merged with a role-specific metadata parameter. type: json - {{role}}SchedulerHints: + {{role.name}}SchedulerHints: type: json description: Optional scheduler hints to pass to nova default: {} @@ -165,6 +169,25 @@ parameters: type: json description: Role Specific Parameters default: {} + DeploymentSwiftDataMap: + type: json + description: | + Map of servers to Swift container and object for storing deployment data. + The keys are the Heat assigned hostnames, and the value is a map of the + container/object name in Swift. Example value: + overcloud-controller-0: + container: overcloud-controller + object: 0 + overcloud-controller-1: + container: overcloud-controller + object: 1 + overcloud-controller-2: + container: overcloud-controller + object: 2 + overcloud-novacompute-0: + container: overcloud-compute + object: 0 + default: {} conditions: server_not_blacklisted: @@ -172,18 +195,24 @@ conditions: equals: - {get_param: [DeploymentServerBlacklistDict, {get_param: Hostname}]} - 1 + deployment_swift_data_map_unset: + equals: + - get_param: + - DeploymentSwiftDataMap + - {get_param: Hostname} + - "" resources: - {{role}}: + {{role.name}}: type: OS::TripleO::{{role.name}}Server metadata: os-collect-config: command: {get_param: ConfigCommand} splay: {get_param: ConfigCollectSplay} properties: - image: {get_param: {{role}}Image} + image: {get_param: {{role.name}}Image} image_update_policy: {get_param: ImageUpdatePolicy} - flavor: {get_param: Overcloud{{role}}Flavor} + flavor: {get_param: Overcloud{{role.name}}Flavor} key_name: {get_param: KeyName} networks: - network: ctlplane @@ -197,9 +226,15 @@ resources: metadata: map_merge: - {get_param: ServerMetadata} - - {get_param: {{role}}ServerMetadata} + - {get_param: {{role.name}}ServerMetadata} - {get_param: ServiceMetadataSettings} - scheduler_hints: {get_param: {{role}}SchedulerHints} + scheduler_hints: {get_param: {{role.name}}SchedulerHints} + deployment_swift_data: + if: + - deployment_swift_data_map_unset + - {} + - {get_param: [DeploymentSwiftDataMap, + {get_param: Hostname}]} # Combine the NodeAdminUserData and NodeUserData mime archives UserData: @@ -226,54 +261,54 @@ resources: # For optional operator role-specific userdata # Should return a OS::Heat::MultipartMime reference via OS::stack_id RoleUserData: - type: OS::TripleO::{{role}}::NodeUserData + type: OS::TripleO::{{role.name}}::NodeUserData ExternalPort: - type: OS::TripleO::{{role}}::Ports::ExternalPort + type: OS::TripleO::{{role.name}}::Ports::ExternalPort properties: - ControlPlaneIP: {get_attr: [{{role}}, networks, ctlplane, 0]} - IPPool: {get_param: {{role}}IPs} + ControlPlaneIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} + IPPool: {get_param: {{role.name}}IPs} NodeIndex: {get_param: NodeIndex} InternalApiPort: - type: OS::TripleO::{{role}}::Ports::InternalApiPort + type: OS::TripleO::{{role.name}}::Ports::InternalApiPort properties: - ControlPlaneIP: {get_attr: [{{role}}, networks, ctlplane, 0]} - IPPool: {get_param: {{role}}IPs} + ControlPlaneIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} + IPPool: {get_param: {{role.name}}IPs} NodeIndex: {get_param: NodeIndex} StoragePort: - type: OS::TripleO::{{role}}::Ports::StoragePort + type: OS::TripleO::{{role.name}}::Ports::StoragePort properties: - ControlPlaneIP: {get_attr: [{{role}}, networks, ctlplane, 0]} - IPPool: {get_param: {{role}}IPs} + ControlPlaneIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} + IPPool: {get_param: {{role.name}}IPs} NodeIndex: {get_param: NodeIndex} StorageMgmtPort: - type: OS::TripleO::{{role}}::Ports::StorageMgmtPort + type: OS::TripleO::{{role.name}}::Ports::StorageMgmtPort properties: - ControlPlaneIP: {get_attr: [{{role}}, networks, ctlplane, 0]} - IPPool: {get_param: {{role}}IPs} + ControlPlaneIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} + IPPool: {get_param: {{role.name}}IPs} NodeIndex: {get_param: NodeIndex} TenantPort: - type: OS::TripleO::{{role}}::Ports::TenantPort + type: OS::TripleO::{{role.name}}::Ports::TenantPort properties: - ControlPlaneIP: {get_attr: [{{role}}, networks, ctlplane, 0]} - IPPool: {get_param: {{role}}IPs} + ControlPlaneIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} + IPPool: {get_param: {{role.name}}IPs} NodeIndex: {get_param: NodeIndex} ManagementPort: - type: OS::TripleO::{{role}}::Ports::ManagementPort + type: OS::TripleO::{{role.name}}::Ports::ManagementPort properties: - ControlPlaneIP: {get_attr: [{{role}}, networks, ctlplane, 0]} - IPPool: {get_param: {{role}}IPs} + ControlPlaneIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} + IPPool: {get_param: {{role.name}}IPs} NodeIndex: {get_param: NodeIndex} NetworkConfig: - type: OS::TripleO::{{role}}::Net::SoftwareConfig + type: OS::TripleO::{{role.name}}::Net::SoftwareConfig properties: - ControlPlaneIp: {get_attr: [{{role}}, networks, ctlplane, 0]} + ControlPlaneIp: {get_attr: [{{role.name}}, networks, ctlplane, 0]} ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]} InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]} StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]} @@ -284,7 +319,7 @@ resources: NetIpMap: type: OS::TripleO::Network::Ports::NetIpMap properties: - ControlPlaneIp: {get_attr: [{{role}}, networks, ctlplane, 0]} + ControlPlaneIp: {get_attr: [{{role.name}}, networks, ctlplane, 0]} ExternalIp: {get_attr: [ExternalPort, ip_address]} ExternalIpSubnet: {get_attr: [ExternalPort, ip_subnet]} ExternalIpUri: {get_attr: [ExternalPort, ip_address_uri]} @@ -313,93 +348,93 @@ resources: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - external - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - external internal_api: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - internalapi - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - internalapi storage: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - storage - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - storage storage_mgmt: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - storagemgmt - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - storagemgmt tenant: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - tenant - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - tenant management: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - management - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - management ctlplane: fqdn: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - ctlplane - {get_param: CloudDomain} short: list_join: - '.' - - - {get_attr: [{{role}}, name]} + - - {get_attr: [{{role.name}}, name]} - ctlplane PreNetworkConfig: - type: OS::TripleO::{{role}}::PreNetworkConfig + type: OS::TripleO::{{role.name}}::PreNetworkConfig properties: - server: {get_resource: {{role}}} + server: {get_resource: {{role.name}}} RoleParameters: {get_param: RoleParameters} - deployment_actions: {get_attr: [DeploymentActions, value]} + ServiceNames: {get_param: ServiceNames} NetworkDeployment: type: OS::TripleO::SoftwareDeployment @@ -407,10 +442,10 @@ resources: properties: name: NetworkDeployment config: {get_resource: NetworkConfig} - server: {get_resource: {{role}}} + server: {get_resource: {{role.name}}} actions: {get_param: NetworkDeploymentActions} input_values: - bridge_name: br-ex + bridge_name: {get_param: NeutronPhysicalBridge} interface_name: {get_param: NeutronPublicInterface} actions: if: @@ -418,7 +453,7 @@ resources: - {get_param: NetworkDeploymentActions} - [] - {{role}}UpgradeInitConfig: + {{role.name}}UpgradeInitConfig: type: OS::Heat::SoftwareConfig properties: group: script @@ -432,26 +467,26 @@ resources: # Note we may be able to make this conditional on UpgradeInitCommandNotEmpty # but https://bugs.launchpad.net/heat/+bug/1649900 needs fixing first - {{role}}UpgradeInitDeployment: + {{role.name}}UpgradeInitDeployment: type: OS::Heat::SoftwareDeployment depends_on: NetworkDeployment properties: - name: {{role}}UpgradeInitDeployment - server: {get_resource: {{role}}} - config: {get_resource: {{role}}UpgradeInitConfig} + name: {{role.name}}UpgradeInitDeployment + server: {get_resource: {{role.name}}} + config: {get_resource: {{role.name}}UpgradeInitConfig} actions: if: - server_not_blacklisted - ['CREATE', 'UPDATE'] - [] - {{role}}Deployment: + {{role.name}}Deployment: type: OS::Heat::StructuredDeployment - depends_on: {{role}}UpgradeInitDeployment + depends_on: {{role.name}}UpgradeInitDeployment properties: - name: {{role}}Deployment - config: {get_resource: {{role}}Config} - server: {get_resource: {{role}}} + name: {{role.name}}Deployment + config: {get_resource: {{role.name}}Config} + server: {get_resource: {{role.name}}} input_values: enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]} actions: @@ -460,7 +495,7 @@ resources: - ['CREATE', 'UPDATE'] - [] - {{role}}Config: + {{role.name}}Config: type: OS::Heat::StructuredConfig properties: group: hiera @@ -469,11 +504,11 @@ resources: - '"%{::uuid}"' - heat_config_%{::deploy_config_name} - config_step - - {{role.lower()}}_extraconfig + - {{role.name.lower()}}_extraconfig - extraconfig - service_names - service_configs - - {{role.lower()}} + - {{role.name.lower()}} - bootstrap_node # provided by allNodesConfig - all_nodes # provided by allNodesConfig - vip_data # provided by allNodesConfig @@ -487,9 +522,9 @@ resources: map_replace: - {get_param: ServiceConfigSettings} - values: {get_attr: [NetIpMap, net_ip_map]} - {{role.lower()}}_extraconfig: {get_param: {{role}}ExtraConfig} + {{role.name.lower()}}_extraconfig: {get_param: {{role.name}}ExtraConfig} extraconfig: {get_param: ExtraConfig} - {{role.lower()}}: + {{role.name.lower()}}: tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade} tripleo::profile::base::logging::fluentd::fluentd_sources: {get_param: LoggingSources} tripleo::profile::base::logging::fluentd::fluentd_groups: {get_param: LoggingGroups} @@ -503,31 +538,25 @@ resources: # Resource for site-specific injection of root certificate NodeTLSCAData: - depends_on: {{role}}Deployment + depends_on: {{role.name}}Deployment type: OS::TripleO::NodeTLSCAData properties: - server: {get_resource: {{role}}} + server: {get_resource: {{role.name}}} # Hook for site-specific additional pre-deployment config, e.g extra hieradata - {{role}}ExtraConfigPre: - depends_on: {{role}}Deployment - type: OS::TripleO::{{role}}ExtraConfigPre - # We have to use conditions here so that we don't break backwards - # compatibility with templates everywhere - condition: server_not_blacklisted + {{role.name}}ExtraConfigPre: + depends_on: {{role.name}}Deployment + type: OS::TripleO::{{role.name}}ExtraConfigPre properties: - server: {get_resource: {{role}}} + server: {get_resource: {{role.name}}} # Hook for site-specific additional pre-deployment config, # applying to all nodes, e.g node registration/unregistration NodeExtraConfig: - depends_on: [{{role}}ExtraConfigPre, NodeTLSCAData] + depends_on: [{{role.name}}ExtraConfigPre, NodeTLSCAData] type: OS::TripleO::NodeExtraConfig - # We have to use conditions here so that we don't break backwards - # compatibility with templates everywhere - condition: server_not_blacklisted properties: - server: {get_resource: {{role}}} + server: {get_resource: {{role.name}}} UpdateConfig: type: OS::TripleO::Tasks::PackageUpdate @@ -538,7 +567,7 @@ resources: properties: name: UpdateDeployment config: {get_resource: UpdateConfig} - server: {get_resource: {{role}}} + server: {get_resource: {{role.name}}} input_values: update_identifier: get_param: UpdateIdentifier @@ -548,29 +577,19 @@ resources: - ['CREATE', 'UPDATE'] - [] - DeploymentActions: - type: OS::Heat::Value - properties: - value: - if: - - server_not_blacklisted - - ['CREATE', 'UPDATE'] - - [] - SshHostPubKey: type: OS::TripleO::Ssh::HostPubKey - depends_on: {{role}}Deployment + depends_on: {{role.name}}Deployment properties: - server: {get_resource: {{role}}} - deployment_actions: {get_attr: [DeploymentActions, value]} + server: {get_resource: {{role.name}}} outputs: ip_address: description: IP address of the server in the ctlplane network - value: {get_attr: [{{role}}, networks, ctlplane, 0]} + value: {get_attr: [{{role.name}}, networks, ctlplane, 0]} hostname: description: Hostname of the server - value: {get_attr: [{{role}}, name]} + value: {get_attr: [{{role.name}}, name]} hostname_map: description: Mapping of network names to hostnames value: @@ -594,9 +613,9 @@ outputs: MANAGEMENTIP MANAGEMENTHOST.DOMAIN MANAGEMENTHOST CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST params: - PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role}}HostnameResolveNetwork]}]} + PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]} DOMAIN: {get_param: CloudDomain} - PRIMARYHOST: {get_attr: [{{role}}, name]} + PRIMARYHOST: {get_attr: [{{role.name}}, name]} EXTERNALIP: {get_attr: [ExternalPort, ip_address]} EXTERNALHOST: {get_attr: [NetHostMap, value, external, short]} INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]} @@ -609,7 +628,7 @@ outputs: TENANTHOST: {get_attr: [NetHostMap, value, tenant, short]} MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]} MANAGEMENTHOST: {get_attr: [NetHostMap, value, management, short]} - CTLPLANEIP: {get_attr: [{{role}}, networks, ctlplane, 0]} + CTLPLANEIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]} known_hosts_entry: description: Entry for ssh known hosts @@ -624,9 +643,9 @@ TENANTIP,TENANTHOST.DOMAIN,TENANTHOST,\ MANAGEMENTIP,MANAGEMENTHOST.DOMAIN,MANAGEMENTHOST,\ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY" params: - PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role}}HostnameResolveNetwork]}]} + PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]} DOMAIN: {get_param: CloudDomain} - PRIMARYHOST: {get_attr: [{{role}}, name]} + PRIMARYHOST: {get_attr: [{{role.name}}, name]} EXTERNALIP: {get_attr: [ExternalPort, ip_address]} EXTERNALHOST: {get_attr: [NetHostMap, value, external, short]} INTERNAL_APIIP: {get_attr: [InternalApiPort, ip_address]} @@ -639,13 +658,13 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY" TENANTHOST: {get_attr: [NetHostMap, value, tenant, short]} MANAGEMENTIP: {get_attr: [ManagementPort, ip_address]} MANAGEMENTHOST: {get_attr: [NetHostMap, value, management, short]} - CTLPLANEIP: {get_attr: [{{role}}, networks, ctlplane, 0]} + CTLPLANEIP: {get_attr: [{{role.name}}, networks, ctlplane, 0]} CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]} HOSTSSHPUBKEY: {get_attr: [SshHostPubKey, ecdsa]} nova_server_resource: - description: Heat resource handle for {{role}} server + description: Heat resource handle for {{role.name}} server value: - {get_resource: {{role}}} + {get_resource: {{role.name}}} condition: server_not_blacklisted external_ip_address: description: IP address of the server in the external network @@ -665,3 +684,6 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY" management_ip_address: description: IP address of the server in the management network value: {get_attr: [ManagementPort, ip_address]} + os_collect_config: + description: The os-collect-config configuration associated with this server resource + value: {get_attr: [{{role.name}}, os_collect_config]} |