/srv/irclogs.ubuntu.com/2021/12/20/#cloud-init.txt

eggbeanWhen I add this it results in not being able to connect to the instance. The disk is attached under bootcmd aws mount-disk, so it should be happening before the mount:12:30
eggbeanmounts:12:30
eggbean  - [ sdf, /home, "ext4", "rw,defaults", "0", "2" ]12:31
eggbeanTerraform also fails to apply tags to the instance because of this for some reason. 12:31
eggbeanWhat's wrong with my mounts: line?12:32
eggbeanIf I comment it out everything works fine12:32
eggbeanIt worked when I used the partitiion UUID, which is not ideal in this situation.16:08
bpatelHow do I run the following script with cloud-init. #!/bin/bash                                                                      17:55
bpateltime_to_wait=1017:55
bpatelcounter=017:55
bpatelwhile [ ! -f /tmp/foo.txt ]17:55
bpateldo17:55
bpatel    sleep 117:55
bpatel    ((counter+=1))17:56
bpatel    if [ $counter -gt $time_to_wait ]17:56
bpatel    then17:56
bpatel        echo "not found"17:56
bpatel        exit17:56
bpatel    fi17:56
bpateldone17:56
bpatelI would like to run this inline17:56
bpatelI have tried using runcmd but have had no success17:56
minimalbpatel: what happened with runcmd? did it not run? did the cloud-init.log show an error?18:02
bpatelI have tried using the following code runcmd:18:03
bpatel  - [ #!/bin/bash ]18:03
bpatel  - [ time_to_wait=10 ]18:03
bpatel  - [ counter=0 ]18:03
bpatel  - [ 'while [ ! -f /tmp/foo.txt ]' ]18:03
bpatel  - [ do ]18:03
bpatel  - [ sleep 1 ]18:03
bpatel  - [ ((counter+=1)) ]18:03
bpatel  - [ 'if [ $counter -gt $time_to_wait ]' ]18:03
bpatel  - [ then ]18:03
bpatel  - [ echo "not found" ]18:03
bpatel  - [ exit ]18:03
bpatel  - [ fi ]18:03
bpatel  - [ done ] and when I run 18:03
bpatelthe syntax checker it throws an error18:04
bpatelcloud-init devel schema --config-file templates/test_sh.tmpl18:04
bpatelCloud config schema errors: format-l10.c3: File templates/test_sh.tmpl is not valid yaml. while parsing a flow node18:04
bpatelexpected the node content, but found '-'18:04
bpatel  in "<byte string>", line 10, column 3:18:04
bpatel      - [ time_to_wait=10 ]18:04
bpatel      ^18:04
minimalbpatel: runcmd is for running *commands*, if you want to run a script then first create the script using write_files and then run it using runcmd.18:07
bpatelok,so create a script with the above content and run that with18:09
bpatelruncmd18:09
bpatelwill give it a go.18:09
bpatelThanks minimal18:13

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