- name: Setup gitlab runner on the Jumphost hosts: jumphost become: true ignore_errors: "{{ ansible_check_mode }}" vars: {} tasks: - name: define rhel 9 vm with specific specs community.libvirt.virt: command: define xml: | gitlab-runner-vm 16384 2 hvm state: running - name: install and configure gitlab runner, docker dependencies using virt-customize command: > virt-customize -a /var/lib/libvirt/images/gitlab-runner.qcow2 --run-command "dnf install -y dnf-plugins-core" --run-command "dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo" --run-command "dnf install -y docker-ce docker-ce-cli containerd.io" --run-command "systemctl enable --now docker" --run-command "curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh -o /tmp/gitlab-runner-install.sh" --run-command "chmod +x /tmp/gitlab-runner-install.sh && /tmp/gitlab-runner-install.sh" --run-command "rpm --import https://packages.gitlab.com/runner/gitlab-runner/gpgkey/runner-gitlab-runner-49F16C5CC3A0F81F.pub.gpg" --run-command "dnf install -y gitlab-runner" --run-command "systemctl enable --now gitlab-runner" --run-command "usermod -aG docker gitlab-runner"