Calling all cloud-init and EC2 gurus...
I can't figure this out. I'm using a cloud-init script to bootstrap an EC2 aws-ami instance (through AWS CloudFormation) and when I include the write_files
property it changes the command prompt on the instance to -bash-4.2$
. If I don't include write_files, I get the regular EC2 shell.
Here is my script so far:
#cloud-config
repo_update: true
repo_upgrade: all
packages:
- gcc
- git
- ruby24
- ruby24-devel
runcmd:
- update-alternatives --set ruby /usr/bin/ruby2.4
write_files:
- path: /home/ec2-user/some-file.yml
owner: root:root
permissions: '0644'
content: |
<<--SOME-CONTENT-->
final_message: 'The Build Server is ready!'
Anybody know why this is happening or what I might be doing wrong that's making cloud-init change the shell? Or maybe it's a bug/known-issue with cloud-init? This is driving me nuts.
I've already checked the logs /var/log/cloud-init.log
and /var/log/cloud-init-output.log
and there are no errors or anything to suggest anything went wrong.