Skip to content

Instantly share code, notes, and snippets.

@devigned
Last active May 12, 2017 16:03
Show Gist options
  • Save devigned/4c4087ace2346e74070f0af11999bb88 to your computer and use it in GitHub Desktop.
Save devigned/4c4087ace2346e74070f0af11999bb88 to your computer and use it in GitHub Desktop.
cloud-init for level 1 blog post
#cloud-config
# Upgrade the instance on first boot
apt_upgrade: true
# Update apt database on first boot
apt_update: true
apt_sources:
- source: "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main"
keyid: 417A0893 # GPG key ID published on a key server
filename: az-cli.list
# Install additional packages on first boot
packages:
- curl
- git-core
- nginx
- apt-transport-https
- ca-certificates
- azure-cli
- build-essential
# Commands to prepare the Habitat development environment
runcmd:
- curl -sSL https://get.rvm.io | bash -s stable --rails
- usermod -a -G rvm deploy
- curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
- sudo apt-get install -y nodejs
- cat /var/lib/waagent/{{ fingerprint }}.crt /var/lib/waagent/{{ fingerprint }}.prv > /home/deploy/.az-cert
- chown deploy:deploy /home/deploy/.az-cert
- chmod 400 /home/deploy/.az-cert
- sudo -H -u deploy az login --service-principal -t {{ tenant }} -u {{ username }} -p /home/deploy/.az-cert
- sudo -H -u deploy npm install -g ember-cli
# Print message at the end of cloud-init job
final_message: "The system is up, after $UPTIME seconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment