Skip to content

Commit

Permalink
REG-237-clean-cloud-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ottojolanki authored Jan 11, 2022
2 parents 903b770 + e3082dc commit 8d3ea37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 51 deletions.
51 changes: 1 addition & 50 deletions cloud-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,14 @@ ssh_authorized_keys:
- %(LOCAL_SSH_KEY)s
bootcmd:
- set -ex
- cloud-init-per once fallocate-swapfile fallocate -l 4G /swapfile
- cloud-init-per once chmod-swapfile chmod 600 /swapfile
- cloud-init-per once mkswap-swapfile mkswap /swapfile
- cloud-init-per once curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
package_upgrade: true
packages:
- apache2
- awscli
- libarchive-tools
- build-essential
- git
- graphviz
- libapache2-mod-wsgi-py3
- libcurl4-gnutls-dev
- libevent-dev
- libfreetype6-dev
- libjpeg-dev
- liblcms2-dev
- libmagic-dev
- libpq-dev
- libssl-dev
- libtiff5-dev
- libwebp-dev
- libxml2-dev
- libxslt1-dev
- lzop
- nodejs
- npm
- ntp
- pv
- python2.7-dev
- python3-dev
- python3-pip
- software-properties-common
- python3-virtualenv
- ruby-dev
- unattended-upgrades
- update-notifier-common
- zlib1g-dev
- libffi-dev
- bsd-mailx
- echo "Booting"
power_state:
mode: reboot
output:
all: '| tee -a /var/log/cloud-init-output.log'
runcmd:
- sudo -u ubuntu mv /home/ubuntu/.ssh/authorized_keys /home/ubuntu/.ssh/authorized_keys2
- sudo -u ubuntu aws s3 cp --region=us-west-2 %(S3_AUTH_KEYS)s /home/ubuntu/.ssh/authorized_keys
# Manually install java
- sudo -u ubuntu mkdir /home/ubuntu/.aws
- sudo -u ubuntu aws s3 cp --region=us-west-2 s3://regulome-conf-prod/.aws-regulome/credentials ~ubuntu/.aws
- sudo -u ubuntu rm -r /home/ubuntu/.aws
Expand Down Expand Up @@ -84,13 +43,6 @@ runcmd:
- a2disconf localized-error-pages
- a2disconf other-vhosts-access-log
- a2disconf serve-cgi-bin
- sudo sed -i -e 's/inet_interfaces = all/inet_interfaces = loopback-only/g' /etc/postfix/main.cf
- PUBLIC_DNS_NAME="$(curl http://169.254.169.254/latest/meta-data/public-hostname)"
- sudo sed -i "/myhostname/c\myhostname = $PUBLIC_DNS_NAME" /etc/postfix/main.cf
- sudo echo "127.0.0.0 $PUBLIC_DNS_NAME" | sudo tee --append /etc/hosts
- sudo mv /etc/mailname /etc/mailname.OLD
- sudo echo "$PUBLIC_DNS_NAME" | sudo tee --append /etc/mailname
- sudo service postfix restart
users:
- default
- name: build
Expand All @@ -112,7 +64,6 @@ write_files:
Unattended-Upgrade::Allowed-Origins {
"${distro_id} ${distro_codename}-security";
};
Unattended-Upgrade::Mail "[email protected]";
Unattended-Upgrade::Automatic-Reboot "false";
- path: /etc/cron.d/cloudwatchmon
content: |
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def hostname(value):
parser.add_argument('-n', '--name', type=hostname, help="Instance name")
parser.add_argument('--dry-run-aws', action='store_true', help="Abort before ec2 requests.")
parser.add_argument('--check-price', action='store_true', help="Check price on spot instances")
parser.add_argument('--image-id', default='ami-0964546d3da97e3ab', help="Default machine is ubuntu 20.04")
parser.add_argument('--image-id', default='ami-012af15928e0c2823', help="packer AMI build")
parser.add_argument('--instance-type', default='t2.medium',
help="AWS Instance type")
parser.add_argument('--profile-name', default=None, help="AWS creds profile")
Expand Down

0 comments on commit 8d3ea37

Please sign in to comment.