From d8909a8d5c2210b1e90651fb4a33ec7dd54cd8bb Mon Sep 17 00:00:00 2001 From: Yethal <26117918+Yethal@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:10:23 +0200 Subject: [PATCH 1/2] Allow different repos in same play --- README.md | 5 ++++- defaults/main.yml | 3 +++ tasks/collect_info.yml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9285602..7574f60 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,9 @@ runner_extra_config_args: "" # Name to assign to this runner in GitHub (System hostname as default) runner_name: "{{ ansible_facts.hostname }}" +# Set to false when provisioning runners for more than one repository within single play +all_runners_in_same_repo: true + # GitHub Repository user or Organization owner used for Runner registration # github_account: "youruser" @@ -292,7 +295,7 @@ cd path/to/monolithprojects.github_actions_runner ```bash export PERSONAL_ACCESS_TOKEN=your_github_pat # Your Personal Access Token to Github export GITHUB_ACCOUNT=your_account # Your Github Account -export GITHUB_ACCOUNT=your_repository # Github Repository where you want to setup the Runner +export GITHUB_REPO=your_repository # Github Repository where you want to setup the Runner ``` 3. Run Molecule: diff --git a/defaults/main.yml b/defaults/main.yml index ea07a76..2c30cbc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -48,6 +48,9 @@ runner_extra_config_args: "" # Name to assign to this runner in GitHub (System hostname as default) runner_name: "{{ ansible_facts.hostname }}" +# Set to false when provisioning runners for more than one repository within single play +all_runners_in_same_repo: true + # GitHub Repository user or Organization owner used for Runner registration # github_account: "youruser" diff --git a/tasks/collect_info.yml b/tasks/collect_info.yml index 17e8fd4..f017e27 100644 --- a/tasks/collect_info.yml +++ b/tasks/collect_info.yml @@ -29,7 +29,7 @@ register: registration run_once: true - - name: Check currently registered runners for repo (RUN ONCE) + - name: "Check currently registered runners for repo {{ '(RUN ONCE)' if all_runners_in_same_repo else '' }}" ansible.builtin.uri: url: "{{ github_full_api_url }}" headers: @@ -42,7 +42,7 @@ status_code: 200 force_basic_auth: true register: registered_runners - run_once: true + run_once: "{{ all_runners_in_same_repo }}" - name: Get Runner User IDs ansible.builtin.command: id -u "{{ runner_user }}" From f08f20beb6a4170f77d27c3c5ee98a20b80d0ff3 Mon Sep 17 00:00:00 2001 From: Michal Muransky Date: Sat, 10 Aug 2024 20:12:38 +0200 Subject: [PATCH 2/2] docs: update --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 9285602..51fa1e3 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ It supports Enterprise, Organization and Repository Runners. ## Role Installation -Since Ansible Galaxy migrated to Galaxy-ng my galaxy account seems to be broken and RedHat/Galaxy support team just [deos not care](https://forum.ansible.com/t/please-fix-my-galaxy-namespace/5176). Please install this role directly fom GitHub. - **requirements.yml** ```yml roles: