Skip to content

Commit

Permalink
Allow different repos in same play
Browse files Browse the repository at this point in the history
  • Loading branch information
Yethal committed Aug 7, 2024
1 parent eea7313 commit d8909a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions tasks/collect_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}"
Expand Down

0 comments on commit d8909a8

Please sign in to comment.