- name: Setup gitlab runner on the Jumphost hosts: jumphost become: true ignore_errors: "{{ ansible_check_mode }}" vars: {} tasks: - name: define rhel vm community.libvirt.libvirt_domain: command: define name: gitlab-runner-vm state: running memory: 16384 vcpu: 2 disk: - size: 50G type: qcow2 path: /var/lib/libvirt/images/gitlab-runner.qcow2 networks: - name: default os_type: linux os_variant: rhel9.0 graphics: type: none - name: install rhel on the vm (ISO path should point to your rhel iso) community.libvirt.libvirt_domain: command: install name: gitlab-runner-vm state: running cdrom: /path/to/rhel.iso graphics: vnc boot_dev: cdrom - name: wait for vm to boot wait_for: timeout: 600 - name: configure the gitlab runner on the rhel vm hosts: gitlab-runner-vm tasks: - name: enable required repos dnf: name: 'rhel-9-for-x86_64-baseos-rpms' state: present - name: install gitlab runner dnf: name: gitlab-runner state: present - name: enable and start gitlab-runner systemd: name: gitlab-runner enabled: yes state: started