Last active 1731696445

Sample CloudConfig for my XCP-ng Ubuntu-images.

Revision de6fc80f39da9645144f1ca7a196137ed30c6b0a

README.md Raw

This works with XCP-ng and the Ubuntu Cloud Images.

cloud-config.yaml Raw
1#cloud-config
2
3hostname: {name}
4
5# add host to the /etc/hosts
6manage_etc_hosts: true
7
8# don't disable the root user
9disable_root: false
10
11users:
12 # create the user for me
13 - name: myuser
14 # I like to sudo!
15 groups: sudo
16 sudo: ALL=(ALL) NOPASSWD:ALL
17 lock_passwd: false
18 # set user password. Can be generated with mkpasswd (in whois package)
19 # mkpasswd --method=SHA-512
20 passwd: $6$pwewv
21 ssh_authorized_keys:
22 - ssh-rsa MY_SSH_KEY_GOES_HERE...
23 shell: /bin/bash
24 # update SSH key for root (probably not a best practice to allow this but...)
25 - name: root
26 ssh_authorized_keys:
27 - ssh-rsa MY_SSH_KEY_GOES_HERE...
28
29# Update APT repo and upgrade packages
30package_update: true
31package_upgrade: true
32
33# Install a few packages
34packages:
35 - htop
36 - nano
37
38locale: en_US.UTF-8
39timezone: America/Edmonton
40runcmd:
41 # Download and install XE Guest Utils from Github Repo
42 - curl -sL https://github.com/xenserver/xe-guest-utilities/releases/download/v8.4.0/xe-guest-utilities_8.4.0-1_amd64.deb -o /tmp/xe-guest-utilities.deb && sudo dpkg -i /tmp/xe-guest-utilities.deb
43
44# Disable password-based authentication for SSH
45ssh_pwauth: False