Add matrix_services_autostart_enabled variable for preventing services autostart

Some people requested that `--tags=start` not set up service autostart.

One can now do `--tags=start --extra-vars="matrix_services_autostart_enabled=false"`
to just start services ones and not set up autostarting.
This commit is contained in:
Slavi Pantaleev 2020-11-30 20:58:21 +02:00
parent d64ad91c25
commit 90078dd296

View File

@ -1,5 +1,9 @@
---
- name: Deterimne whether we should make services autostart
set_fact:
matrix_services_autostart_enabled_bool: "{{ true if matrix_services_autostart_enabled|default('') == '' else matrix_services_autostart_enabled|bool }}"
- name: Ensure systemd is reloaded
service:
daemon_reload: yes
@ -14,7 +18,7 @@
- name: Ensure Matrix services are started
service:
name: "{{ item }}"
enabled: yes
enabled: "{{ matrix_services_autostart_enabled_bool }}"
state: started
with_items: "{{ matrix_systemd_services_list }}"
when: not ansible_check_mode