Skip to content

Instantly share code, notes, and snippets.

@vancanhuit
Last active August 18, 2024 08:57
Show Gist options
  • Save vancanhuit/b6efa73893dcc6fb19798769c3e28920 to your computer and use it in GitHub Desktop.
Save vancanhuit/b6efa73893dcc6fb19798769c3e28920 to your computer and use it in GitHub Desktop.
Incus/LXD RHEL-based distro profile for a basic initialization
incus launch images:rockylinux/9/cloud test --profile rhel
incus launch images:rockylinux/9/cloud test-vm --vm --profile rhel --profile vm-config
config:
cloud-init.vendor-data: |
## template: jinja
#cloud-config
write_files:
- content: |
install_weak_deps=False
path: /etc/dnf/dnf.conf
append: true
hostname: "{{ ds.meta_data.instance_id }}.lab.internal"
package_upgrade: true
yum_repos:
epel-release:
name: Extra Packages for Enterprise Linux $releasever - $basearch
baseurl: https://dl.fedoraproject.org/pub/epel/$releasever/Everything/$basearch/
metalink: https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
countme: 1
gpgcheck: true
gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever
packages:
- bash-completion
- openssh
- curl
- wget
- htop
- vim
- tar
- man
- firewalld
- certbot
timezone: Asia/Ho_Chi_Minh
runcmd:
- systemctl enable --now firewalld.service
- firewall-cmd --remove-service=cockpit --permanent
- firewall-cmd --remove-service=dhcpv6-client --permanent
- firewall-cmd --add-service=http --permanent
- firewall-cmd --reload
- mandb
limits.cpu: "1"
limits.memory: 1GiB
description: RHEL-based distro Incus profile
devices:
eth0:
name: eth0
network: incusbr0
type: nic
root:
path: /
pool: default
type: disk
name: rhel
used_by: []
project: default
config:
limits.memory: 2GiB
description: "Profile for VM"
devices:
agent:
source: agent:config
type: disk
name: vm-config
used_by: []
project: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment