Skip to content

Instantly share code, notes, and snippets.

@hyperupcall
Last active February 10, 2020 03:14
Show Gist options
  • Save hyperupcall/eb9127c48f37a6bafc449f5a9add997f to your computer and use it in GitHub Desktop.
Save hyperupcall/eb9127c48f37a6bafc449f5a9add997f to your computer and use it in GitHub Desktop.
my cloud init snippets
instance-id: 60a5a5b4-5c2f-4b7c-ade5-1d07483a2725
#cloud-config
password: arrow
chpasswd:
expire: false
ssh_pwauth: true
#cloud-config
users:
- default
- name: user
passwd: $6$QwM7oc3p$TfPrrnIJO7ff72AXTcI7h3Y7xlDV8OSEmznjyQDck7joC9T8mEgqvhYQB7c1ADrKjpB5OH6tfhPFoRA2O9yGo1
lock_passwd: false
#cloud-config
hostname: foo
system_info:
default_user:
name: administrator # don't use 'admin'
plain_text_passwd: arrow
#passwd: $6$QwM7oc3p$TfPrrnIJO7ff72AXTcI7h3Y7xlDV8OSEmznjyQDck7joC9T8mEgqvhYQB7c1ADrKjpB5OH6tfhPFoRA2O9yGo1
lock_passwd: false
chpasswd:
expire: false
ssh_pwauth: true
#cloud-config
chpasswd:
list: |
ubuntu:arrow
expire: false
#cloud-config
# updates
package_update: true
package_upgrade: true
# misc
timezone: America/Los_Angelos
hostname: hostname
# disable 'root' login, instead showing message instructing to login as default $user
disable_root: true
# causes the set+update hostname module to not operate (if true)
preserve_hostname: false
packages:
- neovim
runcmd:
- chmod -x /etc/update-motd.d/50-motd-news
users:
- default
- name: user
passwd: $6$QwM7oc3p$TfPrrnIJO7ff72AXTcI7h3Y7xlDV8OSEmznjyQDck7joC9T8mEgqvhYQB7c1ADrKjpB5OH6tfhPFoRA2O9yGo1
lock_passwd: false
shell: /bin/bash
ssh_authorized_keys:
- ''
# system and/or distro specific settings (not accessible to handlers/transforms)
system_info:
# this will affect which distro class gets used
distro: ubuntu
# default user name + that default users groups (if added/used)
# passwd is arrow
default_user:
name: ops
passwd: $6$QwM7oc3p$TfPrrnIJO7ff72AXTcI7h3Y7xlDV8OSEmznjyQDck7joC9T8mEgqvhYQB7c1ADrKjpB5OH6tfhPFoRA2O9yGo1
lock_passwd: false
gecos: Ops
groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
# automatically discover the ntp_client
ntp_client: auto
# other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/templates/
upstart_dir: /etc/init/
ssh_svcname: ssh
# modules that run in 'init' stage
cloud_init_modules:
- migrator
- seed_random
- bootcmd
- write-files
- growpart
- resizefs
- disk_setup
- mounts
- set_hostname
- update_hostname
- update_etc_hosts
- ca-certs
- rsyslog
- users-groups
- ssh
# modules that run in 'config' stage
cloud_config_modules:
# emit the cloud config ready event, which
# can be used by upstart jobs for 'start on cloud-config'
- emit_upstart
- snap
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- apt-pipelining
- apt-configure
- ntp
- timezone
- runcmd
# modules that run in 'final' stage
cloud_final_modules:
- package-update-upgrade-install
- fan
- landscape
- ubuntu-drivers
- mcollective
- rightscale_userdata
- scripts-vendor
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- phone-home
- final-message
- power-state-change
#cloud-config
users:
- name: user
lock_passwd: false
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
ssh-authorized-keys:
- ''
- name: otheruser
lock_passwd: false
shell: /bin/sh
ssh-authorized-keys:
- ''
#cloud-config
manage_etc_hosts: localhost
disable_root: false
ssh_deletekeys: false
final_message: final message
@hyperupcall
Copy link
Author

hyperupcall commented Jan 26, 2020

note

  • all hashed passwords are 'arrow'
  • do not add a user with name 'admin'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment