New Question
0

Any alternatives to multipart/mixed?

asked 2016-02-08 18:02:56 +0200

aburluka gravatar image

Can you please clarify me current status of multipart/mixed support in cloudbase-init? There is no implementation of it in sources. What is an current alternative to it if I would like to change user settings and execute scripts at the same time? Thank you and looking forward to your help.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2016-02-13 14:44:55 +0200

alexpilotti gravatar image

updated 2016-02-14 14:39:22 +0200

Hi, cloudbase-init has multi-part MIME support, mostly for Heat templates support.

Do you have a particular example scenario that you'd like to run?

edit:

the admin user and main keypair are passed through metadata (just pass a keypair to nova boot).

The rest can be possibly best accomplished by using a PowerShell script as userdata, for example:

#ps1
net user foo secretpassword1 /add
net user bar secretpassowrd2 /add  

Invoke-WebRequest http://foo.com/bar.txt -UseBasicParsing -OutFile c:\local\path\bar.txt
edit flag offensive delete link more

Comments

Hello! Thanks for help, my wish scenario currently consists of: 1) setting users, passwords, ssh-keys 2) Execution of few commands 3) Writing some files (if it can be executed after that it would be wonderful)

aburluka gravatar imageaburluka ( 2016-02-13 14:50:02 +0200 )edit

Edit: added content in the main answer to preserve formatting

alexpilotti gravatar imagealexpilotti ( 2016-02-13 15:00:02 +0200 )edit

Thank you! Your solution is very elegant and fits me except few little obscurity. I would like to store passwords encrypted (cloud-init provides such functionality). And what about write_files analogue?

aburluka gravatar imageaburluka ( 2016-02-13 15:09:25 +0200 )edit

On Linux you can provided the hashed passwords that the OS can transparently add to /etc/shadow, this is not possible on Windows. The suggested way of handling passwords on OpenStack is to use "nova get-password", letting the guest generate the password and encrypt it via the keypair's public key.

alexpilotti gravatar imagealexpilotti ( 2016-02-14 14:34:16 +0200 )edit

Adding also an example for obtaining files in powershell

alexpilotti gravatar imagealexpilotti ( 2016-02-14 14:34:44 +0200 )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

Stats

Asked: 2016-02-08 18:02:56 +0200

Seen: 3,447 times

Last updated: Feb 14 '16