Created
June 29, 2020 15:24
-
-
Save sunnyone/defc45dc1b0f2ddb12996d0b528d10fe to your computer and use it in GitHub Desktop.
user-data example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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