Remove role lmn_teacherlaptop and extend role lmn_security
- Add variable to configure sudo-program permissions (`sudo_permissions`) - Add variable to configure polkit-rules (`polkit_rules`) - Migrate sudo and polkit permissions from lmn_teacherlaptop role to inventory
This commit is contained in:
parent
c00d5566dd
commit
c4e35584bc
8 changed files with 506 additions and 485 deletions
|
@ -28,3 +28,21 @@
|
|||
PasswordAuthentication no
|
||||
AllowUsers ansible
|
||||
notify: Reload sshd
|
||||
|
||||
- name: Deploy sudo configurations
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/sudoers.d/90-lmn-security
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0700'
|
||||
content: |
|
||||
{% for user, programs in sudo_permissions.items() %}
|
||||
{{ user }} ALL=(root) NOPASSWD: {% for program in programs %}{{ program }}{% if not loop.last %}, {% endif %}{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
- name: Deploy polkit configurations
|
||||
ansible.builtin.template:
|
||||
src: polkit_rules.j2
|
||||
dest: /etc/polkit-1/rules.d/lmn-security.rules
|
||||
mode: '0644'
|
||||
notify: Restart polkit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue