Add ctlplane subnet attrs to group_vars

Add ctlplane subnet attributes gateway_ip, dns_nameservers,
cidr and host_routes to group_vars.

Change-Id: I1dc3a1b2b833b577d8de078326de899d2f44582e
This commit is contained in:
Harald Jensås 2020-09-22 13:12:33 +02:00
parent 7e9a07212b
commit 7b8c6b07da
1 changed files with 10 additions and 0 deletions

View File

@ -275,6 +275,12 @@ parameters:
type: json
description: Optional extra Ansible group vars
default: {}
{{role.name}}ControlPlaneSubnet:
default: ctlplane-subnet
description: |
Name of the subnet on ctlplane network for this role.
type: string
{% endfor %}
# Identifiers to trigger tasks on nodes
@ -920,6 +926,10 @@ resources:
properties:
value:
ctlplane_mtu: {get_attr: [Networks, net_attributes_map, ctlplane, network, mtu]}
ctlplane_gateway_ip: {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_param: {{role.name}}ControlPlaneSubnet}, gateway_ip]}
ctlplane_dns_nameservers: {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_param: {{role.name}}ControlPlaneSubnet}, dns_nameservers]}
ctlplane_subnet_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_param: {{role.name}}ControlPlaneSubnet}, cidr]}, 1]}
ctlplane_host_routes: {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_param: {{role.name}}ControlPlaneSubnet}, host_routes]}
{%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}_mtu: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, network, mtu]}
{%- if role.networks is mapping %}