Skip to content

Commit fbd8a0f

Browse files
Fix idempotence
1 parent 9d5191d commit fbd8a0f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tasks/install_runner.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
file:
44
path: "{{ runner_dir }}"
55
state: directory
6-
mode: "0755"
6+
mode: 0755
77
owner: "{{ runner_user }}"
8-
group: "{{ runner_user }}"
9-
recurse: yes
8+
# group: "{{ runner_user }}"
109
tags:
1110
- install
1211

tasks/uninstall_runner.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: "{{ runner_service }}"
55
state: stopped
66
enabled: no
7-
when: runner_service in services
7+
when: runner_service in services and ( reinstall_runner or runner_state == "stopped" or runner_state == "absent" )
88
tags:
99
- uninstall
1010

@@ -43,7 +43,7 @@
4343
become: yes
4444
become_user: "{{ runner_user }}"
4545
no_log: "{{ hide_sensitive_logs | bool }}"
46-
when: ansible_hostname in registered_runners.json.runners|map(attribute='name')|list and runner_file.stat.exists
46+
when: runner_name in registered_runners.json.runners|map(attribute='name')|list and runner_file.stat.exists
4747
tags:
4848
- uninstall
4949

0 commit comments

Comments
 (0)