Use ansible vars nic config

Migrates the NetworkConfig resource to use ansible vars as the values
for Heat parameters for the IP and subnet cidr. This makes it so that
the nic config template value coming out of Heat is generic per role.
The same nic config can then be used for any node of that role type by
Ansible, and the Ansible vars will be resolved at config-download
runtime.

Change-Id: I7e85dabd42ccb348ea27825d03c08157222956a1
This commit is contained in:
James Slagle 2019-07-18 11:30:00 -04:00
parent 7816fa0cf7
commit f732a8390a
2 changed files with 10 additions and 2 deletions

View File

@ -506,7 +506,7 @@ resources:
NetworkConfig:
type: OS::TripleO::{{role.name}}::Net::SoftwareConfig
properties:
ControlPlaneIp: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
ControlPlaneIp: "{{ '{{' }} ctlplane_ip {{ '}}' }}"
ControlPlaneSubnetCidr:
if:
- ctlplane_subnet_cidr_set
@ -539,7 +539,7 @@ resources:
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}IpSubnet: {get_attr: [{{network.name}}Port, ip_subnet]}
{{network.name}}IpSubnet: "{{ '{{' }} {{network.name_lower}}_ip ~ '/' ~ {{network.name_lower}}_cidr {{ '}}' }}"
{{network.name}}InterfaceRoutes:
if:
- {{network.name_lower}}_interface_routes_set

View File

@ -0,0 +1,8 @@
---
features:
- |
The NetworkConfig resource now passes in ansible vars as the values for the
IP parameters to the nic config templates. This enables the nic config
template to be rendered generic per role coming out of Heat by
config-download. The templates can then be reused by any node of that same
role type.