# Installation on RHEL 9 Automatisation Ansible Playbook allowing to create ostree images for edge using Ansible. ## Pre-requisites RHEL 9 pre-requisites : - RHEL 9 is installed - The Red Hat repositories **baseos** and **appstream** are reachable Microshift pre-requisites : - RHEL 9.2 or 9.3 - LVM volume group (VG) with unused space ## Install Pre-requisites ```sh sudo subscription-manager register --username $RHN_LOGIN --auto-attach sudo subscription-manager attach --pool=$RHN_POOL_ID sudo dnf install -y osbuild-composer composer-cli cockpit-composer git firewalld python3-toml sudo systemctl enable --now osbuild-composer.socket sudo systemctl enable --now firewalld sudo systemctl enable --now cockpit.socket sudo systemctl restart osbuild-composer sudo usermod -a -G weldr "$(id -un)" ``` Check that **os-composer** is working. ``` $ source /etc/bash_completion.d/composer-cli $ composer-cli status show API server status: Database version: 0 Database supported: true Schema version: 0 API version: 1 Backend: osbuild-composer Build: NEVRA:osbuild-composer-88.3-1.el9_3.x86_64 $ composer-cli sources list appstream baseos ``` ## Nginx configuration Install and configure nginx. ```sh sudo dnf install -y nginx sudo systemctl enable --now nginx.service sudo firewall-cmd --permanent --add-port={80/tcp,443/tcp} sudo firewall-cmd --reload sudo mkdir -p /var/www sudo restorecon -Rv /var/www sudo sed -i.${EPOCHREALTIME:-bak} 's|/usr/share/nginx/html|/var/www|g' /etc/nginx/nginx.conf sudo systemctl restart nginx.service ``` Find the IP address of the current server. ```sh MYIP="$(ip -4 -br addr show scope global | awk 'NR == 1 { split($3, parts, "/"); print parts[1]; }')" ``` ## Create the initial ostree repo Create a `inventory.yaml` file inside the Ansible folder or define the inventory path inside the `ansible.cfg` file Add blueprint file into the blueprint folder or use the `blueprint_example.toml` Create the initial ostree repo using `blueprint_example.toml` use the following command: ``` ansible-playbook playbooks/initial_ostree.yaml -e blueprint=blueprint_example.toml ```