Change the hostname at runtime


#1

Ohai Chefs!

Since I’ve added the recipe of cookbook unattended-upgrades that emails me about those events.
FYI, I’m using AWS EC2.
But when the email comes, its subject has:

[reboot required] unattended-upgrades result for ‘ip-10-121-17-242’

Here, that private ip is set as hostname and this doesn’t gives me the info which server/instance is that.

So, I want to setup the my custom hostname before all execution of the bootstrap process starts so that the chef run for the first time will change the hostname of the instance.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


#2

Hi Chefs!
Is there any pointer that you can direct me to on this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, November 16, 2012 at 2:41 PM, Sachin Sagar Rai wrote:

Ohai Chefs!

Since I’ve added the recipe of cookbook unattended-upgrades that emails me about those events.
FYI, I’m using AWS EC2.
But when the email comes, its subject has:

[reboot required] unattended-upgrades result for ‘ip-10-121-17-242’

Here, that private ip is set as hostname and this doesn’t gives me the info which server/instance is that.

So, I want to setup the my custom hostname before all execution of the bootstrap process starts so that the chef run for the first time will change the hostname of the instance.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


#3

On Thursday, November 22, 2012 at 3:04 AM, Sachin Sagar Rai wrote:

Hi Chefs!
Is there any pointer that you can direct me to on this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, November 16, 2012 at 2:41 PM, Sachin Sagar Rai wrote:

Ohai Chefs!

Since I’ve added the recipe of cookbook unattended-upgrades that emails me about those events.
FYI, I’m using AWS EC2.
But when the email comes, its subject has:

[reboot required] unattended-upgrades result for ‘ip-10-121-17-242’

Here, that private ip is set as hostname and this doesn’t gives me the info which server/instance is that.

So, I want to setup the my custom hostname before all execution of the bootstrap process starts so that the chef run for the first time will change the hostname of the instance.

Do you want the bootstrap script to change the hostname, or do you want chef to do it?


Daniel DeLeo


#4

I’d opt for the chef to handle it without breaking the SSH connection.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Saturday, November 24, 2012 at 6:35 AM, Daniel DeLeo wrote:

On Thursday, November 22, 2012 at 3:04 AM, Sachin Sagar Rai wrote:

Hi Chefs!
Is there any pointer that you can direct me to on this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, November 16, 2012 at 2:41 PM, Sachin Sagar Rai wrote:

Ohai Chefs!

Since I’ve added the recipe of cookbook unattended-upgrades that emails me about those events.
FYI, I’m using AWS EC2.
But when the email comes, its subject has:

[reboot required] unattended-upgrades result for ‘ip-10-121-17-242’

Here, that private ip is set as hostname and this doesn’t gives me the info which server/instance is that.

So, I want to setup the my custom hostname before all execution of the bootstrap process starts so that the chef run for the first time will change the hostname of the instance.

Do you want the bootstrap script to change the hostname, or do you want chef to do it?


Daniel DeLeo


#5

try something like this

-s

On Sat, Nov 24, 2012 at 6:36 AM, Sachin Sagar Rai millisami@gmail.com wrote:

I’d opt for the chef to handle it without breaking the SSH connection.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
Sent with Sparrow

On Saturday, November 24, 2012 at 6:35 AM, Daniel DeLeo wrote:

On Thursday, November 22, 2012 at 3:04 AM, Sachin Sagar Rai wrote:

Hi Chefs!
Is there any pointer that you can direct me to on this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
Sent with Sparrow

On Friday, November 16, 2012 at 2:41 PM, Sachin Sagar Rai wrote:

Ohai Chefs!

Since I’ve added the recipe of cookbook unattended-upgrades that emails me
about those events.
FYI, I’m using AWS EC2.
But when the email comes, its subject has:

[reboot required] unattended-upgrades result for ‘ip-10-121-17-242’

Here, that private ip is set as hostname and this doesn’t gives me the info
which server/instance is that.

So, I want to setup the my custom hostname before all execution of the
bootstrap process starts so that the chef run for the first time will change
the hostname of the instance.

Do you want the bootstrap script to change the hostname, or do you want chef
to do it?


Daniel DeLeo


#6

try something like this
https://gist.github.com/673693
+1 to this - I’ve used it a bunch before, it did what I wanted.

On Mon, Nov 26, 2012 at 4:17 PM, Sean OMeara someara@gmail.com wrote:

try something like this
https://gist.github.com/673693

-s

On Sat, Nov 24, 2012 at 6:36 AM, Sachin Sagar Rai millisami@gmail.com wrote:

I’d opt for the chef to handle it without breaking the SSH connection.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
Sent with Sparrow

On Saturday, November 24, 2012 at 6:35 AM, Daniel DeLeo wrote:

On Thursday, November 22, 2012 at 3:04 AM, Sachin Sagar Rai wrote:

Hi Chefs!
Is there any pointer that you can direct me to on this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
Sent with Sparrow

On Friday, November 16, 2012 at 2:41 PM, Sachin Sagar Rai wrote:

Ohai Chefs!

Since I’ve added the recipe of cookbook unattended-upgrades that emails me
about those events.
FYI, I’m using AWS EC2.
But when the email comes, its subject has:

[reboot required] unattended-upgrades result for ‘ip-10-121-17-242’

Here, that private ip is set as hostname and this doesn’t gives me the info
which server/instance is that.

So, I want to setup the my custom hostname before all execution of the
bootstrap process starts so that the chef run for the first time will change
the hostname of the instance.

Do you want the bootstrap script to change the hostname, or do you want chef
to do it?


Daniel DeLeo