dotfiles/config/automatrop/roles/access/tasks/main.yml

24 lines
771 B
YAML
Raw Normal View History

2023-11-02 19:51:54 +01:00
---
2021-06-16 23:17:13 +02:00
- name: Set variables
2023-11-02 19:51:54 +01:00
ansible.builtin.set_fact:
2021-06-16 23:17:13 +02:00
manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}"
- name: Enable passwordless sudo access to wheel group (Others)
2023-11-02 19:51:54 +01:00
ansible.builtin.lineinfile:
2021-06-13 14:46:01 +02:00
path: /etc/sudoers
line: "%wheel ALL=(ALL) NOPASSWD: ALL"
regexp: "^#? *%wheel ALL=\\(ALL\\) NOPASSWD: ALL$"
2023-11-02 19:51:54 +01:00
become: true
2021-06-16 23:17:13 +02:00
when: not manjaro
2021-06-13 14:46:01 +02:00
2021-06-16 23:17:13 +02:00
- name: Enable passwordless sudo access to wheel group (Manjaro)
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
content: "%wheel ALL=(ALL) NOPASSWD: ALL"
2021-06-17 21:21:34 +02:00
dest: /etc/sudoers.d/11-wheel-nopasswd
2023-11-02 19:51:54 +01:00
mode: u=rwx,g=rx,o=
2021-06-16 23:17:13 +02:00
when: manjaro
2023-11-02 19:51:54 +01:00
become: true
2021-06-16 23:17:13 +02:00
# /etc/sudoers.d/10-installer is the same thing,
# but **with** a password, and it's overwritten
# with each upgrade of manjaro-system, hence this.