password in user-data vs password plugin

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:

1 answer

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.