New Question
0

Newlines in UserData?

asked 2016-07-22 01:01:07 +0200

puck gravatar image

Hey,

We have an inconsistency with a UserData script from a customer. It works against the evaluation Windows image provided by cloudbase.it, but not against the Windows images we've created - both are Windows Server 2012 R2.

Our image has Cloudbase-init v0.9.9 and Python 3.4.3.

Now, I have been able to get the UserData script to run, but I had to change the newlines in it. So, the script that ran again the cloudbase.it image had Unix newlines (\n), but against our image we needed Windows newlines (\r\n).

Is there something we're missing in our image to do the conversion, or to allow this to run?

Cheers, Andrew

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2016-08-18 02:52:09 +0200

puck gravatar image

Sure:

#ps1_sysnative

# The Telnet server needs to be enabled
install-windowsfeature "telnet-server"
install-windowsfeature "telnet-client"
install-windowsfeature -name AD-Domain-Services -IncludeManagementTools

cmd /C netsh advfirewall set allprofiles state off
cmd /C tlntadmn config maxconn=1024

cmd /C net localgroup /add telnetclients "authenticated users"
cmd /C sc config tlntsvr start=auto
cmd /C sc start tlntsvr

We're saving that to a file called "userdata.txt" then giving it to Nova as: nova boot ... --user-data userdata.txt

If we just save that into a file on our Linux boxes, it fails. If I run todos userdata.txt before doing the boot, then it works.

Cheers, Andrew

edit flag offensive delete link more
0

answered 2016-07-25 13:32:11 +0200

avladu gravatar image

Hello,

Can you provide us with a userdata script that fails in your case?

Thank you,

Adrian Vladu.

edit flag offensive delete link more

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-07-22 01:01:07 +0200

Seen: 321 times

Last updated: Aug 18 '16