Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

get_attr to retrieve IP address allocated to an instance

I have been trying to deploy an application in 2 different subnets using heat template. I successfully deployed web server instance and database server instance. In the heat template I use the following function to get the IP address of the database server instance - to configure the DB server in web server instance.

    userdata:
      str_replace:
        template: |
          ...
          ...
        params:
          db_ipaddr: {get_attr: [database_server, network, private, 0]} 
    depends_on: database_server

The IP address of the database server is not set in the web server's configuration file. It is empty.

How do I solve this issue?

get_attr to retrieve IP address allocated to an instance

I have been trying to deploy an application in 2 different subnets using heat template. I successfully deployed web server instance and database server instance. In the heat template I use the following function to get the IP address of the database server instance - to configure the DB server in web server instance.

    userdata:
      str_replace:
        template: |
          ...
          ...
        params:
          db_ipaddr: {get_attr: [database_server, network, networks, private, 0]} 
    depends_on: database_server

The IP address of the database server is not set in the web server's configuration file. It is empty.

How do I solve this issue?