Closed giordano closed 10 months ago
It's impossible to un-register an already installed runner, if the user is different from runner_user, because at https://github.com/MonolithProjects/ansible-github_actions_runner/blob/f7f0dcab20d6622c20946572f9a50128b0c5f64f/tasks/uninstall_runner.yml#L26-L27 become: false completely defeats the point of setting become_user in the first place.
runner_user
become: false
become_user
Also other changes like https://github.com/MonolithProjects/ansible-github_actions_runner/commit/65b15a8f18a817ae30ac870bfbf329092140fead#diff-c075509e76672dcf3249176a63e0a2e5e90db807b64696d88364ed0c65f82a9eL90 look suspiciously wrong, become defaults to false/no, thus making become_user pointless.
become
false
no
I'm not really sure what's the rationale of these changes.
Bug Report
ansible [core 2.15.4] config file = None configured module search path = ['/home/mose/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/mose/repo/TLOmodel/src/scripts/dev/ci-test-vm/env/lib/python3.11/site-packages/ansible ansible collection location = /home/mose/.ansible/collections:/usr/share/ansible/collections executable location = /home/mose/repo/TLOmodel/src/scripts/dev/ci-test-vm/env/bin/ansible python version = 3.11.5 (main, Sep 2 2023, 14:16:33) [GCC 13.2.1 20230801] (/home/mose/repo/TLOmodel/src/scripts/dev/ci-test-vm/env/bin/python3) jinja version = 3.1.2 libyaml = True
--- - name: Install GitHub Actions Runner hosts: all user: ansible become: yes vars: - github_account: github-access-user - github_repo: my_awesome_repo - runner_user: gha - reinstall_runner: yes roles: - role: monolithprojects.github_actions_runner
Use this twice to reinstall the runners, the key is setting runner_user to a different user.
Operation is successful, and the agent is correctly unregistered before being installed again
The operation fails, because `./config.sh` is being run with the wrong user.
Issue fixed in https://github.com/MonolithProjects/ansible-github_actions_runner/pull/190
Summary
It's impossible to un-register an already installed runner, if the user is different from
runner_user
, because at https://github.com/MonolithProjects/ansible-github_actions_runner/blob/f7f0dcab20d6622c20946572f9a50128b0c5f64f/tasks/uninstall_runner.yml#L26-L27become: false
completely defeats the point of settingbecome_user
in the first place.Also other changes like https://github.com/MonolithProjects/ansible-github_actions_runner/commit/65b15a8f18a817ae30ac870bfbf329092140fead#diff-c075509e76672dcf3249176a63e0a2e5e90db807b64696d88364ed0c65f82a9eL90 look suspiciously wrong,
become
defaults tofalse
/no
, thus makingbecome_user
pointless.I'm not really sure what's the rationale of these changes.
Issue Type
Bug Report
Ansible Version
Steps to Reproduce
Use this twice to reinstall the runners, the key is setting
runner_user
to a different user.Expected Results
Operation is successful, and the agent is correctly unregistered before being installed again
Actual Results