Skip to content

Instantly share code, notes, and snippets.

@ojpojao
Created April 8, 2023 00:10
Show Gist options
  • Save ojpojao/ec9df2257408d5848be7570db6d5dfe9 to your computer and use it in GitHub Desktop.
Save ojpojao/ec9df2257408d5848be7570db6d5dfe9 to your computer and use it in GitHub Desktop.
cloud-init para XCP-NG
#cloud-config
# vim: syntax=yaml
# allow change hostname when false
preserve_hostname: false
# change hostname
hostname: {name}%
# setup /etc/hosts
manage_etc_hosts: true
disable_root: true
apt_preserve_sources_list: true
# The modules that run in the '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
cloud_config_modules:
# Emit the cloud config ready event
# this can be used by upstart jobs for 'start on cloud-config'.
- emit_upstart
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- apt-pipelining
- apt-configure
- ntp
- timezone
- disable-ec2-metadata
- runcmd
# The modules that run in the 'final' stage
cloud_final_modules:
- package-update-upgrade-install
- fan
- mcollective
- scripts-vendor
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- final-message
- power-state-change
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
- name: bunek
gecos: bunekinha brasil
groups: [adm, audio, cdrom, dialout, dip, floppy, netdev, plugdev, sudo, video]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
lock_passwd: false
# mkpasswd --method=SHA-512 --rounds=4096; type output in 'passwd'
passwd: <pass_hash_here>
chpasswd: {expire: True}
ssh_pwauth: True
ssh_authorized_keys:
- ssh-rsa <pubkey>
# 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/
package_mirrors:
- arches: [default]
failsafe:
primary: http://deb.debian.org/debian
security: http://security.debian.org/
ssh_svcname: ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment