diff --git a/.ansible-lint b/.ansible-lint
index 51fc727..c9eef88 100644
--- a/.ansible-lint
+++ b/.ansible-lint
@@ -5,3 +5,4 @@ skip_list:
# Define paths or files to ignore
exclude_paths:
- "tests/dast"
+ - "collections"
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8006a8e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+.idea
+*host_vars*
+*group_vars*
+.vscode
+inventory*
+*__pycache__*
+collections
diff --git a/ansible.cfg b/ansible.cfg
new file mode 100644
index 0000000..a26fd32
--- /dev/null
+++ b/ansible.cfg
@@ -0,0 +1,6 @@
+[defaults]
+collections_path = ./collections
+host_key_checking = False
+
+[ssh_connection]
+ssh_args = "-o UserKnownHostsFile=/dev/null"
diff --git a/inventories/infra/deploy-bm-hypervisor.yml b/inventories/infra/deploy-bm-hypervisor.yml
new file mode 100644
index 0000000..c3ece05
--- /dev/null
+++ b/inventories/infra/deploy-bm-hypervisor.yml
@@ -0,0 +1,7 @@
+executors:
+ hosts:
+ bastion:
+
+hypervisors:
+ hosts:
+ hypervisor:
diff --git a/playbooks/infra/deploy-bm-hypervisor.yml b/playbooks/infra/deploy-bm-hypervisor.yml
new file mode 100644
index 0000000..bfb0bde
--- /dev/null
+++ b/playbooks/infra/deploy-bm-hypervisor.yml
@@ -0,0 +1,321 @@
+## Disclaimer
+# This playbook is not officially supported and comes with no guarantees.
+# Use it at your own risk. Ensure you test thoroughly in your environment
+# before deploying to production.
+
+# Ansible Playbook for Bare-Metal Hypervisor Deployment Using Kickstart and iDRAC Boot
+
+## Overview
+# This playbook automates the deployment of a hypervisor on bare-metal servers
+# using a Kickstart-enabled ISO and iDRAC/ILO boot. It ensures that all necessary
+# configurations, software installations, and network settings are applied
+# for a fully operational virtualization environment.
+#
+# Note: The Bastion Linux server should be pre-installed and accessible
+# in order to deploy the hypervisor.
+
+## Prerequisites
+# - Ansible 2.10+ installed on the control node.
+# - Target servers must be accessible via SSH.
+# - Ensure the `passlib` and `community.general` collections are installed.
+# - iDRAC or equivalent out-of-band management configured on the bare-metal server.
+
+## Roles Requirements
+# The playbook uses multiple roles:
+# - kickstart_iso: Prepares the Kickstart-enabled ISO.
+# - redhatci.ocp.setup_http_store: Sets up HTTP storage for hosting the ISO.
+# - redhatci.ocp.boot_iso: Boots the bare-metal server using the ISO.
+
+## Variables Used by Playbook
+# Please note: For `kickstart_iso` variables, refer to the `kickstart_iso` README.
+# all:
+# activate_system_cmd: active-bin # Command to activate the system
+# ansible_become_password: "become_password" # Password for becoming root (BECOME PASSWORD)
+# ansible_password: "pa$$word" # SSH password for Ansible user
+# ansible_ssh_private_key: 'ssh-key' # Path to the private SSH key for authentication
+# ansible_user: user # SSH username for remote access
+# bmc_password: 'pa$$word' # Password for BMC (Baseboard Management Controller)
+# bmc_user: 'user' # Username for BMC authentication
+# ssh_public_key: 'public_ssh_key' # Public SSH key for authentication after bare-metal installation
+# system_rpm_link: http://example.rpm # URL to the RPM package used for system activation
+
+# hypervisor:
+# ansible_host: 10.1.1.1 # IP address or hostname of the hypervisor
+# bmc_address: BMC_ADDRESS # BMC address of the hypervisor
+# net_config: |-
+# interface_name: "eth0" # Main interface name used for Ansible connection
+# hostname: "hypervisor.example.com" # Hostname of the hypervisor
+# ip: "{{ ansible_host }}" # IP address of the hypervisor (matches ansible_host)
+# mask: "255.255.255.0" # Subnet mask
+# gw: "10.1.1.254" # Gateway address
+# dns: "10.1.1.254" # DNS server address
+# seconday_networks: |- # BM secondary networks
+# bridge-1: # Name of the bridge interface
+# ipv4: "192.168.1.1/24" # IPv4 address and subnet
+# vlan: 998 # VLAN ID
+# ifname: "eth0" # Interface name for the bridge
+# bridge-2:
+# ipv4: "192.168.2.1/24"
+# vlan: 999
+# ifname: "eth0"
+# timezone: "America/Toronto" # Timezone of the hypervisor
+# vendor: "HPE" # Vendor of the hypervisor (could also be Dell, depending on the out-of-band interface type)
+
+# bastion:
+# ansible_host: 10.1.1.2 # IP address or hostname of the bastion server
+
+# bastions:
+# dest_iso_dir: /tmp/ # Destination directory for ISO files
+# system_iso_rdu_link: http://Link-to-rdu-iso-file.iso # Link to the RDU ISO file
+# system_iso_tlv_link: http://link-to-tlv-iso-file.iso # Link to the TLV ISO file
+
+
+## Playbook Workflow
+# 1. Kickstart ISO Creation:
+# - The `kickstart_iso` role generates a Kickstart-enabled ISO.
+# - The ISO is hosted on the bastion server's HTTP storage.
+
+# 2. Bare-Metal Boot:
+# - The bare-metal server boots using the ISO hosted on the bastion server.
+# - The playbook waits for the installation to complete before proceeding.
+
+# 3. Post-Installation Configuration:
+# - Installs the system RPM package and activates the OS.
+# - Configures network interfaces and bridges for virtualization.
+# - Sets up virtualization tools like `qemu-kvm`, `libvirt`, and `virt-install`.
+
+# 4. Final Setup:
+# - Configures SSH keys for secure access.
+# - Sets up libvirt storage and permissions.
+# - Ensures all software dependencies are updated.
+
+## Running the Playbook
+# Ensure that host_vars and group_vars are properly installed.
+# Execute the playbook with the following command:
+# ansible-playbook playbooks/infra/deploy-vm-bastion-libvirt.yml -i ./inventories/infra/deploy-bm-hypervisor.yml
+---
+- name: Create a Kickstart-enabled ISO
+ hosts: bastion
+ gather_facts: true
+ vars:
+ iso_mount_path: "{{ dest_iso_dir }}/mount"
+ os_install_path: "{{ dest_iso_dir }}/os-install"
+ location: rdu
+ system_iso_link: "{{ system_iso_rdu_link if location == 'rdu' else system_iso_tlv_link }}"
+ tasks:
+ - name: Set ISO name
+ ansible.builtin.set_fact:
+ iso_name: installation.iso
+
+ - name: Prepare kickstart iso
+ ansible.builtin.import_role:
+ name: kickstart_iso
+ vars:
+ kickstart_iso_link: "{{ system_iso_link }}"
+ kickstart_iso_name: "{{ iso_name }}"
+ kickstart_iso_file_desire_location: /opt/http_store/data
+ kickstart_iso_timezone: "{{ hostvars['hypervisor'].timezone }}"
+ kickstart_iso_password: "{{ ansible_password }}"
+ kickstart_iso_username: "{{ ansible_user }}"
+ kickstart_iso_net_config: "{{ hostvars['hypervisor'].net_config | from_yaml }}"
+
+ - name: Setup http storage
+ ansible.builtin.import_role:
+ name: redhatci.ocp.setup_http_store
+
+- name: Deploy Bare-Metal
+ hosts: hypervisor
+ gather_facts: false
+ become: true
+ vars:
+ system_rpm_path: "/tmp/{{ system_rpm_link | basename }}"
+ tasks:
+ - name: Boot BM using pre-configured ISO
+ ansible.builtin.import_role:
+ name: redhatci.ocp.boot_iso
+ vars:
+ boot_iso_url: "http://{{ hostvars['bastion']['ansible_host'] }}/{{ hostvars['bastion']['iso_name'] }}"
+
+ - name: Wait until BM installation is completed
+ ansible.builtin.wait_for_connection:
+ delay: 360
+ sleep: 10
+ timeout: 7200
+ notify:
+ - Remove installation ISO
+
+ - name: Get system rpm from repository
+ ansible.builtin.get_url:
+ url: "{{ system_rpm_link }}"
+ dest: "{{ system_rpm_path }}"
+ force: false
+ mode: "0640"
+
+ - name: Install system rpm
+ ansible.builtin.dnf:
+ name: "{{ system_rpm_path }}"
+ state: present
+ disable_gpg_check: true
+
+ - name: Activate OS
+ ansible.builtin.command:
+ "{{ activate_system_cmd }}"
+ changed_when: false
+
+ - name: Set passwordless sudo
+ ansible.builtin.lineinfile:
+ path: /etc/sudoers.d/{{ ansible_user }}
+ line: "{{ ansible_user }} ALL=(ALL) NOPASSWD: ALL"
+ mode: "0640"
+ create: true
+
+ - name: Configure network connection baremetal
+ vars:
+ ipaddr_mask: "{{ (net_config | from_yaml)['ip'] }}/{{ (net_config | from_yaml)['mask'] }}"
+ community.general.nmcli:
+ type: bridge
+ conn_name: bridge-baremetal
+ method4: manual
+ method6: disabled
+ state: present
+ stp: false
+ ifname: baremetal
+ autoconnect: true
+ ip4: "{{ ipaddr_mask | ansible.utils.ipaddr('address/prefix') }}"
+ gw4: "{{ (net_config | from_yaml)['gw'] }}"
+ dns4:
+ - "{{ (net_config | from_yaml)['dns'] }}"
+
+
+ - name: Set up network connection bridge-slave
+ community.general.nmcli:
+ type: ethernet
+ slave_type: bridge
+ ifname: "{{ (net_config | from_yaml)['interface_name'] }}"
+ master: baremetal
+ method4: disabled
+ conn_name: "{{ (net_config | from_yaml)['interface_name'] }}"
+ state: present
+ autoconnect: true
+
+ - name: Reload NetworkManager connections
+ ansible.builtin.shell: |
+ "nmcli con down {{ (net_config | from_yaml)['interface_name'] }} &&
+ nmcli con up {{ (net_config | from_yaml)['interface_name'] }} &&
+ nmcli con up bridge-baremetal && nmcli con up {{ (net_config | from_yaml)['interface_name'] }}"
+ changed_when: true
+
+ - name: Gather facts
+ ansible.builtin.gather_facts:
+
+ - name: Configure secondary interface bridges
+ when: item.value.ifname in ansible_facts.interfaces
+ loop: "{{ seconday_networks | from_yaml | dict2items }}"
+ community.general.nmcli:
+ type: bridge
+ conn_name: "{{ item.key }}"
+ method4: manual
+ method6: disabled
+ state: present
+ stp: false
+ ifname: "{{ item.key }}"
+ autoconnect: true
+ ip4: "{{ item.value.ipv4 }}"
+
+ - name: Configure vlan interfaces
+ when: item.value.ifname in ansible_facts.interfaces
+ loop: "{{ seconday_networks | from_yaml | dict2items }}"
+ community.general.nmcli:
+ type: vlan
+ conn_name: "vlan{{ item.value.vlan }}"
+ state: present
+ ifname: "vlan{{ item.value.vlan }}"
+ autoconnect: true
+ slave_type: bridge
+ vlanid: "{{ item.value.vlan }}"
+ master: "{{ item.key }}"
+ vlandev: "{{ item.value.ifname }}"
+
+ - name: Install virtualization packages
+ ansible.builtin.dnf:
+ name:
+ - qemu-kvm
+ - libvirt
+ - virt-install
+ - virt-viewer
+ - libguestfs-tools-c
+ state: present
+
+ - name: Add the user to libvirt group
+ ansible.builtin.user:
+ name: "{{ ansible_user }}"
+ groups: libvirt
+ append: true
+
+ - name: Allow VM management for user - {{ ansible_user }}
+ ansible.builtin.blockinfile:
+ state: present
+ dest: /etc/libvirt/qemu.conf
+ block: |
+ user= "{{ ansible_user }}"
+ group= "{{ ansible_user }}"
+
+ - name: Create libvirt storage under user's directory
+ become: false
+ ansible.builtin.file:
+ path: "/home/{{ ansible_user }}/.libvirt/images"
+ recurse: true
+ mode: "0744"
+ state: directory
+
+ - name: Remove libvirt images directory
+ ansible.builtin.file:
+ path: /var/lib/libvirt/images
+ state: absent
+
+ - name: Create a symbolic link for libvirt default storage
+ ansible.builtin.file:
+ src: "/home/{{ ansible_user }}/.libvirt/images"
+ dest: /var/lib/libvirt/images
+ state: link
+
+ - name: Update all dependencies to the latest versions
+ ansible.builtin.package:
+ name: '*'
+ state: latest
+ update_cache: true
+ update_only: true
+
+ - name: Make sure a libvirtd service unit is running
+ ansible.builtin.systemd_service:
+ state: restarted
+ name: libvirtd
+ enabled: true
+
+ - name: Set up authorized_keys
+ become: false
+ ansible.builtin.lineinfile:
+ path: /home/{{ ansible_user }}/.ssh/authorized_keys
+ create: true
+ line: "{{ ssh_public_key }}"
+ mode: "0600"
+
+ - name: Setup RSA key
+ become: false
+ ansible.builtin.copy:
+ content: "{{ ansible_ssh_private_key }}"
+ dest: /home/{{ ansible_user }}/.ssh/id_rsa
+ mode: "0600"
+
+ - name: Setup RSA public key
+ become: false
+ ansible.builtin.copy:
+ content: "{{ ssh_public_key }}"
+ dest: /home/{{ ansible_user }}/.ssh/id_rsa.pub
+ mode: "0600"
+
+ handlers:
+ - name: Remove installation ISO
+ ansible.builtin.file:
+ path: /opt/http_store/data/{{ hostvars['bastion']['iso_name'] }}"
+ state: absent
diff --git a/playbooks/infra/roles/kickstart_iso/README.md b/playbooks/infra/roles/kickstart_iso/README.md
new file mode 100644
index 0000000..134aaca
--- /dev/null
+++ b/playbooks/infra/roles/kickstart_iso/README.md
@@ -0,0 +1,89 @@
+# Ansible Role: `kickstart_iso`
+
+## Disclaimer
+This role is provided as-is, without any guarantees of support or maintenance.
+The author or contributors are not responsible for any issues arising from the use of this role. Use it at your own discretion.
+
+## Description
+This Ansible role automates the creation of a bootable ISO image customized with a Kickstart file for automated installations. It performs the following tasks:
+- Downloads an ISO file.
+- Mounts the ISO and extracts its contents.
+- Configures a Kickstart file for automated installation.
+- Updates bootloader configurations to include the Kickstart installation option.
+- Creates a new bootable ISO with the updated configurations.
+
+## Requirements
+- Ansible 2.9 or newer.
+- Required packages installed on the control node:
+ - `rsync`
+ - `mkisofs`
+ - `sshpass`
+- The target system must support ISO mounting and the necessary filesystem tools.
+
+
+## Role Variables
+The following variables can be configured please notice some of the variables are **required**:
+
+| Variable Name | Default Value | Description|
+|-------------------------------------|--------------------|------------|
+|`kickstart_iso_file_desire_location` | | Target directory where the generated ISO file will be moved after creation. **Required**. Example: `/opt/http_store/data`|
+|`kickstart_iso_timezone` | | Timezone to set in the Kickstart configuration file. **Required**. Example: `America/Toronto` |
+|`kickstart_iso_password` | | Root password to set in the Kickstart configuration file. **Required**. |
+|`kickstart_iso_username` | | Username to create in the Kickstart configuration file. **Required**. |
+|`kickstart_iso_net_config` | | Network configuration for the target system in the Kickstart file. **Required**. See example below |
+|`kickstart_iso_dest_dir` | `/tmp` | Directory to store the downloaded ISO and generated files. |
+|`kickstart_iso_mount_path` | `/tmp/mount` | Directory where the ISO will be mounted. |
+|`kickstart_iso_os_install_path` | `/tmp/os-install` | Working directory for extracted ISO contents. |
+|`kickstart_iso_name` | `installation.iso` | Name of the final bootable ISO. |
+|`kickstart_iso_link` | `https://download.fedoraproject.org/pub/fedora/linux/`
`releases/41/Workstation/x86_64/iso/`
`Fedora-Workstation-Live-x86_64-41-1.4.iso` | URL of the ISO image to download. |
+
+```yaml
+kickstart_iso_net_config:
+ interface_name: "eth0"
+ hostname: "myserver.local"
+ ip: "192.168.1.10"
+ mask: "255.255.255.0"
+ gw: "192.168.1.1"
+ dns: "8.8.8.8"
+```
+## Handlers
+The role includes handlers to clean up temporary files and directories:
+- Remove mount directory.
+- Remove working directory.
+- Remove installation ISO after use.
+
+## Dependencies
+This role does not depend on other roles but requires certain utilities to be installed on the target system.
+
+
+
+## Example Playbook
+Here’s an example of how to use this role in your playbook:
+
+```yaml
+---
+- name: Create a Kickstart-enabled ISO
+ hosts: localhost
+ become: true
+ roles:
+ - role: kickstart_iso
+ vars:
+ kickstart_iso_name: "custom-fedora.iso"
+ kickstart_iso_link: "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-41-1.4.iso"
+ kickstart_iso_file_desire_location: "/home/user/iso"
+ kickstart_iso_timezone: "America/Toronto"
+ kickstart_iso_password: "your_password"
+ kickstart_iso_username: "your_user"
+ kickstart_iso_net_config:
+ interface_name: "eth0"
+ hostname: "myserver.local"
+ ip: "192.168.1.10"
+ mask: "255.255.255.0"
+ gw: "192.168.1.1"
+ dns: "8.8.8.8"
+```
+License
+-------
+
+Apache
+
diff --git a/playbooks/infra/roles/kickstart_iso/defaults/main.yml b/playbooks/infra/roles/kickstart_iso/defaults/main.yml
new file mode 100644
index 0000000..a540ef9
--- /dev/null
+++ b/playbooks/infra/roles/kickstart_iso/defaults/main.yml
@@ -0,0 +1,7 @@
+---
+# defaults file for kickstart_iso
+kickstart_iso_dest_dir: "/tmp"
+kickstart_iso_mount_path: "/tmp/mount"
+kickstart_iso_os_install_path: "/tmp/os-install"
+kickstart_iso_name: "installation.iso"
+kickstart_iso_link: "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-41-1.4.iso"
diff --git a/playbooks/infra/roles/kickstart_iso/handlers/main.yml b/playbooks/infra/roles/kickstart_iso/handlers/main.yml
new file mode 100644
index 0000000..7071162
--- /dev/null
+++ b/playbooks/infra/roles/kickstart_iso/handlers/main.yml
@@ -0,0 +1,25 @@
+---
+# handlers file for kickstart_iso
+- name: Remove mount directory {{ kickstart_iso_mount_path }}
+ become: true
+ ansible.builtin.file:
+ state: absent
+ path: "{{ kickstart_iso_mount_path }}"
+
+- name: Remove working directory
+ become: true
+ ansible.builtin.file:
+ state: absent
+ path: "{{ kickstart_iso_os_install_path }}"
+
+- name: Remove installation ISO from {{ kickstart_iso_dest_dir }}
+ become: true
+ ansible.builtin.file:
+ state: absent
+ path: "{{ kickstart_iso_dest_dir }}/{{ kickstart_iso_name }}"
+
+- name: "Remove ISO from {{ kickstart_iso_dest_dir }}"
+ become: true
+ ansible.builtin.file:
+ state: absent
+ path: "{{ kickstart_iso_dest_dir }}/{{ kickstart_iso_link | basename }}"
diff --git a/playbooks/infra/roles/kickstart_iso/meta/main.yml b/playbooks/infra/roles/kickstart_iso/meta/main.yml
new file mode 100644
index 0000000..cb7f43d
--- /dev/null
+++ b/playbooks/infra/roles/kickstart_iso/meta/main.yml
@@ -0,0 +1,20 @@
+galaxy_info:
+ author: Nikita Kononov
+ description: >
+ An Ansible role to create a bootable ISO image with a customized Kickstart configuration for automated installations.
+ **Disclaimer:** This role is provided as-is, without any guarantees of support or maintenance.
+ company: Red Hat
+ license: Apache-2.0
+ standalone: true
+ min_ansible_version: "2.9"
+ galaxy_tags:
+ - iso
+ - kickstart
+ - automation
+ - installation
+ - system
+ - packaging
+
+dependencies: []
+ # List your role dependencies here, one per line. Be sure to remove the '[]' above,
+ # if you add dependencies to this list.
diff --git a/playbooks/infra/roles/kickstart_iso/tasks/main.yml b/playbooks/infra/roles/kickstart_iso/tasks/main.yml
new file mode 100644
index 0000000..f148c5d
--- /dev/null
+++ b/playbooks/infra/roles/kickstart_iso/tasks/main.yml
@@ -0,0 +1,124 @@
+---
+# tasks file for kickstart_iso
+- name: Install required dependencies
+ become: true
+ ansible.builtin.dnf:
+ name:
+ - rsync
+ - mkisofs
+ - sshpass
+ state: present
+
+- name: Dowload ISO image
+ ansible.builtin.get_url:
+ url: "{{ kickstart_iso_link }}"
+ dest: "{{ kickstart_iso_dest_dir }}"
+ force: false
+ mode: "0640"
+
+- name: Create mount directory
+ ansible.builtin.file:
+ state: directory
+ recurse: true
+ path: "{{ kickstart_iso_mount_path }}"
+
+- name: Mount iso to {{ kickstart_iso_mount_path }}
+ become: true
+ ansible.posix.mount:
+ path: "{{ kickstart_iso_mount_path }}"
+ src: "{{ kickstart_iso_dest_dir }}/{{ kickstart_iso_link | basename }}"
+ fstype: iso9660
+ opts: ro
+ state: ephemeral
+
+- name: Create working directory
+ ansible.builtin.file:
+ state: directory
+ recurse: true
+ path: "{{ kickstart_iso_os_install_path }}"
+
+- name: Copy installation content to working directory
+ become: true
+ ansible.posix.synchronize:
+ src: "{{ kickstart_iso_mount_path }}/"
+ dest: "{{ kickstart_iso_os_install_path }}/"
+ copy_links: true
+ delegate_to: "{{ inventory_hostname }}"
+
+- name: Collect dvd label
+ become: true
+ ansible.builtin.command:
+ "blkid -s LABEL -o value /dev/loop0"
+ register: volume_name
+ changed_when: false
+
+- name: Unmount iso from {{ kickstart_iso_mount_path }}
+ become: true
+ ansible.posix.mount:
+ path: "{{ kickstart_iso_mount_path }}"
+ src: "{{ kickstart_iso_dest_dir }}/{{ kickstart_iso_link | basename }}"
+ fstype: iso9660
+ opts: ro
+ state: unmounted
+ notify: Remove mount directory {{ kickstart_iso_mount_path }}
+
+- name: Set up kickstart file
+ become: true
+ ansible.builtin.template:
+ src: templates/kickstart.j2
+ dest: "{{ kickstart_iso_os_install_path }}/anaconda-ks.cfg"
+ mode: "0644"
+ owner: root
+ group: root
+
+- name: Add new entry to boot menu
+ become: true
+ ansible.builtin.blockinfile:
+ state: present
+ path: "{{ kickstart_iso_os_install_path }}/isolinux/isolinux.cfg"
+ insertbefore: 'menu end'
+ content: |
+ label kickstart
+ menu label ^Kickstart Installation
+ kernel vmlinuz
+
+ append initrd=initrd.img inst.stage2=hd:LABEL={{ volume_name.stdout }} inst.ks=hd:LABEL={{ volume_name.stdout }}:/anaconda-ks.cfg
+
+- name: Replace grub timeout to 10 seconds
+ become: true
+ ansible.builtin.replace:
+ path: "{{ kickstart_iso_os_install_path }}/EFI/BOOT/grub.cfg"
+ regexp: 'set timeout=60'
+ replace: 'set timeout=10'
+
+- name: Add new entry to boot menu
+ become: true
+ ansible.builtin.blockinfile:
+ state: present
+ insertbefore: "menuentry 'Test this media*"
+ path: "{{ kickstart_iso_os_install_path }}/EFI/BOOT/grub.cfg"
+ content: |
+ menuentry 'Kickstart Installation' --class fedora --class gnu-linux --class gnu --class os {
+ linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL={{ volume_name.stdout }} inst.ks=hd:LABEL={{ volume_name.stdout }}:/anaconda-ks.cfg
+ initrdefi /images/pxeboot/initrd.img
+ }
+
+- name: Create bootable iso
+ become: true
+ ansible.builtin.command: |
+ mkisofs -untranslated-filenames -volid {{ volume_name.stdout }} -J -joliet-long -rational-rock -translation-table -input-charset
+ utf-8 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e
+ images/efiboot.img -no-emul-boot -o {{ kickstart_iso_dest_dir }}/{{ kickstart_iso_name }} -graft-points {{ kickstart_iso_os_install_path }}
+ changed_when: true
+ notify: Remove working directory
+
+- name: Move iso file to required directory
+ ansible.builtin.copy:
+ src: "{{ kickstart_iso_dest_dir }}/{{ kickstart_iso_name }}"
+ dest: "{{ kickstart_iso_file_desire_location }}/{{ kickstart_iso_name }}"
+ force: true
+ remote_src: true
+ mode: '0644'
+ notify:
+ - "Remove installation ISO from {{ kickstart_iso_dest_dir }}"
+ - "Remove ISO from {{ kickstart_iso_dest_dir }}"
diff --git a/playbooks/infra/roles/kickstart_iso/templates/kickstart.j2 b/playbooks/infra/roles/kickstart_iso/templates/kickstart.j2
new file mode 100644
index 0000000..5c66a3d
--- /dev/null
+++ b/playbooks/infra/roles/kickstart_iso/templates/kickstart.j2
@@ -0,0 +1,21 @@
+lang en_US
+keyboard --xlayouts='us'
+timezone {{ kickstart_iso_timezone }} --utc
+rootpw {{ kickstart_iso_password }}
+reboot
+text
+cdrom
+bootloader --append="rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M"
+user --name={{ kickstart_iso_username }} --password={{ kickstart_iso_password }} --groups=wheel --shell=/bin/bash --gecos="Telco V10N"
+zerombr
+clearpart --all --initlabel
+autopart
+network --bootproto=static --device={{ kickstart_iso_net_config.interface_name }} --gateway={{ kickstart_iso_net_config.gw }} --ip={{ kickstart_iso_net_config.ip }} --netmask={{ kickstart_iso_net_config.mask }} --nameserver={{ kickstart_iso_net_config.dns }} --activate
+skipx
+firstboot --disable
+selinux --enforcing
+firewall --enabled
+%packages
+@^minimal-environment
+kexec-tools
+%end
diff --git a/requirements.yml b/requirements.yml
index 033c356..faaf30b 100644
--- a/requirements.yml
+++ b/requirements.yml
@@ -1,3 +1,6 @@
---
collections:
- - redhatci.ocp
+ - name: community.libvirt
+ version: "1.3.0"
+ - name: redhatci.ocp
+ version: "0.24.1736348776"