/srv/irclogs.ubuntu.com/2021/07/22/#cloud-init.txt

meenasheesh08:01
=== FergusL2 is now known as FergusL
Nothing4Youhi, is it possible to provide run-once scripts in userdata?13:31
rbasakNothing4You: https://cloudinit.readthedocs.io/en/latest/topics/examples.html#run-commands-on-first-boot13:33
rbasakThat's an example of cloud-init-per13:34
rbasakBut you probably want to use it against runcmd instead (the following example)13:34
Nothing4Yourbasak: i was intending to run stuff in the final stage which this would be part of https://cloudinit.readthedocs.io/en/latest/topics/modules.html#scripts-per-once13:35
Nothing4Youi guess a workaround could be to create the script in bootcmd/runcmd and write it to a file that will be loaded in the final stage13:36
rbasakNothing4You: is that not the equivalent of https://cloudinit.readthedocs.io/en/latest/topics/modules.html#runcmd anyway?13:38
rbasakIn terms of stage.13:38
Nothing4Youruncmd runs in the config stage13:39
falcojrNothing4You: runcmd runs during config stage, but all it does there is write the script to /var/lib/cloud/instances/scripts14:11
falcojrthe script gets executed via the scripts-user module in the final phase14:12
Nothing4Youah, thanks14:12
Nothing4Youif i specify package_reboot_if_required=true, does that reboot happen as part of the package-update-upgrade-install module before processing the other final stage modules?14:13
=== arif-ali- is now known as arif-ali
smoseryes20:25
smoserNothing4You: ^. it happens when installing packages and then reboots before going further.20:25
smoserand then picks up again.20:25
smoserbut that only works on debian/ubuntu20:26
Nothing4Youthanks20:26
Nothing4Youdebian in my case, so that's fine20:26
smoserit relies on /var/run/reboot-required or some such being written. so ... i spoke without verifying that.20:32
smoserbut it does work on ubuntu20:32
Nothing4Youit's definitely rebooting my debian 10 machines20:34

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!