Here are the files which you can use to provision the amazon instances with cloud init service using chef-solo.
They install chef client and necessary files to get Mysql server at the end.
There are two ways to use them:
-
- Start using yaml
aws ec2 run-instances --image-id ami-8e987ef9 --key-name key_name --instance-type t1.micro --user-data file://chef-solo.yaml
- Start using yaml
-
- or using plain bash script (uncomment the apt-get lines in chef-solo_log.sh)
aws ec2 run-instances --image-id ami-8e987ef9 --key-name key_name --instance-type t1.micro --user-data file://chef-solo_log.sh
- or using plain bash script (uncomment the apt-get lines in chef-solo_log.sh)
Connect via ssh and enjoy looking at the log file /tmp/init.log
Files:
- chef-solo_log.sh - bash script with one way of logging (exec and tee )
- chef-solo_log2.sh - bash script with another way of logging ("&>> log_file" - after every command)