You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
653 B

- hosts: prgmr
tasks:
- name: setup sudo
apt: pkg=sudo state=latest
- name: add users to sudo group
user: name={{ item }} append=yes groups=sudo state=present
with_items:
- alpha
- name: copy sudoers file
command: cp -f /etc/sudoers /tmp/sudoers
- name: backup sudoers file
command: cp -f /tmp/sudoers /tmp/sudoers.bak
- name: don't require a password for sudo group in /tmp/sudoers
lineinfile: "dest=/tmp/sudoers state=present regexp='^%sudo' line='%sudo ALL=(ALL:ALL) NOPASSWD: ALL'"
- name: check /tmp/sudoers and update /etc/sudoers
shell: visudo -qcf /tmp/sudoers && cp -f /tmp/sudoers /etc/sudoers