Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Ansible playbook to set passwordless sudo


- name: Make sure we have a 'wheel' group
  group:
    name: wheel
    state: present

- name: Allow 'wheel' group to have passwordless sudo
  lineinfile:
    dest: /etc/sudoers
    state: present
    regexp: '^%wheel'
    line: '%wheel ALL=(ALL) NOPASSWD: ALL'
    validate: 'visudo -cf %s'

- name: Add sudoers users to wheel group
  user:
    name=deployer
    groups=wheel
    append=yes
    state=present
    createhome=yes

- name: Set up authorized keys for the deployer user
  authorized_key: user=deployer key="{{item}}"
  with_file:
    - /home/railsdev/.ssh/id_rsa.pub

Comment

Ansible playbook to set passwordless sudo

---
- hosts: all
  tasks:
    - lineinfile:
        path: /etc/sudoers
        state: present
        regexp: '^%sudo'
        line: '%sudo ALL=(ALL) NOPASSWD: ALL'
        validate: 'visudo -cf %s'
Comment

PREVIOUS NEXT
Code Example
Shell :: find ubuntu usb port tty 
Shell :: how to customize zsh 
Shell :: open folder in terminal mac 
Shell :: openstack show ports 
Shell :: share folder on network linux 
Shell :: script delete files older than 
Shell :: zsh terminal 
Shell :: kali linux nit signing in 
Shell :: linux screenshot shortcut 
Shell :: cmd to find find file 
Shell :: how to scan for raspberry pi on network windows 
Shell :: how to commit files in github 
Shell :: how to get the digit count of number swift 
Shell :: how to make maven clean install faster in eclipse 
Shell :: how to move git clone to another git repo 
Shell :: powershell import-certificate trusted publisher 
Shell :: git pull rebase command 
Shell :: how to pass docker hub credentials for k8s pods 
Shell :: apache airflow 
Shell :: how to get the filename without extension 
Shell :: ffmpeg change audio codec from m4a to mp3 
Shell :: install moment.js 
Shell :: debian list packages automatic install 
Shell :: Pulling a branch 
Shell :: folder open in command line 
Shell :: remove .idea from git 
Shell :: ghost in the shell full movie 
Shell :: yum install redis cli 
Shell :: uninstall all pip packages anaconda 
Shell :: github rust action 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =