From 7e4c2d87e28dbfa86ddf67c595b6948f64ec65cb Mon Sep 17 00:00:00 2001 From: Sandwich Date: Fri, 2 Jan 2026 14:09:58 +0100 Subject: [PATCH] Make inventory examples more generic --- inventory_example.yml | 46 +++++--- inventory_libvirt_example.yml | 213 +++++++--------------------------- 2 files changed, 70 insertions(+), 189 deletions(-) diff --git a/inventory_example.yml b/inventory_example.yml index b062449..7272c9b 100644 --- a/inventory_example.yml +++ b/inventory_example.yml @@ -1,40 +1,50 @@ --- all: vars: - hypervisor: "proxmox" install_type: "virtual" + hypervisor: "proxmox" install_drive: "/dev/sda" boot_iso: "local:iso/archlinux-x86_64.iso" vm_nif: "vmbr0" - vm_gw: "10.0.0.1" - vm_dns: - - 1.1.1.1 - - 1.0.0.1 - vm_dns_search: - - example.com children: proxmox: hosts: - proxy01.example.com: + app01.example.com: ansible_host: 10.0.0.10 - hostname: "proxy01.example.com" - vm_id: 100 + hostname: "app01.example.com" os: "archlinux" filesystem: "btrfs" - vm_memory: 4096 - vm_ballo: 2048 + vm_id: 100 vm_cpus: 2 + vm_memory: 4096 vm_size: 40 vm_ip: 10.0.0.10 - database01.example.com: + vm_nms: 24 + vm_gw: 10.0.0.1 + vm_dns: + - 1.1.1.1 + - 1.0.0.1 + extra_packages: + - jq + - tmux + db01.example.com: ansible_host: 10.0.0.11 - hostname: "database01.example.com" - vm_id: 101 + hostname: "db01.example.com" os: "rhel9" filesystem: "xfs" - vm_memory: 4096 - vm_ballo: 2048 + vm_id: 101 vm_cpus: 4 - vm_size: 60 + vm_memory: 8192 + vm_size: 80 vm_ip: 10.0.0.11 + vm_nms: 24 + vm_gw: 10.0.0.1 + vm_dns: "1.1.1.1,1.0.0.1" rhel_iso: "local:iso/rhel-9.4-x86_64-dvd.iso" + luks_enabled: true + luks_passphrase: "CHANGE_ME" + luks_auto_decrypt_method: "keyfile" + luks_keyfile_size: 128 + cis: true + selinux: false + firewalld_enabled: false diff --git a/inventory_libvirt_example.yml b/inventory_libvirt_example.yml index 72e31e0..cf22ce2 100644 --- a/inventory_libvirt_example.yml +++ b/inventory_libvirt_example.yml @@ -1,185 +1,56 @@ --- all: vars: - hypervisor: "libvirt" install_type: "virtual" + hypervisor: "libvirt" install_drive: "/dev/vda" boot_iso: "/var/lib/libvirt/images/archlinux-x86_64.iso" - rhel_iso: "/var/lib/libvirt/images/rhel-9.4-x86_64-dvd.iso" - vm_cpus: 2 - vm_memory: 4096 - vm_size: 30 - vm_nms: 24 - vm_gw: 192.168.122.1 - vm_dns: 1.1.1.1 children: libvirt: hosts: - archlinux-luks: - ansible_host: 192.168.122.100 - hostname: "archlinux-luks" - os: "archlinux" - filesystem: "btrfs" - vm_ip: 192.168.122.100 - luks_enabled: true - archlinux-plain: - ansible_host: 192.168.122.101 - hostname: "archlinux-plain" - os: "archlinux" - filesystem: "ext4" - vm_ip: 192.168.122.101 - luks_enabled: false - almalinux-luks: - ansible_host: 192.168.122.102 - hostname: "almalinux-luks" - os: "almalinux" - filesystem: "xfs" - vm_ip: 192.168.122.102 - luks_enabled: true - almalinux-plain: - ansible_host: 192.168.122.103 - hostname: "almalinux-plain" - os: "almalinux" - filesystem: "ext4" - vm_ip: 192.168.122.103 - luks_enabled: false - debian11-luks: - ansible_host: 192.168.122.104 - hostname: "debian11-luks" - os: "debian11" - filesystem: "ext4" - vm_ip: 192.168.122.104 - luks_enabled: true - debian11-plain: - ansible_host: 192.168.122.105 - hostname: "debian11-plain" - os: "debian11" - filesystem: "xfs" - vm_ip: 192.168.122.105 - luks_enabled: false - debian12-luks: - ansible_host: 192.168.122.106 - hostname: "debian12-luks" - os: "debian12" - filesystem: "btrfs" - vm_ip: 192.168.122.106 - luks_enabled: true - debian12-plain: - ansible_host: 192.168.122.107 - hostname: "debian12-plain" + web01.example.com: + ansible_host: 192.168.122.10 + hostname: "web01.example.com" os: "debian12" filesystem: "ext4" - vm_ip: 192.168.122.107 - luks_enabled: false - debian13-luks: - ansible_host: 192.168.122.108 - hostname: "debian13-luks" - os: "debian13" - filesystem: "btrfs" - vm_ip: 192.168.122.108 - luks_enabled: true - debian13-plain: - ansible_host: 192.168.122.109 - hostname: "debian13-plain" - os: "debian13" - filesystem: "xfs" - vm_ip: 192.168.122.109 - luks_enabled: false - fedora-luks: - ansible_host: 192.168.122.110 - hostname: "fedora-luks" - os: "fedora" - filesystem: "btrfs" - vm_ip: 192.168.122.110 - luks_enabled: true - fedora-plain: - ansible_host: 192.168.122.111 - hostname: "fedora-plain" - os: "fedora" - filesystem: "xfs" - vm_ip: 192.168.122.111 - luks_enabled: false - rhel8-luks: - ansible_host: 192.168.122.112 - hostname: "rhel8-luks" - os: "rhel8" - filesystem: "ext4" - vm_ip: 192.168.122.112 - luks_enabled: true - rhel8-plain: - ansible_host: 192.168.122.113 - hostname: "rhel8-plain" - os: "rhel8" - filesystem: "ext4" - vm_ip: 192.168.122.113 - luks_enabled: false - rhel9-luks: - ansible_host: 192.168.122.114 - hostname: "rhel9-luks" - os: "rhel9" - filesystem: "xfs" - vm_ip: 192.168.122.114 - luks_enabled: true - rhel9-plain: - ansible_host: 192.168.122.115 - hostname: "rhel9-plain" - os: "rhel9" - filesystem: "ext4" - vm_ip: 192.168.122.115 - luks_enabled: false - rhel10-luks: - ansible_host: 192.168.122.116 - hostname: "rhel10-luks" - os: "rhel10" - filesystem: "xfs" - vm_ip: 192.168.122.116 - luks_enabled: true - rhel10-plain: - ansible_host: 192.168.122.117 - hostname: "rhel10-plain" - os: "rhel10" - filesystem: "ext4" - vm_ip: 192.168.122.117 - luks_enabled: false - rocky-luks: - ansible_host: 192.168.122.118 - hostname: "rocky-luks" - os: "rocky" - filesystem: "xfs" - vm_ip: 192.168.122.118 - luks_enabled: true - rocky-plain: - ansible_host: 192.168.122.119 - hostname: "rocky-plain" - os: "rocky" - filesystem: "ext4" - vm_ip: 192.168.122.119 - luks_enabled: false - ubuntu-luks: - ansible_host: 192.168.122.120 - hostname: "ubuntu-luks" - os: "ubuntu" - filesystem: "btrfs" - vm_ip: 192.168.122.120 - luks_enabled: true - ubuntu-plain: - ansible_host: 192.168.122.121 - hostname: "ubuntu-plain" - os: "ubuntu" - filesystem: "ext4" - vm_ip: 192.168.122.121 - luks_enabled: false - ubuntu-lts-luks: - ansible_host: 192.168.122.122 - hostname: "ubuntu-lts-luks" + vm_cpus: 2 + vm_memory: 2048 + vm_size: 30 + vm_ip: 192.168.122.10 + vm_nms: 24 + vm_gw: 192.168.122.1 + vm_dns: 1.1.1.1 + extra_packages: + - nginx + - fail2ban + vault01.example.com: + ansible_host: 192.168.122.11 + hostname: "vault01.example.com" os: "ubuntu-lts" filesystem: "btrfs" - vm_ip: 192.168.122.122 + vm_cpus: 2 + vm_memory: 4096 + vm_size: 40 + vm_ip: 192.168.122.11 + vm_nms: 24 + vm_gw: 192.168.122.1 + vm_dns_search: "example.com" luks_enabled: true - ubuntu-lts-plain: - ansible_host: 192.168.122.123 - hostname: "ubuntu-lts-plain" - os: "ubuntu-lts" - filesystem: "ext4" - vm_ip: 192.168.122.123 - luks_enabled: false + luks_passphrase: "CHANGE_ME" + luks_auto_decrypt_method: "keyfile" + firewalld_enabled: false + rhel9.example.com: + ansible_host: 192.168.122.12 + hostname: "rhel9.example.com" + os: "rhel9" + filesystem: "xfs" + vm_cpus: 4 + vm_memory: 8192 + vm_size: 80 + vm_ip: 192.168.122.12 + vm_nms: 24 + vm_gw: 192.168.122.1 + vm_dns: "1.1.1.1,1.0.0.1" + vm_path: "/srv/libvirt/images" + rhel_iso: "/var/lib/libvirt/images/rhel-9.4-x86_64-dvd.iso" + vlan_name: "100"