Skip to content

Commit b104313

Browse files
committed
use environment variable to pass in registration token
1 parent ed4b47a commit b104313

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
@@ -74,10 +74,10 @@
7474
- name: Register runner # noqa no-changed-when
7575
environment:
7676
RUNNER_ALLOW_RUNASROOT: "1"
77+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
7778
ansible.builtin.command:
7879
"{{ runner_dir }}/./config.sh \
7980
--url {{ github_full_url }} \
80-
--token {{ registration.json.token }} \
8181
--name '{{ runner_name }}' \
8282
--labels {{ runner_labels | join(',') }} \
8383
--runnergroup {{ runner_group }} \
@@ -113,10 +113,10 @@
113113
- name: Replace registered runner # noqa no-changed-when
114114
environment:
115115
RUNNER_ALLOW_RUNASROOT: "1"
116+
ACTIONS_RUNNER_INPUT_TOKEN: "{{ registration.json.token }}"
116117
ansible.builtin.command:
117118
"{{ runner_dir }}/config.sh \
118119
--url {{ github_full_url }} \
119-
--token {{ registration.json.token }} \
120120
--name '{{ runner_name }}' \
121121
--labels {{ runner_labels | join(',') }} \
122122
--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)