canonical / canonical/cloud-init
[enhancement]: Provide a mechanism that allows bootcmd and runcmd to be preserved when issued in cloud.cfg
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
# Enhancement
I have been working on an idea that will allow both runcmd and bootcmd to not be overwritten when issued through cloud.cfg. The problem is described in more detail in #2611. I am presenting this idea and the associated rough patches as a proof of concept to start the discussion about this or any other solution. Basically I am introducing a new setting for cloud.cfg called persistent_cmds which indicates the bootcmd and runcmd to be executed and cannot be overwritten by subsequent user data. These commands are stripped off and saved to be applied after the user data has been merged.
Example cloud.cfg:
```
persistent_cmds:
bootcmd:
- touch /root/file0
- touch /root/file1
```
@TheRealFalcon
Thanks,
Cathy
Contributor guide
Assessment
This issue has not been assessed yet.