Skip to content

Instantly share code, notes, and snippets.

@sunnyone
Created June 29, 2020 15:24
Show Gist options
  • Save sunnyone/defc45dc1b0f2ddb12996d0b528d10fe to your computer and use it in GitHub Desktop.
Save sunnyone/defc45dc1b0f2ddb12996d0b528d10fe to your computer and use it in GitHub Desktop.
user-data example
$ cat >user-data <<EOF
#cloud-config
hostname: cloudtest.localdomain
user: myuser
password: ubuntu
chpasswd: { expire: True }
ssh_pwauth: True
disk_setup:
/dev/vdb:
table_type: 'mbr'
layout:
- [100,82]
overwrite: False
fs_setup:
- label: swap
device: /dev/vdb1
filesystem: swap
mounts:
- [ "LABEL=swap", none, swap, sw, "0", "0" ]
EOF
$ cat >network-config.yaml <<EOF
version: 2
ethernets:
interface0:
match:
name: en*
addresses:
- 192.168.100.11/24
gateway4: 192.168.100.254
nameservers:
search: [localdomain]
addresses: [192.168.100.254]
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment