commited current state
This commit is contained in:
@@ -6,10 +6,20 @@
|
||||
shell: /bin/bash
|
||||
createhome: yes
|
||||
state: present
|
||||
password: "{{ admin_password }}"
|
||||
password_lock: no
|
||||
|
||||
- name: Create sudoers.d directory if not exists
|
||||
file:
|
||||
path: /etc/sudoers.d
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Set sudo privileges for admin user
|
||||
lineinfile:
|
||||
path: /etc/sudoers.d/10-admin
|
||||
line: "admin ALL=(ALL) NOPASSWD:ALL"
|
||||
validate: 'visudo -cf %s'
|
||||
state: present
|
||||
template:
|
||||
src: sudoers-admin.j2
|
||||
dest: /etc/sudoers.d/10-admin
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0440'
|
||||
validate: 'visudo -cf %s'
|
||||
Reference in New Issue
Block a user