2023-06-25 13:18:44 -07:00

34 lines
1.1 KiB
YAML

---
# Ensure the proper users have sudo access.
- name: General | Account Management | Sudo | Copy Ansible
copy:
src: sudo/sudoers_ansible
dest: "{{ sudoers_install_dir }}"
owner: root
group: "{{ root_group }}"
mode: 0440
- name: General | Account Management | Sudo | Copy Sudo Group
copy:
src: sudo/sudoers_sudo
dest: "{{ sudoers_install_dir }}"
owner: root
group: "{{ root_group }}"
mode: 0440
# Disable these two lines in openSUSE default configuration.
#Defaults targetpw # ask for the password of the target user i.e. root
#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
- name: General | Account Management | Sudo | Disable openSUSE Root PW Prompt
lineinfile:
path: "{{ sudoers_config }}"
regexp: '{{ item.key }}'
line: '{{ item.value }} # MANAGED BY ANSIBLE'
state: present
create: yes
backup: yes
loop:
- { "key": '^[\#]?Defaults targetpw', "value": '#Defaults targetpw'}
- { "key": '^[\#]?ALL ALL\=\(ALL\) ALL', "value": '#ALL ALL=(ALL) ALL'}