-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
49 lines (44 loc) · 2 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
- name: Configure Servers as github Runners
hosts: myrunners
tasks:
- name: copy ssh key for test purposes
command: ssh-import-id-gh MichaelKora
- name: Create a folder
command: mkdir -p actions-runner
- name: Download the latest runner package
command: curl -o actions-runner/actions-runner-linux-x64-2.288.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.288.1/actions-runner-linux-x64-2.288.1.tar.gz
- name: Validate the hash
command: echo "325b89bdc1c67264ec6f4515afda4534f14a6477d9ba241da19c43f9bed2f5a6 actions-runner/actions-runner-linux-x64-2.288.1.tar.gz" | shasum -a 256 -c
- name: Extract the installer
command: tar xzf actions-runner/actions-runner-linux-x64-2.288.1.tar.gz -C actions-runner/
- name: Activate and test the first runner
hosts: runner-1
tasks:
- name: Configure and start the runner1
shell: |
cd actions-runner/
./config.sh --url https://github.com/MichaelKora/self-hosted-runners --token ATILRBR3VFPL44RPMBGCO4LCFIECK --labels linux,x64,runner1 --name myrunner1 --unattended --ephemeral
- name: Activate and test the second runner
hosts: runner-2
tasks:
- name: Configure and start the runner2
shell: |
cd ./actions-runner
./config.sh --url https://github.com/MichaelKora/self-hosted-runners --token ATILRBR3VFPL44RPMBGCO4LCFIECK --labels linux,x64,runner2 --name myrunner2 --unattended --ephemeral
- name: Activate and test the the runner3
hosts: runner-3
tasks:
- name: Configure and start the runner3
shell: |
cd ./actions-runner
./config.sh --url https://github.com/MichaelKora/self-hosted-runners --token ATILRBR3VFPL44RPMBGCO4LCFIECK --labels linux,x64,runner3 --name myrunner3 --unattended --ephemeral
- name: Configure with svc.sh
hosts: myrunners
become: yes
become_user: ubuntu
tasks:
- name: ./svc.sh install && ./svc.sh start
shell: |
cd ./actions-runner
sudo ./svc.sh install
sudo ./svc.sh start