Make sudo role work on macOS
This commit is contained in:
parent
2abc38f696
commit
baa0206937
@ -2,11 +2,13 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that: ansible_user_id != "root"
|
that: ansible_user_id != "root"
|
||||||
|
|
||||||
|
- include_vars: '{{ansible_os_family}}.yaml'
|
||||||
|
|
||||||
- name: create /etc/sudoers.d/{user} config file
|
- name: create /etc/sudoers.d/{user} config file
|
||||||
become: true
|
become: true
|
||||||
template:
|
template:
|
||||||
src: sudoers
|
src: sudoers
|
||||||
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
||||||
owner: root
|
owner: '{{sudo_owner}}'
|
||||||
group: root
|
group: '{{sudo_group}}'
|
||||||
mode: '0440'
|
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