User creation with Cloud-init

asked 2013-12-16 10:05:37 -0600

Albert Vico gravatar image

I have the following cloud-init script that I'm loading with my vm:

# Add groups to the system
# The following example adds the ubuntu group with members foo and bar and
# the group cloud-users.
  - ugroup

# Add users to the system. Users are added after groups are added.
  - default
  - name: user
    gecos: Testbed as a Service
    primary-group: ugroup
    groups: admin
    passwd: $6$rounds=4096$4pFvtqM5ldfLzR0hE9r7XSOoCO22lN7OB49IopWQ7SQrB5GBTR8X8okMpxXXQZ0jqUOuy4wKY.iYzwQTo7vH6zKx0DqjTFe6jh1

  - [passwd, user, '-u']

But it seams that I'm doing soemthing wrong

Since I get the following error:

    passwd: user 'taas' does not exist
    run-parts: /var/lib/cloud/instance/scripts/runcmd exited with return code 1
    2013-12-16 15:15:09,028 -[WARNING]: failed to run-parts in /var/lib/cloud/instance/scripts
    2013-12-16 15:15:09,087 -[WARNING]: Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/", line 108, in run_cc_modules
        cc.handle(name, run_args, freq=freq)
      File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/", line 72, in handle
        [ name, self.cfg,, cloudinit.log, args ])
      File "/usr/lib/python2.7/dist-packages/cloudinit/", line 309, in sem_and_run
      File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/", line 27, in handle
      File "/usr/lib/python2.7/dist-packages/cloudinit/", line 140, in runparts
        raise subprocess.CalledProcessError(sp.returncode,cmd)
    CalledProcessError: Command '['run-parts', '--regex', '.*', '/var/lib/cloud/instance/scripts']' returned non-zero exit status 1
2013-12-16 15:15:09,100 -[ERROR]: config handling of scripts-user, None, [] failed

Any tips or solutions to my problem?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-12-16 10:14:52 -0600

Albert Vico gravatar image

Ok I found how to add a password to the default user of the ubuntu cloud images, which some how it solves my problem, but still it does not solve the problem listed before

In order to add a password to default user use the following cloud-init script:

password: mysecret
chpasswd: { expire: False }
ssh_pwauth: True
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-12-16 10:05:37 -0600

Seen: 1,862 times

Last updated: Dec 16 '13