Skip to content

Commit cdaec66

Browse files
Fix service name building
1 parent f78c7f1 commit cdaec66

File tree

7 files changed

+13
-15
lines changed

7 files changed

+13
-15
lines changed

handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# handlers file for ansible-github_actions_runner
2+
# handlers file for ansible-github_actions_runner (currently not used)
33
- name: Restart runner service
44
service:
55
name: "{{ runner_service }}"

molecule/org/cleanup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
become: yes
66
vars:
77
- runner_user: ansible
8-
- github_repo: ansible-github_actions_runner-testrepo
9-
- github_account: monolithprojects
8+
- github_account: monolithprojects-testorg
9+
- runner_org: yes
1010
- runner_state: absent
1111
roles:
1212
- ansible-github_actions_runner

molecule/org/verify.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
become: yes
77
vars:
88
- runner_user: ansible
9-
- github_repo: ansible-github_actions_runner-testrepo
10-
- github_account: monolithprojects
9+
- github_account: monolithprojects-testorg
10+
- runner_org: yes
1111
- github_api_url: "https://api.github.com"
1212
- access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
1313
- runner_name: "{{ ansible_hostname }}"
1414

1515
tasks:
1616
- name: Check currently registered runners
1717
uri:
18-
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
18+
url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners"
1919
headers:
2020
Authorization: "token {{ access_token }}"
2121
Accept: "application/vnd.github.v3+json"

molecule/repo/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
assert:
2929
that:
3030
- runner_name in registered_runners.json.runners|map(attribute='name')|list
31-
- registered_runners.json.runners|map(attribute='status') == ["online"]
31+
- registered_runners.json.runners|map(attribute='status') == ["offline"]
3232
quiet: true
3333

3434
- debug:

tasks/collect_info_org.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
- name: Build service name
3939
set_fact:
40-
runner_service: "actions.runner.{{ ([( github_owner | default(github_account))[:45], runner_name] | join('.'))[:65] }}.service"
40+
runner_service: "actions.runner.{{ ([( github_owner | default(github_account))[:45], runner_name] | join('.'))[:57] }}.service"
4141
when: service_name is not defined
4242
tags:
4343
- install

tasks/collect_info_repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
- name: Build service name
3939
set_fact:
40-
runner_service: "actions.runner.{{ ([([(github_owner | default(github_account)), github_repo ] | join('-'))[:45], runner_name] | join('.'))[:65] }}.service"
40+
runner_service: "actions.runner.{{ ([([(github_owner | default(github_account)), github_repo ] | join('-'))[:45], runner_name] | join('.'))[:57] }}.service"
4141
when: service_name is not defined
4242
tags:
4343
- install

tasks/install_runner.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
path: "{{ runner_pkg_tempdir }}"
4545
state: directory
4646
recurse: yes
47-
mode: '0777'
47+
mode: 0777
4848
run_once: yes
4949
delegate_to: localhost
5050
become: false
@@ -72,8 +72,6 @@
7272
owner: "{{ runner_user }}"
7373
mode: 0755
7474
when: runner_version not in runner_installed.stdout or reinstall_runner
75-
notify:
76-
- Restart runner service
7775
tags:
7876
- install
7977

@@ -133,7 +131,7 @@
133131
tags:
134132
- install
135133

136-
- name: Enable and START Github Actions Runner service
134+
- name: START and enable Github Actions Runner service
137135
systemd:
138136
name: "{{ runner_service }}"
139137
state: started
@@ -142,11 +140,11 @@
142140
tags:
143141
- install
144142

145-
- name: Enable and STOP Github Actions Runner service
143+
- name: STOP and disable Github Actions Runner service
146144
systemd:
147145
name: "{{ runner_service }}"
148146
state: stopped
149-
enabled: yes
147+
enabled: no
150148
when: runner_state|lower == "stopped"
151149
tags:
152150
- install

0 commit comments

Comments
 (0)