diff options
author | Soren Hansen <soren@canonical.com> | 2009-08-10 22:12:01 +0200 |
---|---|---|
committer | Soren Hansen <soren@canonical.com> | 2009-08-10 22:12:01 +0200 |
commit | 1999a6e534fe7aa19e7fbe40b6f4c0b48612e47d (patch) | |
tree | 651655890e231ee981db677f322575beab976e9d /ec2-init | |
parent | e1af54175e94f4fee2ccaae3cda98d6ccbca1981 (diff) | |
download | vyos-cloud-init-1999a6e534fe7aa19e7fbe40b6f4c0b48612e47d.tar.gz vyos-cloud-init-1999a6e534fe7aa19e7fbe40b6f4c0b48612e47d.zip |
run_once_per_ami() and run_once_per_instance() are equivalent, so nuke run_once_per_instance().
There are three cases:
You want to run the script every time. In that case, simply do not wrap it.
You want to rerun the script every time the AMI has been rebundled. Wrap it in run_once_per_ami.
You want to run the script only once, ever. Wrap it in run_once_ever.
If I'm missing a case, please tell me.
Diffstat (limited to 'ec2-init')
-rwxr-xr-x | ec2-init | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -34,12 +34,6 @@ run_once() { return 1 } -run_once_per_instance() { - action_id=$1 - instance=`ec2-get-info --instance-id | cut -f2 -d\ ` - run_once $instance $action_id -} - run_once_per_ami() { action_id=$1 ami=`ec2-get-info --ami-id | cut -f2 -d\ ` @@ -116,7 +110,7 @@ case "$1" in log_end_msg 1 fi - if run_once_per_instance user-data + if run_once_per_ami user-data then log_daemon_msg "Running EC2 user data" if ec2-run-user-data 2>&1 | logger -t "user-data" |