Skip to content

Commit 6090eef

Browse files
committed
added conditionals for tmpfiles and daemon-reload
1 parent a60d045 commit 6090eef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tasks/setup/systemd.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
- minecraft.socket
1515
notify:
1616
- restart Minecraft
17+
register: systemd_service_config
1718

1819
- name: reload systemd
1920
command: systemctl daemon-reload
2021
become: true
22+
when: systemd_service_config.changed
2123

2224
- name: configure console directory
2325
template:
@@ -27,6 +29,12 @@
2729
group: root
2830
mode: '0644'
2931

32+
- name: check if tmpfile exists
33+
stat:
34+
path: /etc/tmpfiles.d/{{ minecraft_service_name }}.conf
35+
register: minecraft_tmpfile
36+
3037
- name: create console directory
3138
command: systemd-tmpfiles --create /etc/tmpfiles.d/{{ minecraft_service_name }}.conf
3239
become: true
40+
when: minecraft_tmpfile.stat.islnk

0 commit comments

Comments
 (0)