Make sudo role work on macOS
This commit is contained in:
parent
2abc38f696
commit
baa0206937
@ -2,11 +2,13 @@
|
||||
- assert:
|
||||
that: ansible_user_id != "root"
|
||||
|
||||
- include_vars: '{{ansible_os_family}}.yaml'
|
||||
|
||||
- name: create /etc/sudoers.d/{user} config file
|
||||
become: true
|
||||
template:
|
||||
src: sudoers
|
||||
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
||||
owner: root
|
||||
group: root
|
||||
owner: '{{sudo_owner}}'
|
||||
group: '{{sudo_group}}'
|
||||
mode: '0440'
|
||||
|
3
roles/sudo/vars/Darwin.yaml
Normal file
3
roles/sudo/vars/Darwin.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
sudo_owner: root
|
||||
sudo_group: wheel
|
3
roles/sudo/vars/Debian.yaml
Normal file
3
roles/sudo/vars/Debian.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
sudo_owner: root
|
||||
sudo_group: root
|
Loading…
x
Reference in New Issue
Block a user