How to deal with different usernames before and after Chef run

20 views
Skip to first unread message

Marten Veldthuis

unread,
Mar 29, 2013, 6:28:07 PM3/29/13
to littl...@googlegroups.com
Hi all,

I'm trying to switch from Chef Server to littlechef, but I'm wondering about one thing. When we provision a new VM, it gets initialized with the root user accessible, and no other user accounts are made yet. The rest of the accounts are set up by Chef, which also configures SSH so that root login is no longer permitted.

So basically the first run requires logging in as root, and subsequent runs prohibit logging in as root... Hopefully you can see the dilemma. Is there any way to overrule the config.cfg file and tell littlechef to use a certain username for a given run?

Cheers,

Marten

Miquel Torres

unread,
Mar 31, 2013, 2:53:27 AM3/31/13
to littl...@googlegroups.com
Hi Marten,

there is no way to use different users other than changing it manually.

What we do is adding the first user while initializing the VM, so there is never a chef run triggered as root.

If that can not be done cleanly, an alternative would me to mimic the way VM bootstrapping works. After a VM is provisioned, a chef-solo run is started. How? The provisioning script could use hardcoded root credentials and LittleChef from the VM itself, or even clone the kitchen, then call chef-solo.

Incidentally, if you are using LittleChef as a library while provisioning (as we do), there is no problem in switching users on the fly.

If you want more details, you could first explain a bit more about the way you provision the VMs.

Cheers,
Miquel
--
You received this message because you are subscribed to the Google Groups "littlechef" group.
To unsubscribe from this group and stop receiving emails from it, send an email to littlechef+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages