diff --git a/linux-config-sudoers.yaml b/linux-config-sudoers.yaml new file mode 100644 index 0000000..8e672e5 --- /dev/null +++ b/linux-config-sudoers.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: '{{ ip_addr }}' + become: yes + become_method: sudo + gather_facts: yes + + tasks: + + - name: "[CONFIG SUDOERS] Config sudoers" + import_role: + name: config-sudoers \ No newline at end of file diff --git a/roles/config-sudoers/tasks/main.yaml b/roles/config-sudoers/tasks/main.yaml new file mode 100644 index 0000000..46ff331 --- /dev/null +++ b/roles/config-sudoers/tasks/main.yaml @@ -0,0 +1,15 @@ +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# configure sudo for sysadmin group +# paso1 - add sysadmin group to sudoers +- name: Add sysadmin group to sudoers + file: + path: /etc/sudoers.d/vn + state: touch + mode: u=rw,g=r,o=r +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# paso2 - add a line to /etc/sudoers.d/vn file +- name: add a line to /etc/sudoers.d/vn file + lineinfile: + path: "/etc/sudoers.d/vn" + line: "%sysadmin ALL=(ALL) NOPASSWD: ALL" +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++