Automated Rocky Linux server installation via Kickstart netinstall with post-install configuration. Generates Kickstart files for unattended installs and prepares freshly installed systems for Ansible management.
- Rocky Linux 9
- Rocky Linux 10
- ansible-core >= 2.17
marcstraube.commoncollection (for post-install playbook)
| Role | Description |
|---|---|
| installer | Kickstart generation and post-install configuration |
The installer role operates in two modes controlled by rocky_installer_mode:
| Mode | Purpose | Connection |
|---|---|---|
kickstart |
Generate Kickstart .cfg file locally |
local |
post_install |
Configure freshly installed Rocky server | SSH |
ansible-galaxy collection install marcstraube.rockyansible-galaxy collection install git+https://github.com/marcstraube/ansible-collection-rocky.git,main# requirements.yml
collections:
- name: marcstraube.rocky
version: ">=1.0.0"- name: Generate Rocky Linux Kickstart
hosts: rocky_servers
gather_facts: false
connection: local
tasks:
- name: Include installer role (kickstart mode)
ansible.builtin.include_role:
name: marcstraube.rocky.installer
vars:
rocky_installer_mode: kickstartOr use the included playbook:
ansible-playbook collections/ansible_collections/marcstraube/rocky/playbooks/generate-kickstart.yml \
-i inventories/example -l myserver- name: Rocky Linux Post-Install
hosts: rocky_servers
become: true
tasks:
- name: Include installer role (post_install mode)
ansible.builtin.include_role:
name: marcstraube.rocky.installer
vars:
rocky_installer_mode: post_install# Rocky version (9 or 10)
rocky_version: 10
# Network configuration
rocky_kickstart_network:
method: static # dhcp | static
device: eth0
hostname: rocky-server
ip: "192.168.1.100"
netmask: "255.255.255.0"
gateway: "192.168.1.1"
nameserver: "1.1.1.1"
# Disk partitioning
rocky_disk:
device: sda
method: lvm # auto | lvm
vg_name: rocky
lv_root_size: 0 # 0 = remaining space
lv_swap_size: 4096 # MB
# Security
rocky_selinux: enforcing
rocky_root_password: "{{ vault_rocky_root_password }}"
# Admin user
rocky_admin_user: admin
rocky_admin_ssh_key: "{{ vault_rocky_admin_ssh_key }}"See roles/installer/defaults/main.yml for all available variables.
The installer role is tested with Molecule using Podman containers.
cd roles/installer
molecule testSee CONTRIBUTING.md for development setup and guidelines.
MIT
Marc Straube (email@marcstraube.de)