[12:30] When 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] mounts: [12:31] - [ sdf, /home, "ext4", "rw,defaults", "0", "2" ] [12:31] Terraform also fails to apply tags to the instance because of this for some reason. [12:32] What's wrong with my mounts: line? [12:32] If I comment it out everything works fine [16:08] It worked when I used the partitiion UUID, which is not ideal in this situation. [17:55] How do I run the following script with cloud-init. #!/bin/bash [17:55] time_to_wait=10 [17:55] counter=0 [17:55] while [ ! -f /tmp/foo.txt ] [17:55] do [17:55] sleep 1 [17:56] ((counter+=1)) [17:56] if [ $counter -gt $time_to_wait ] [17:56] then [17:56] echo "not found" [17:56] exit [17:56] fi [17:56] done [17:56] I would like to run this inline [17:56] I have tried using runcmd but have had no success [18:02] bpatel: what happened with runcmd? did it not run? did the cloud-init.log show an error? [18:03] I have tried using the following code runcmd: [18:03] - [ #!/bin/bash ] [18:03] - [ time_to_wait=10 ] [18:03] - [ counter=0 ] [18:03] - [ 'while [ ! -f /tmp/foo.txt ]' ] [18:03] - [ do ] [18:03] - [ sleep 1 ] [18:03] - [ ((counter+=1)) ] [18:03] - [ 'if [ $counter -gt $time_to_wait ]' ] [18:03] - [ then ] [18:03] - [ echo "not found" ] [18:03] - [ exit ] [18:03] - [ fi ] [18:03] - [ done ] and when I run [18:04] the syntax checker it throws an error [18:04] cloud-init devel schema --config-file templates/test_sh.tmpl [18:04] Cloud config schema errors: format-l10.c3: File templates/test_sh.tmpl is not valid yaml. while parsing a flow node [18:04] expected the node content, but found '-' [18:04] in "", line 10, column 3: [18:04] - [ time_to_wait=10 ] [18:04] ^ [18:07] bpatel: 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:09] ok,so create a script with the above content and run that with [18:09] runcmd [18:09] will give it a go. [18:13] Thanks minimal