cloud-config should support some method for passing scripts
This bug report was converted into a question: question #104907: cloud-config should support some method for passing scripts.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Invalid
|
Low
|
Scott Moser |
Bug Description
Binary package hint: cloud-init
Gustavo asked if there was a way to put scripts to run into cloud-config. At the current point there is no easy way to get the same functionality entirely within cloud-config of user-data like:
#!/bin/sh
echo hello world
There are 2 ways to accomplish this, but possibly less than ideal:
a.) use multi-part mime, one section for cloud-config, one for #!/bin/sh
b.) use runcmd with 'sh -c':
runcmd:
- [ sh, -c, echo "=========hello world'=========" ]
-
- sh
- -c
- |
#!/bin/sh
echo hi
tags: | added: patch |
Hm...
I think I've found a suitable solution with the same function as the attached patch, but utilizing only 'runcmd'. See the attachment.