Skip to content

Commit 3fa810a

Browse files
author
James Timms
committed
Adding options for setting labels with default of no labels
Setting labels via ./config.sh --labels with default of ''
1 parent f93472f commit 3fa810a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ runner_org: no
3535
# Name to assign to this runner in GitHub (System hostname as default)
3636
runner_name: "{{ ansible_hostname }}"
3737

38+
# Labels to apply to the runner
39+
runner_labels: ''
40+
3841
# Custom service name when usign Github Enterprise server
3942
# service_name: actions.runner._services.{{ runner_name }}.service
4043

tasks/install_runner.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
- name: Register runner (if new installation) for repo
8282
command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \
83-
--token {{ registration.json.token }} --name {{ runner_name }} --unattended"
83+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels }} --unattended"
8484
args:
8585
chdir: "{{ runner_dir }}"
8686
become: yes
@@ -92,7 +92,7 @@
9292

9393
- name: Register runner (if new installation) for organization
9494
command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }} \
95-
--token {{ registration.json.token }} --name {{ runner_name }} --unattended"
95+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels }} --unattended"
9696
args:
9797
chdir: "{{ runner_dir }}"
9898
become: yes
@@ -104,7 +104,7 @@
104104

105105
- name: Replace registered runner for repo
106106
command: "{{ runner_dir }}/config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \
107-
--token {{ registration.json.token }} --name {{ runner_name }} --unattended --replace"
107+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels }} --unattended --replace"
108108
args:
109109
chdir: "{{ runner_dir }}"
110110
become: yes
@@ -116,7 +116,7 @@
116116

117117
- name: Replace registered runner for organization
118118
command: "{{ runner_dir }}/config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }} \
119-
--token {{ registration.json.token }} --name {{ runner_name }} --unattended --replace"
119+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels }} --unattended --replace"
120120
args:
121121
chdir: "{{ runner_dir }}"
122122
become: yes

0 commit comments

Comments
 (0)