The runner doesn't start because the [{{ ansible_facts.services }}](https://github.com/MonolithProjects/ansible-github_actions_runner/blob/1662b2980f21b02c5e480d0ac82cc2c7fd768085/tasks/install_runner.yml#L132) variable doesn't contain the name of the runner as a service. The ansible variable {{ ansible_facts.services }} runs before the runner is installed and configured, therefore [the start and enable](https://github.com/MonolithProjects/ansible-github_actions_runner/blob/1662b2980f21b02c5e480d0ac82cc2c7fd768085/tasks/install_runner.yml#L122) task fails.
I recommend modifying the line thusly:
` when: >
ansible_facts.system != 'Darwin' and
runner_state|lower == "started" and
ansible_facts.services[(runner_service.content | b64decode) | trim ]['state'] != 'running'`
to
` when: >
ansible_facts.system != 'Darwin' and
runner_state|lower == "started" and
ansible_facts.services[(runner_service.content | b64decode) | trim ]['state'] | default('stopped') != 'running'`
This will ensure that the ansible_facts.services will return a default of 'stopped' instead of erroring out because the runner_service.content key is missing from the ansible_facts.services dictionary.
Summary
The startup of the runner fails because the dictionary "{{ ansible_facts.services }}" doesn't contain the key for the runner service.
Issue Type
Bug Report
Ansible Version
Steps to Reproduce
Run the role on RHEL 9.3.
Expected Results
Expect that the runner starts.
Actual Results