Compare commits

...

3 Commits

Author SHA1 Message Date
fe43bf6733 add essential almalinux packages 2024-04-17 05:06:45 +02:00
31c155ce92 install dnf if {{ os }} is fedora 2024-04-17 04:47:33 +02:00
0c75114b94 add rocky to README example 2024-04-17 04:39:29 +02:00
5 changed files with 27 additions and 21 deletions

View File

@ -52,7 +52,7 @@ Inventory variables are defined for individual hosts or VMs in the inventory fil
| `cis` (optional) | Adjusts the installation to be CIS level 3 conformant. | `true`, `false` | | `cis` (optional) | Adjusts the installation to be CIS level 3 conformant. | `true`, `false` |
| `filesystem` | Filesystem type for the VM's primary storage. | `btrfs`, `ext4`, `xfs` | | `filesystem` | Filesystem type for the VM's primary storage. | `btrfs`, `ext4`, `xfs` |
| `hostname` | The hostname assigned to the virtual machine or system. | `vm01` | | `hostname` | The hostname assigned to the virtual machine or system. | `vm01` |
| `os` | Operating system to be installed on the VM. | `archlinux`, `almalinux`, `debian11`, `debian12`, `fedora` | | `os` | Operating system to be installed on the VM. | `archlinux`, `almalinux`, `debian11`, `debian12`, `fedora`, `rocky` |
| `root_password` | Root password for the VM or system, used for initial setup or secure access. | `SecurePass123` | | `root_password` | Root password for the VM or system, used for initial setup or secure access. | `SecurePass123` |
| `user_name` | Username for a user account within the VM, often used with cloud-init. | `adminuser` | | `user_name` | Username for a user account within the VM, often used with cloud-init. | `adminuser` |
| `user_password` | Password for the user account within the VM. | `UserPass123` | | `user_password` | Password for the user account within the VM. | `UserPass123` |

View File

@ -26,12 +26,12 @@
- echo "nameserver 1.0.0.1" > /mnt/etc/resolv.conf - echo "nameserver 1.0.0.1" > /mnt/etc/resolv.conf
- arch-chroot /mnt dnf --releasever=9 --setopt=install_weak_deps=False install -y {{ role_packages.almalinux | join(' ') }} - arch-chroot /mnt dnf --releasever=9 --setopt=install_weak_deps=False install -y {{ role_packages.almalinux | join(' ') }}
- name: Bootstrap Fedora 39 - name: Bootstrap Fedora 40
when: os | lower == 'fedora' when: os | lower == 'fedora'
shell: "{{ item }}" shell: "{{ item }}"
with_items: with_items:
- dnf --releasever=39 --best --repo=fedora --repo=fedora-updates --installroot=/mnt --setopt=install_weak_deps=False groupinstall -y critical-path-base core - dnf --releasever=40 --best --repo=fedora --repo=fedora-updates --installroot=/mnt --setopt=install_weak_deps=False groupinstall -y critical-path-base core
- arch-chroot /mnt dnf --releasever=39 --setopt=install_weak_deps=False install -y {{ role_packages.fedora | join(' ') }} - arch-chroot /mnt dnf --releasever=40 --setopt=install_weak_deps=False install -y {{ role_packages.fedora | join(' ') }}
- arch-chroot /mnt dnf reinstall -y grub2-efi-x64 kernel - arch-chroot /mnt dnf reinstall -y grub2-efi-x64 kernel
- name: Bootstrap RockyLinux 9 - name: Bootstrap RockyLinux 9

View File

@ -1,4 +1,24 @@
--- ---
almalinux:
- bind-utils
- cloud-init
- dhcp-client
- efibootmgr
- glibc-langpack-en
- glibc-langpack-de
- grub2
- grub2-efi
- lrzsz
- nc
- nfs-utils
- nfsv4-client-utils
- open-vm-tools
- shim
- telnet
- vim
- wget
- zstd
archlinux: archlinux:
- base - base
- btrfs-progs - btrfs-progs
@ -126,20 +146,6 @@ fedora:
- vim-default-editor - vim-default-editor
- zstd - zstd
almalinux:
- cloud-init
- dhcp-client
- efibootmgr
- grub2
- grub2-efi-x64-modules
- lrzsz
- nfs-utils
- open-vm-tools
- shim
- telnet
- vim
- zstd
rhel8: rhel8:
- cloud-init - cloud-init
- dhcp-client - dhcp-client

View File

@ -27,7 +27,7 @@
- name: Setup locales - name: Setup locales
block: block:
- name: Configure locale.gen - name: Configure locale.gen
when: os | lower != "rocky" when: os | lower not in ['almalinux', 'fedora', 'rhel8', 'rhel9', 'rocky']
lineinfile: lineinfile:
dest: /mnt/etc/locale.gen dest: /mnt/etc/locale.gen
regexp: '{{ item.regex }}' regexp: '{{ item.regex }}'
@ -36,7 +36,7 @@
- {regex: en_US\.UTF-8 UTF-8, line: en_US.UTF-8 UTF-8} - {regex: en_US\.UTF-8 UTF-8, line: en_US.UTF-8 UTF-8}
- name: Generate locales\ - name: Generate locales\
when: os | lower != "rocky" when: os | lower not in ['almalinux', 'fedora', 'rhel8', 'rhel9', 'rocky']
command: arch-chroot /mnt /usr/sbin/locale-gen command: arch-chroot /mnt /usr/sbin/locale-gen
- name: Set hostname - name: Set hostname

View File

@ -53,7 +53,7 @@
state: latest state: latest
loop: loop:
- { name: 'glibc' } - { name: 'glibc' }
- { name: 'dnf', os: ['almalinux', 'rhel9', 'rhel8', 'rocky'] } - { name: 'dnf', os: ['almalinux', 'fedora', 'rhel9', 'rhel8', 'rocky'] }
- { name: 'debootstrap', os: ['debian11', 'debian12'] } - { name: 'debootstrap', os: ['debian11', 'debian12'] }
- { name: 'debian-archive-keyring', os: ['debian11', 'debian12'] } - { name: 'debian-archive-keyring', os: ['debian11', 'debian12'] }
when: "'os' not in item or os in item.os" when: "'os' not in item or os in item.os"