Fix Sudo On OpenSUSE (#39)

This commit is contained in:
Hyperling 2023-06-25 13:18:44 -07:00 committed by GitHub
parent a6e73b4f4b
commit f8b791bbd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@
set_fact:
rc_conf: /dev/null
sudoers_install_dir: /etc/sudoers.d/
sudoers_config: /etc/sudoers
shutdown_command: sudo shutdown -h now
when: ansible_system == "Linux"

View File

@ -16,3 +16,18 @@
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'}