Ask Your Question
0

heat attain IP of previous host

asked 2014-11-30 02:36:25 -0500

Simply_Seth gravatar image

I have a heat template that creates two hosts:

One CoreOS "service" instance and one CoreOS "worker" instance.

I wish to grab the ip of the first created instance and use it for the config of following "worker" instances.

This might give a hint of what I'm trying to do:

etcd_servers: http://{ get_attr: [ coreos001, first_address ] }:4001

Where coreos001 is the "master" instance that gets created first.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-30 17:35:07 -0500

miguelgrinberg gravatar image

You can use the str_replace function to do what you want:

etcd_servers:
    str_replace:
        params:
            __coreos001_ip__: { getattr: [coreos001, first_address] }
        template: http://__coreos001_ip__:4001
edit flag offensive delete link more

Comments

That config doesn't show up in /run/systemd/system/etcd.service.d/10-oem.conf on the instances

Simply_Seth gravatar imageSimply_Seth ( 2014-12-01 01:13:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-30 02:36:25 -0500

Seen: 242 times

Last updated: Nov 30 '14