Prevent playbook abort if variables are not defined
- Skip task `Deploy sudo configurations` when `sudo_permissions` is not defined - Skip task `Deploy polkit configurations` when `polkit_rules` is not defined
This commit is contained in:
parent
91ab4d3511
commit
05844989eb
1 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,7 @@
|
||||||
{% for user, programs in sudo_permissions.items() %}
|
{% for user, programs in sudo_permissions.items() %}
|
||||||
{{ user }} ALL=(root) NOPASSWD: {% for program in programs %}{{ program }}{% if not loop.last %}, {% endif %}{% endfor %}
|
{{ user }} ALL=(root) NOPASSWD: {% for program in programs %}{{ program }}{% if not loop.last %}, {% endif %}{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
when: sudo_permissions is defined
|
||||||
|
|
||||||
- name: Deploy polkit configurations
|
- name: Deploy polkit configurations
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
@ -46,3 +47,4 @@
|
||||||
dest: /etc/polkit-1/rules.d/lmn-security.rules
|
dest: /etc/polkit-1/rules.d/lmn-security.rules
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
notify: Restart polkit
|
notify: Restart polkit
|
||||||
|
when: polkit_rules is defined
|
||||||
|
|
Loading…
Add table
Reference in a new issue