Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

In the nested network template you need to return the net and the subnet ID.

The outputs of the nested_network template:

outputs:
  private_network_id:
    value: {get_resource: private_network}
  private_subnet_id:
    value: {get_resource: private_subnet}

In the parent template you need to pass those on to the nested server template (writing only the relevant parts here)

  type: nested_server.yaml                                              
    properties:                                                           
      private_network: {get_attr: [network, private_network_id]}          
      private_subnet: {get_attr: [network, private_subnet_id]}

And inside nested_server.yaml you need to declare those as parameters:

parameters:
  private_network:
    type: string
  private_subnet:
    type: string

To be used here:

resources:
  server_port:
    type: OS::Neutron::Port
    properties:
      network_id: { get_param: private_network }
      fixed_ips:
        - subnet_id: { get_param: private_subnet }

You would also need to make sure that the network part is created before the server part otherwise the attributes that you are trying to use are empty. To do this you can add in the parent template that the nested server depends_on the nested network.