I’m trying to access the floating ip assigned to an instance created with a 
heat template and write it to file during creation of the instance, my approach 
is not working and I’m wondering if anyone has any suggestions on how I could 
archive this.

    server:
        type: OS::Nova::Server
        properties:
            name: { get_param: server_name }
            image: { get_param: image }
            flavor: { get_param: flavor }
            key_name: { get_param: key_name }
            scheduler_hints:
                group: {get_param: server_group }
            admin_user: { get_param: admin_user }
            networks:
              - port: { get_resource: test_data_server_port }
            user_data_format: RAW
            user_data:
                str_replace:
                    template: |
                        #!/bin/bash -v
                        echo '127.0.0.1 $SERVER_NAME' >> /etc/hosts
                        echo $PROJECT_ID > /etc/project_id
                        echo $FLOATING_IP > /etc/floating_ip

                    params:
                        $SERVER_NAME: { get_param: server_name }
                        $PROJECT_ID: { get_param: 'OS::project_id' }
                        $FLOATING_IP: { get_param: 'OS::Nova::FloatingIP' }

    test_data_server_port:
        type: OS::Neutron::Port
        properties:
            network_id: { get_param: private_net_id }
            security_groups: [{ get_param: test_security_group }, default]
            replacement_policy: AUTO

    association:
        type: OS::Nova::FloatingIPAssociation
        properties:
            floating_ip: { get_resource: floating_ip }
            server_id: { get_resource: test_server }
_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : [email protected]
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to