mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
improve support for disabling units
This commit is contained in:
parent
bb7c07961f
commit
ac407bf2fc
1 changed files with 16 additions and 16 deletions
|
|
@ -5,18 +5,11 @@
|
|||
state: started
|
||||
when: run_on == "all" and user_unit is not defined
|
||||
|
||||
- name: Remove {{ unit }} from trusted unit list
|
||||
lineinfile:
|
||||
dest: /etc/nmtrust/trusted_units
|
||||
state: absent
|
||||
line: "{{ unit }}"
|
||||
when: run_on == "all" and user_unit is not defined
|
||||
|
||||
- name: Disable {{ unit }}
|
||||
systemd:
|
||||
name: "{{ unit }}"
|
||||
enabled: no
|
||||
when: run_on == "trusted" and user_unit is not defined
|
||||
when: run_on != "all" and user_unit is not defined
|
||||
|
||||
- name: Add {{ unit }} to trusted unit list
|
||||
lineinfile:
|
||||
|
|
@ -25,6 +18,13 @@
|
|||
line: "{{ unit }}"
|
||||
when: run_on == "trusted" and user_unit is not defined
|
||||
|
||||
- name: Remove {{ unit }} from trusted unit list
|
||||
lineinfile:
|
||||
dest: /etc/nmtrust/trusted_units
|
||||
state: absent
|
||||
line: "{{ unit }}"
|
||||
when: run_on != "trusted" and user_unit is not defined
|
||||
|
||||
- name: Enable and start {{ unit }} for user
|
||||
systemd:
|
||||
name: "{{ unit }}"
|
||||
|
|
@ -37,13 +37,6 @@
|
|||
XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}"
|
||||
when: run_on == "all" and user_unit is defined and user_unit == true
|
||||
|
||||
- name: Remove {{ unit }} for user from trusted unit list
|
||||
lineinfile:
|
||||
dest: /etc/nmtrust/trusted_units
|
||||
state: absent
|
||||
line: "{{ unit }},user:{{ user.name }}"
|
||||
when: run_on == "all" and user_unit is defined and user_unit == true
|
||||
|
||||
- name: Disable user {{ unit }} for user
|
||||
systemd:
|
||||
name: "{{ unit }}"
|
||||
|
|
@ -53,7 +46,7 @@
|
|||
become_user: "{{ user.name }}"
|
||||
environment:
|
||||
XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}"
|
||||
when: run_on == "trusted" and user_unit is defined and user_unit == true
|
||||
when: run_on != "all" and user_unit is defined and user_unit == true
|
||||
|
||||
- name: Add {{ unit }} for user to trusted unit list
|
||||
lineinfile:
|
||||
|
|
@ -61,3 +54,10 @@
|
|||
state: present
|
||||
line: "{{ unit }},user:{{ user.name }}"
|
||||
when: run_on == "trusted" and user_unit is defined and user_unit == true
|
||||
|
||||
- name: Remove {{ unit }} for user from trusted unit list
|
||||
lineinfile:
|
||||
dest: /etc/nmtrust/trusted_units
|
||||
state: absent
|
||||
line: "{{ unit }},user:{{ user.name }}"
|
||||
when: run_on != "trusted" and user_unit is defined and user_unit == true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue