Closed bunchjesse closed 7 years ago
Not sure why there is some confusion. Manually running the script is a big pain, as makes automation extremely difficult (whether by invoking directly through automation tools or via baked images). I second the motion for unattended installation.
same request to install unattended. Also, getting error when running ./setup.py
Traceback (most recent call last):
File "
Might help someone:
(echo "1"; echo "1"; echo "1"; echo "3"; cat) | sudo ./setup.py
+1 command line options or external config file supplied in cmd might help a lot. especially for nodes deployed via auto scaling groups, and if not asg then hosts provisioned by either configuration management system
+1 for unattended support please.
Hey guys,
For those of you wanting to automate this on AWS, here is a sample bootstrap script I have built for my Amazon Linux instance launches and it is working great:
------- Once Off Preparations -------
1.) Rather not fetch the file from Github via your script, instead copy the setup.py raw text into a new text document called setup.py, and upload this to an AWS S3 bucket; Then set this file to be PUBLIC and fetch from there going forward inside your automation scripts. This gives you more ability to control versions of your setup.py file as well as avoiding the "Traceback" error bunchjesse and JadyLiu experienced when downloading and executing straight from Github.
2.) Once the file is in your personal bucket, for example the path to this file may be https://s3-eu-west-1.amazonaws.com/my-bucket-name/setup.py , edit the bash script line 5 and replace the URL there next to wget.
3.) Add the below script to your AWS Autoscaling Launch Configurations, Advanced options (user data).
Notes: Region will be automatically detected, host-name will be set to the instance ID, and IAM Role will be automatically used. For demonstration purposes, only the memory--memory-used OS metric will be pushed to CloudWatch.
------- Bash Script Example -------
yum update -y yum install collectd -y cd /tmp wget https://s3-eu-west-1.amazonaws.com/my-bucket-name/setup.py sudo chmod a+x setup.py (echo "1"; echo "1"; echo "1"; echo "2"; cat) | python setup.py echo "memory--memory-used" > /tmp/whitelist.conf cp -vrf /tmp/whitelist.conf /opt/collectd-plugins/cloudwatch/config/whitelist.conf chown root:root /opt/collectd-plugins/cloudwatch/config/whitelist.conf chmod 644 /opt/collectd-plugins/cloudwatch/config/whitelist.conf service collectd restart
Use at your own risk
I want to add this to my user data script that is run when an EC2 instance boots but I'm not seeing a way to do an unattended install. It is asking me to choose an AWS region: