[Openstack-operators] [openstack-operators] [nova] cloud.cfg not applied

Edmund Rhudy (BLOOMBERG/ 120 PARK) erhudy at bloomberg.net
Wed Apr 12 18:36:08 UTC 2017


Are you starting the file with "#cloud-config"? AFAIK, cloud-init uses the first line to decide how to process the file (e.g. if it starts with a shell shebang it will treat it as a shell script, #cloud-config will cause it to process it as cloud-init YAML, and so forth). I am not sure if it will try to process the file using a default mechanism if none is specified, but you could try specifying it explicitly to see if that causes cloud-init to process the user data.

From: ckonstanski at pippiandcarlos.com 
Subject: Re: [Openstack-operators] [openstack-operators] [nova] cloud.cfg not applied

It does look funny at first. But that's actually two separate
users. This cloud.cfg has been verified in an enterprise cloud. Apart
from the passwd stuff (which I will remove) I am certain it should
work. It specifies that the default user should be created as normal,
and it adds a second ckonstanski user with sudo, ssh-key, etc.

m foster <mfosterm at gmail.com> writes:

> The only thing I can think of is that the default user should just be
> "default", not qualified with "name". Perhaps that is clobbering your next
> entry or just creating a syntax error.
>
> On Wed, Apr 12, 2017 at 11:34 AM, Carlos Konstanski <
> ckonstanski at pippiandcarlos.com> wrote:
>
>> I cannot get a simple cloud.cfg to be applied to a newly created
>> instance. This is the cloud.cfg: (sensitive info removed)
>>
>> users:
>>   - name: default
>>   - name: ckonstanski
>>     groups: sudo
>>     shell: /bin/bash
>>     sudo: ['ALL=(ALL) NOPASSWD:ALL']
>>     passwd: <my password hash taken from /etc/shadow>
>>     lock_passwd: False
>>     ssh-authorized-keys:
>>       - ssh-rsa <my ssh pubkey taken from ~/.ssh/id_rsa.pub>
>>
>>
>> I'm not usually in the habit of setting passwords, but I had hoped that
>> perhaps it only the SSH pubkey part that wasn't working. Turns out none
>> of it works, the user isn't created at all.
>>
>> I tried with a variety of OS images: gentoo, ubuntu 14.04, ubuntu 16.04,
>> centos 7. I downloaded official cloud images for all of these.
>>
>> If I shell onto the instances and run:
>>
>> curl http://169.254.169.254/2009-04-04/user-data
>>
>> the cloud.cfg is returned.
>>
>> I built this openstack according to the official newton install guide.
>>
>> Looking for ways to troubleshoot this. What is the mechanism that gets
>> the cloud.cfg applied? Any info would be helpful, even a link.
>>
>> Sincerely,
>>
>> Carlos Konstanski
>>
>> _______________________________________________
>> OpenStack-operators mailing list
>> OpenStack-operators at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-operators/attachments/20170412/94fe6f99/attachment.html>


More information about the OpenStack-operators mailing list