MonolithProjects / ansible-github_actions_runner

Ansible Role to deploy GitHub Actions self-hosted runner
https://galaxy.ansible.com/ui/standalone/roles/monolithprojects/github_actions_runner/
MIT License
189 stars 77 forks source link

bug: fail to identify enrolled runners when count > 30 #197

Closed dotkrnl closed 6 months ago

dotkrnl commented 8 months ago

Summary

Potential solution:

Issue Type

Bug Report

Ansible Version

ansible [core 2.16.3]
  config file = /home/dotkrnl/Workspace/ansible-playbooks/ansible.cfg
  configured module search path = ['/home/dotkrnl/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/dotkrnl/.cache/pypoetry/virtualenvs/rapidstream-ansible-playbooks-Mp6hNgc9-py3.10/lib/python3.10/site-packages/ansible
  ansible collection location = /home/dotkrnl/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/dotkrnl/.cache/pypoetry/virtualenvs/rapidstream-ansible-playbooks-Mp6hNgc9-py3.10/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/home/dotkrnl/.cache/pypoetry/virtualenvs/rapidstream-ansible-playbooks-Mp6hNgc9-py3.10/bin/python)
  jinja version = 3.1.3
  libyaml = True

Steps to Reproduce

- name: Install GitHub actions runner
  ansible.builtin.include_role:
    name: monolithprojects.github_actions_runner

Expected Results

skipping: [XXX] => {
    "changed": false,
    "false_condition": "runner_name not in registered_runners.json.runners|map(attribute='name')|list",
    "skip_reason": "Conditional result was False"
}

where XXX is a registered runner ranked after 30th.

Actual Results

fatal: [[redacted]]: FAILED! => {
    "changed": true,
    "cmd": [
        "/opt/actions-runner/./config.sh",
        "--url",
        "https://github.com/[redacted]",
        "--token",
        "[redacted]",
        "--name",
        "[redacted]",
        "--labels",
        "--runnergroup",
        "--unattended"
    ],
    "delta": "[redacted]",
    "end": "[redacted]",
    "invocation": {
        "module_args": {
            "_raw_params": "/opt/actions-runner/./config.sh --url [redacted] --token [redacted] --name [redacted] --labels  --runnergroup  --unattended ",
            "_uses_shell": false,
            "argv": null,
            "chdir": "/opt/actions-runner",
            "creates": null,
            "executable": null,
            "expand_argument_vars": true,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "[redacted]",
    "stderr": "Cannot configure the runner because it is already configured. To reconfigure the runner, run 'config.cmd remove' or './config.sh remove' first.",
    "stderr_lines": [
        "Cannot configure the runner because it is already configured. To reconfigure the runner, run 'config.cmd remove' or './config.sh remove' first."
    ],
    "stdout": "\n--------------------------------------------------------------------------------\n|        ____ _ _   _   _       _          _        _   _                      |\n|       / ___(_) |_| | | |_   _| |__      / \\   ___| |_(_) ___  _ __  ___      |\n|      | |  _| | __| |_| | | | | '_ \\    / _ \\ / __| __| |/ _ \\| '_ \\/ __|     |\n|      | |_| | | |_|  _  | |_| | |_) |  / ___ \\ (__| |_| | (_) | | | \\__ \\     |\n|       \\____|_|\\__|_| |_|\\__,_|_.__/  /_/   \\_\\___|\\__|_|\\___/|_| |_|___/     |\n|                                                                              |\n|                       Self-hosted runner registration                        |\n|                                                                              |\n--------------------------------------------------------------------------------",
    "stdout_lines": [
        "",
        "--------------------------------------------------------------------------------",
        "|        ____ _ _   _   _       _          _        _   _                      |",
        "|       / ___(_) |_| | | |_   _| |__      / \\   ___| |_(_) ___  _ __  ___      |",
        "|      | |  _| | __| |_| | | | | '_ \\    / _ \\ / __| __| |/ _ \\| '_ \\/ __|     |",
        "|      | |_| | | |_|  _  | |_| | |_) |  / ___ \\ (__| |_| | (_) | | | \\__ \\     |",
        "|       \\____|_|\\__|_| |_|\\__,_|_.__/  /_/   \\_\\___|\\__|_|\\___/|_| |_|___/     |",
        "|                                                                              |",
        "|                       Self-hosted runner registration                        |",
        "|                                                                              |",
        "--------------------------------------------------------------------------------"
    ]
}