grandfathermagic

verify_cloud_user.yml

Jun 27th, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. #verify that  user  cloud_user is in the sudoers list - CHANGE THE FILE NAME TO verify_cloud_user.yml
  3. # Run with ansible user the commend:  ansible-playbook verify_cloud_user.yml  --check -b
  4.  
  5.  
  6. - hosts: all
  7. #  remote_user: root
  8. #  become: no
  9.  
  10.   tasks:
  11.    - name: Allow cloud_user user to have passwordless sudo
  12.      lineinfile:
  13.        dest: /etc/sudoers.d/cloud_user
  14.        state: present
  15.        regexp: '^%cloud_user'
  16.        line: '%cloud_user ALL=(ALL) NOPASSWD: ALL'
  17.        validate: /usr/sbin/visudo -cf %s
Add Comment
Please, Sign In to add comment