Skip to content

Commit bd36f31

Browse files
fix: darwin svc start
1 parent 3d83651 commit bd36f31

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tasks/install_runner.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,22 @@
106106
src: "{{ runner_dir }}/.service"
107107
register: runner_service
108108

109-
- name: START and enable Github Actions Runner service # DOTO: Idempotence works only for Systemd. Need to fix for launchd.
109+
- name: START and enable Github Actions Runner service (Linux)
110110
ansible.builtin.command: "./svc.sh start"
111111
args:
112112
chdir: "{{ runner_dir }}"
113-
become: "{{ 'false' if ansible_system == 'Darwin' else 'true' }}"
114113
no_log: "{{ hide_sensitive_logs | bool }}"
115114
ignore_errors: "{{ ansible_check_mode }}"
116-
when: runner_state|lower == "started" and ansible_facts.services[(runner_service.content | b64decode) | trim ]['state'] != 'running'
115+
when: ansible_system != 'Darwin' and runner_state|lower == "started" and ansible_facts.services[(runner_service.content | b64decode) | trim ]['state'] != 'running'
116+
117+
- name: START and enable Github Actions Runner service (macOS) # TODO: Idempotence
118+
ansible.builtin.command: "./svc.sh start"
119+
args:
120+
chdir: "{{ runner_dir }}"
121+
become: false
122+
no_log: "{{ hide_sensitive_logs | bool }}"
123+
ignore_errors: "{{ ansible_check_mode }}"
124+
when: ansible_system == 'Darwin' and runner_state|lower
117125

118126
- name: STOP and disable Github Actions Runner service
119127
ansible.builtin.shell: "./svc.sh stop"

0 commit comments

Comments
 (0)