Skip to content

Commit 6667614

Browse files
committed
Fix replacing default systemd file
1 parent 948ab4b commit 6667614

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

tasks/main.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,22 +177,20 @@
177177
mode: 0755
178178
when: not ansible_service_mgr == "systemd" and ansible_os_family == "Debian"
179179

180-
- name: extract systemd version
181-
shell: |
182-
set -o pipefail
183-
systemctl --version systemd | head -n 1 | cut -d' ' -f2
184-
args:
185-
executable: /bin/bash
186-
changed_when: false
187-
check_mode: false
188-
register: systemd_version
189-
when:
190-
- ansible_service_mgr == "systemd"
191-
- not ansible_os_family == "FreeBSD"
192-
- not ansible_os_family == "Solaris"
193-
tags: skip_ansible_lint
194-
195180
- block:
181+
- name: extract systemd version
182+
shell: |
183+
set -o pipefail
184+
systemctl --version systemd | head -n 1 | cut -d' ' -f2
185+
args:
186+
executable: /bin/bash
187+
changed_when: false
188+
check_mode: false
189+
register: systemd_version
190+
when:
191+
- not ansible_os_family == "FreeBSD"
192+
- not ansible_os_family == "Solaris"
193+
tags: skip_ansible_lint
196194
- name: systemd script
197195
template:
198196
src: "{{ nomad_systemd_template }}"
@@ -210,7 +208,11 @@
210208
name: nomad
211209
enabled: yes
212210
when: nomad_systemd_file.changed
213-
when: ansible_service_mgr == "systemd"
211+
212+
when:
213+
- ansible_service_mgr == "systemd"
214+
# Repo install includes systemd files
215+
- not nomad_install_from_repo
214216

215217
- name: Start Nomad
216218
service:

0 commit comments

Comments
 (0)