Skip to content

Commit 8b3e92b

Browse files
Merge pull request #214 from Yethal/different-repos-in-same-play
Allow different repos in same play
2 parents eea7313 + d8909a8 commit 8b3e92b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ runner_extra_config_args: ""
119119
# Name to assign to this runner in GitHub (System hostname as default)
120120
runner_name: "{{ ansible_facts.hostname }}"
121121

122+
# Set to false when provisioning runners for more than one repository within single play
123+
all_runners_in_same_repo: true
124+
122125
# GitHub Repository user or Organization owner used for Runner registration
123126
# github_account: "youruser"
124127

@@ -292,7 +295,7 @@ cd path/to/monolithprojects.github_actions_runner
292295
```bash
293296
export PERSONAL_ACCESS_TOKEN=your_github_pat # Your Personal Access Token to Github
294297
export GITHUB_ACCOUNT=your_account # Your Github Account
295-
export GITHUB_ACCOUNT=your_repository # Github Repository where you want to setup the Runner
298+
export GITHUB_REPO=your_repository # Github Repository where you want to setup the Runner
296299
```
297300

298301
3. Run Molecule:

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ runner_extra_config_args: ""
4848
# Name to assign to this runner in GitHub (System hostname as default)
4949
runner_name: "{{ ansible_facts.hostname }}"
5050

51+
# Set to false when provisioning runners for more than one repository within single play
52+
all_runners_in_same_repo: true
53+
5154
# GitHub Repository user or Organization owner used for Runner registration
5255
# github_account: "youruser"
5356

tasks/collect_info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
register: registration
3030
run_once: true
3131

32-
- name: Check currently registered runners for repo (RUN ONCE)
32+
- name: "Check currently registered runners for repo {{ '(RUN ONCE)' if all_runners_in_same_repo else '' }}"
3333
ansible.builtin.uri:
3434
url: "{{ github_full_api_url }}"
3535
headers:
@@ -42,7 +42,7 @@
4242
status_code: 200
4343
force_basic_auth: true
4444
register: registered_runners
45-
run_once: true
45+
run_once: "{{ all_runners_in_same_repo }}"
4646

4747
- name: Get Runner User IDs
4848
ansible.builtin.command: id -u "{{ runner_user }}"

0 commit comments

Comments
 (0)