cgwalters / min-cloud-agent

Minimal client implementation of AWS/OpenStack metadata API
Other
10 stars 3 forks source link

RFE: run userdata as shell script #2

Open mattdm opened 10 years ago

mattdm commented 10 years ago

cloud-init can do many fancy things, but most of them could be emulated by just running a shell script.

I do not propose that you implement the entire cloud-config syntax — or, in fact, any of it. However, if the userdata begins with #!, execute it.

See http://cloudinit.readthedocs.org/en/latest/topics/format.html#user-data-script

Note that this may require an update to selinux policy so that the script runs unconfined.

cgwalters commented 10 years ago

Yep, I just commented to this effect on the last one =)

I can take care of doing the SELinux dance internally to run the scripts as unconfined_t, it's just a call to setexeccon().

(Ironically, the cloud-init support for SELinux is what pulls in the python SELinux bindings which pull in a lot of stuff...all just for what can be done directly in C)

cgwalters commented 10 years ago

A patch for this now in https://github.com/cgwalters/min-metadata-service/commit/9d307b95c061f648b1985bd94230496d50f0d9bb

I'm going to do some more testing and push, but review is appreciated!