When using write_files
with cloud-init, is it possible to append content? If so, how?
write_files: [
{
"path": "/home/user/some-file",
"content": "\nLine to append!"
}
]
Cloud-init config is provided in two places: /etc/cloud/cloud. cfg. /etc/cloud/cloud.
Short description. By default, user data scripts and cloud-init directives run only during the first boot cycle when an EC2 instance is launched. However, you can configure your user data script and cloud-init directives with a mime multi-part file.
Cloud-init is a package that contains utilities for early initialization of cloud instances. It is needed in Arch Linux images that are built with the intention of being launched in cloud environments like OpenStack, AWS etc.
per https://cloudinit.readthedocs.io/en/latest/topics/modules.html#write-files
write_files:
- path: /home/user/some-file
content: |
Line to append!
append: true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With