mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 13:44:50 +08:00
61 lines
1.7 KiB
INI
61 lines
1.7 KiB
INI
#cloud-config
|
|
# CLOUD_IMG: This file was created/modified by the Cloud Image build process
|
|
# https://cloudinit.readthedocs.io/en/22.1_a/
|
|
datasource_list: [ NoCloud, None ]
|
|
|
|
# configure localization
|
|
locale: en_US.UTF-8
|
|
|
|
# configure timezone
|
|
timezone: TimeZone
|
|
|
|
# configure root user
|
|
disable_root: false
|
|
ssh_pwauth: true
|
|
users:
|
|
- name: root
|
|
lock_passwd: false
|
|
shell: /bin/bash
|
|
|
|
chpasswd:
|
|
expire: false
|
|
list: |
|
|
root:tmpWORD
|
|
users:
|
|
- name: root
|
|
password: tmpWORD
|
|
type: text
|
|
|
|
# Despite cloud-init 22.1-9 supports version 2 of network configurations but the "renderers:" doesn't support "network-manager".
|
|
# https://cloudinit.readthedocs.io/en/22.1_a/topics/network-config.html#network-output-policy
|
|
system_info:
|
|
network:
|
|
renderers: ['sysconfig']
|
|
|
|
# The gateway of network for cloud-init 22.1-9 must be "gateway4"(for IPv4) or "gateway6"(for IPv6).
|
|
network:
|
|
version: 2
|
|
ethernets:
|
|
networkAdapter:
|
|
dhcp4: true
|
|
dhcp6: true
|
|
|
|
# later commands
|
|
runcmd:
|
|
- systemctl enable sshd
|
|
- systemctl restart sshd
|
|
- systemctl stop kdump
|
|
- systemctl disable kdump
|
|
- hostnamectl set-hostname HostName
|
|
- fallocate -l 512M /swapspace
|
|
- chmod 600 /swapspace
|
|
- mkswap /swapspace
|
|
- swapon /swapspace
|
|
- echo '/swapspace none swap sw 0 0' >> /etc/fstab
|
|
- sed -i '6i \ \ <port port="sshPORT" protocol="tcp"/>' /etc/firewalld/zones/public.xml
|
|
- sed -i '7i \ \ <port port="sshPORT" protocol="udp"/>' /etc/firewalld/zones/public.xml
|
|
- dnf install curl dnsutils epel-release file lrzsz net-tools vim wget -y
|
|
- systemctl daemon-reload
|
|
- grub2-mkconfig -o $(readlink -f /etc/grub2-efi.cfg)
|
|
- rm -rf /etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
|
|
- touch /etc/cloud/cloud-init.disabled
|