-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcloud-init.yml
More file actions
63 lines (53 loc) · 1.64 KB
/
cloud-init.yml
File metadata and controls
63 lines (53 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#cloud-config
# See examples: https://github.com/canonical/cloud-init/tree/main/doc/examples
# Hostname is automatically replaced with virt-cloud-init.sh script upon execution
hostname: default-vm
locale: en_US.UTF-8
# disable ssh access as root.
disable_root: true
# if you want to allow SSH with password, set this to true
ssh_pwauth: false
# users[0] (the first user in users) overrides the user directive.
users:
- name: kube
gecos: Kubernetes Clustorious
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users, adm
shell: /bin/bash
lock_passwd: false
## Generate with:
# $ mkpasswd --method=SHA-512 --rounds=4096
hashed_passwd: |
$6$rounds=4096$pBZCcpBYJ45UWZvO$79Bi.56lBlpOv/jNcc6gEEyr1z/LtfW0SV227xWbEI2lUOLtHwPBlRv7m4K9wDq0nkMt5gBDRN92MD1JHzsaB0
## Or use plaintext
# plain_text_passwd: master
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJIIE8yB7iKpQoE7nhIK2WhdC+4BnLFde9kVtiaYakie eddsa-key-20250928"
## Import ssh from github
# ssh_import_id:
# - gh:mbrav
# IPv6 is disabled by default
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp6: false
# Env variables
write_files:
- path: /etc/environment
content: |
MY_ENV="my value"
append: true
# list of packages to install after the VM comes up
package_upgrade: true
package_reboot_if_required: true
package_update: true
packages:
- qemu-guest-agent
- htop
# run the commands after the first install, the last command is saving VM ip into /tmp/my-ip file
runcmd:
- echo "Hello World!"
# written to /var/log/cloud-init-output.log
final_message: "The system is finally up, after $UPTIME seconds"