<HEAT OPENSTACK > RESOURCE GROUP API

Refresh

1 weeks ago

Views

2 time

-1

I want to create networkA1,networkA2,networkA3,networkA4 ,then network B1,networkB2,networkB3,networkB4 and so on till networkG1,networkG2,netowrkG3,netowrkG4 .

I used resource group api .But unable to change the variables A,B,C,D .How should i use this api to pass variables A,B,C,D, and also numbers which i want for variuos resource in the set1.yaml when it loops .

Example:

set1.yaml heat_template_version: 2013-05-23 description: This is the template for I&V R6.1 base configuration to create neutron resources other than sg and vm for vyos vms resources: neutron_SecurityGroup_SGdefault: type: OS::Neutron::SecurityGroup properties: name: SG-default2 rules: [{"direction":ingress,"ethertype":IPv4},{"direction":ingress,"ethertype":IPv6}] neutron_Network_1: type: OS::Neutron::Net properties: name: Network1 neutron_Network_2: type: OS::Neutron::Net properties: name: Network2 neutron_Network_3: type: OS::Neutron::Net properties: name: Network3 neutron_Network_4: type: OS::Neutron::Net properties: name: Network4 neutron_Subnet_1: type: OS::Neutron::Subnet properties: enable_dhcp: true name: Subnet1 network_id: get_resource: neutron_Network_1 cidr: 192.1.1.0/24 neutron_Subnet_2: type: OS::Neutron::Subnet properties: enable_dhcp: true name: Subnet2 network_id: get_resource: neutron_Network_2 cidr: 192.2.1.0/24 neutron_Subnet_3: type: OS::Neutron::Subnet properties: enable_dhcp: true name: Subnet3 network_id: get_resource: neutron_Network_3 cidr: 192.3.1.0/24 neutron_Subnet_4: type: OS::Neutron::Subnet properties: enable_dhcp: true name: Subnet4 network_id: get_resource: neutron_Network_4 cidr: 192.4.1.0/24 neutron_Port_p1: type: OS::Neutron::Port properties: network: { get_resource: neutron_Network_1 } name: p1 fixed_ips: [{"ip_address": 192.1.1.3}] security_groups: [{get_resource: neutron_SecurityGroup_SGdefault}] allowed_address_pairs: [{"ip_address":1.6.0.0/16},{"ip_address":1.7.0.0/16},{"ip_address":224.0.0.5,"mac_address":'01:00:5E:00:00:05' },{"ip_address":12.12.12.0/24}] neutron_Port_p2: type: OS::Neutron::Port properties: network: { get_resource: neutron_Network_2 } name: p2 fixed_ips: [{"ip_address": 192.2.1.3}] security_groups: [{get_resource: neutron_SecurityGroup_SGdefault}] allowed_address_pairs: [{"ip_address":1.6.0.0/16},{"ip_address":1.7.0.0/16},{"ip_address":224.0.0.5,"mac_address":'01:00:5E:00:00:05' },{"ip_address":12.12.12.0/24}] neutron_Port_p3: type: OS::Neutron::Port properties: network: { get_resource: neutron_Network_3 } name: p3 fixed_ips: [{"ip_address": 192.3.1.3}] security_groups: [ {get_resource: neutron_SecurityGroup_SGdefault}] allowed_address_pairs: [{"ip_address":1.6.0.0/16},{"ip_address":1.7.0.0/16},{"ip_address":224.0.0.5,"mac_address":'01:00:5E:00:00:05' },{"ip_address":12.12.12.0/24}] neutron_Port_p4: type: OS::Neutron::Port properties: network: { get_resource: neutron_Network_4 } name: p4 fixed_ips: [{"ip_address": 192.4.1.3}] security_groups: [{get_resource: neutron_SecurityGroup_SGdefault}] allowed_address_pairs: [{"ip_address":1.6.0.0/16},{"ip_address":1.7.0.0/16},{"ip_address":224.0.0.5,"mac_address":'01:00:5E:00:00:05' },{"ip_address":12.12.12.0/24}]

setrepeat.yaml

heat_template_version: 2013-05-23

resources: rg: type: OS::Heat::ResourceGroup properties: count: 2 resource_def: {type: set1.yaml}

0 answers