Tracked in Github Issues as https://github.com/canonical/cloud- init/issues/2270
** Bug watch added: github.com/canonical/cloud-init/issues #2270 https://github.com/canonical/cloud-init/issues/2270 ** Changed in: cloud-init Status: Triaged => Expired -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to cloud-init. https://bugs.launchpad.net/bugs/1020695 Title: Add variable for local IP address to /etc/hosts manager Status in cloud-init: Expired Status in CentOS: New Bug description: Hi, > > I would like to set first line in the /etc/hosts file to be something like > this: > > local-ip FQDN Hostname > > The ip address should be the one returned from `ec2metadata --local-ipv4`. > After this line, I would like the usual 127.0.0.1 localhost line. I have > edited the template at /etc/cloud/templates/hosts.tmpl to have: > > ## The value '$hostname' will be replaced with the local-hostname > 10.2.46.37 $fqdn $hostname > 127.0.0.1 localhost I guess it would be good to have a variable available for substitution available. Could you open a bug on cloud-init for that? http://bugs.launchpad.net/cloud-init/+filebug > but I do not know how to get the local IP address as a variable to put into > the template. At the moment, it is hardcoded, which is not ideal. > > Does anyone know what variable I can use in the template file? The hack that I can think of is to add an upstart job or user-data hook that just does this for you. Anyone have better ideas? To manage notifications about this bug go to: https://bugs.launchpad.net/cloud-init/+bug/1020695/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

