Skip to content

Instantly share code, notes, and snippets.

@BenjamenMeyer
Last active August 14, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenjamenMeyer/eaadf44fb6ac187465578cc6d02f59b9 to your computer and use it in GitHub Desktop.
Save BenjamenMeyer/eaadf44fb6ac187465578cc6d02f59b9 to your computer and use it in GitHub Desktop.
cloud-init example
#cloud-config
runcmd:
- mkdir -p /root/.config
write_files:
- content: |
[profile matter]
region=americas
[default]
reference=matter
path: /root/.config/matterbot
owner: root:root
permissions: '0660'
#cloud-config
runcmd:
- sleep 60
- apt-get update
- apt-get -y dist-upgrade
write_files:
- content: |
requests
path: /root/reqirements.txt
owner: root:root
permissions: '0660'
packages:
- fail2ban
- ufw
- python-pip
runcmd:
- systemctl restart fail2ban
- ufw allow OpenSSH
- ufw enable
- pip install --upgrade pip
- pip install -r /root/reqirements.txt
users:
- default
- name: matterbot
homedir: /home/matterbot
passwd: <crypt'd password goes here>
shell: /bin/bash
sudo: "ALL=NOPASSWD: ALL"
runcmd:
- usermod -U matterbot
- cp -R /root/.config /home/matterbot
- chown -R matterbot /home/matterbot/.config
chpasswd:
list: |
root: reallyawesomepwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment