-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloud-config
38 lines (31 loc) · 1.14 KB
/
cloud-config
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
#cloud-config
# Customize as per your need. At least change username and ssh-ed22519
# key with your actual public key
# Hostname management
preserve_hostname: False
hostname: vm-rhel8
fqdn: vm-rhel8.sample.com
# Setup Users with ssh keys so that I can log in into new machine
users:
- default
- name: sampleuser
groups: ['wheel']
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
ssh-authorized-keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG+zTQJ5sdf4w3sa4tsggdsaQUbMq3jt19HflOtAy1EPBmKw KVM VM Lab SSH Login key for user
# Configure where output will go
output:
all: ">> /var/log/cloud-init.log"
# configure interaction with ssh server
ssh_genkeytypes: ['ed25519', 'rsa']
# Install your public ssh key to the first user-defined user configured
# in cloud.cfg in the template (optional since I created sampleuser)
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG+zTQJ5sdf4w3sa4tsggdsaQUbMq3jt19HflOtAy1EPBmKw KVM VM Lab SSH Login key for user
# set timezone for VM
timezone: Europe/Czechia
# Remove cloud-init
runcmd:
- systemctl stop network && systemctl start network
- yum -y remove cloud-init