add sudoers
This commit is contained in:
parent
f59ad01087
commit
7e4be72128
@ -15,6 +15,7 @@
|
|||||||
- include_tasks: time.yml
|
- include_tasks: time.yml
|
||||||
- include_tasks: usergroup.yml
|
- include_tasks: usergroup.yml
|
||||||
- include_tasks: ssh.yml
|
- include_tasks: ssh.yml
|
||||||
|
- include_tasks: sudoers.yml
|
||||||
- include_tasks: pacman.yml
|
- include_tasks: pacman.yml
|
||||||
when: ansible_facts['os_family'] == "Archlinux"
|
when: ansible_facts['os_family'] == "Archlinux"
|
||||||
- include_tasks: firewalld.yml
|
- include_tasks: firewalld.yml
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
- name: set sudoers right
|
||||||
|
lineinfile:
|
||||||
|
dest: "/etc/sudoers.d/{{user.name}}"
|
||||||
|
regexp: "{{ item.regexp }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
state: "present"
|
||||||
|
create: True
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0440"
|
||||||
|
validate: 'visudo -cf "%s"'
|
||||||
|
with_items:
|
||||||
|
- regexp: '^{{user.name}}\s'
|
||||||
|
line: "{{user.name}} ALL = (ALL) NOPASSWD:ALL"
|
||||||
|
become: True
|
Loading…
Reference in New Issue
Block a user