Skip to content

Commit 31debf1

Browse files
Merge pull request #241 from gchappel/issue/240
use environment variable to pass in registration token
2 parents 70c7054 + b104313 commit 31debf1

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

tasks/install_runner_unix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
- name: Register runner # noqa no-changed-when
7878
environment:
7979
RUNNER_ALLOW_RUNASROOT: "1"
80+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
8081
ansible.builtin.command:
8182
"{{ runner_dir }}/./config.sh \
8283
--url {{ github_full_url }} \
83-
--token {{ registration.json.token }} \
8484
--name '{{ runner_name }}' \
8585
--labels {{ runner_labels | join(',') }} \
8686
--runnergroup {{ runner_group }} \
@@ -116,10 +116,10 @@
116116
- name: Replace registered runner # noqa no-changed-when
117117
environment:
118118
RUNNER_ALLOW_RUNASROOT: "1"
119+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
119120
ansible.builtin.command:
120121
"{{ runner_dir }}/config.sh \
121122
--url {{ github_full_url }} \
122-
--token {{ registration.json.token }} \
123123
--name '{{ runner_name }}' \
124124
--labels {{ runner_labels | join(',') }} \
125125
--unattended \

tasks/install_runner_win.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
- name: Register runner # noqa no-changed-when
6969
environment:
7070
RUNNER_ALLOW_RUNASROOT: "1"
71+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
7172
ansible.windows.win_command:
7273
"{{ runner_dir }}\\config.cmd \
7374
--url {{ github_full_url }} \
74-
--token {{ registration.json.token }} \
7575
--name {{ runner_name }} \
7676
--labels {{ runner_labels | join(',') }} \
7777
--runnergroup {{ runner_group }} \
@@ -92,10 +92,10 @@
9292
- name: Replace registered runner # noqa no-changed-when
9393
environment:
9494
RUNNER_ALLOW_RUNASROOT: "1"
95+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
9596
ansible.windows.win_command:
9697
"{{ runner_dir }}\\config.cmd \
9798
--url {{ github_full_url }} \
98-
--token {{ registration.json.token }} \
9999
--name {{ runner_name }} \
100100
--labels {{ runner_labels | join(',') }} \
101101
--runasservice \

tasks/uninstall_runner_unix.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
- name: Unregister runner from the GitHub # noqa no-changed-when
2121
environment:
2222
RUNNER_ALLOW_RUNASROOT: "1"
23-
ansible.builtin.command: "./config.sh remove --token {{ registration.json.token }} --name '{{ runner_name }}' --unattended"
23+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
24+
ansible.builtin.command: "./config.sh remove --name '{{ runner_name }}' --unattended"
2425
args:
2526
chdir: "{{ runner_dir }}"
2627
become: true

tasks/uninstall_runner_win.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
- name: Unregister runner from the GitHub
3232
environment:
3333
RUNNER_ALLOW_RUNASROOT: "1"
34-
ansible.windows.win_command: "config.cmd remove --token {{ registration.json.token }} --name {{ runner_name }} --unattended"
34+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
35+
ansible.windows.win_command: "config.cmd remove --name {{ runner_name }} --unattended"
3536
args:
3637
chdir: "{{ runner_dir }}"
3738
become: true

0 commit comments

Comments
 (0)