New Question

password in user-data vs password plugin

asked 2019-04-08 17:23:37 +0300

benray gravatar image

updated 2019-06-03 11:15:59 +0300

avladu gravatar image

Hi Cloudbase team,

Wonder if you can help us figure out how to give users the option set a password via user-data. Currently CBI is setting a random password and posting encrypted to OpenStack metadata which is all well and good. However some users would like to set a password through user-data and it always seems to end up the random password instead. Possibly this is because SetUserPasswordPlugin is running after UserDataPlugin? For example, passing a script like this:

net user Administrator mySecurePassword
net user anotheradmin mySecurePassword
create a file somewhere

ends up with Administrator having a random (but retrievable) password, another admin having mySecurePassword (great) and some file created so we know the script is running OK.

We thought the random password would be overridden by user data but are not seeing that behavior. Any tips to give users a choice?

thanks you for any help! Ben

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2019-06-03 11:20:48 +0300

avladu gravatar image


By default, the userpassword plugin is run after userdata plugin:

To fix this, you need to manually define the plugins in the cloudbase-init configuration, and put cloudbaseinit.plugins.common.userdata.UserDataPlugin after cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin.

edit flag offensive delete link more


Thank you! This is exactly what I ended up doing and it works great. Appreciate the confirmation.

benray gravatar imagebenray ( 2019-06-04 18:22:59 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-04-08 17:23:37 +0300

Seen: 34 times

Last updated: Jun 03