Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 976 Bytes

README-users.md

File metadata and controls

32 lines (26 loc) · 976 Bytes

Giving ssh access to a machine

For servers WITH a file in host_vars/

ansible-playbook -e "HOSTS=<servername>" users.yml

For servers without a file in host_vars/

ansible-playbook -e "HOSTS=<servername>" -e '{"users":{"<labitat username>":"sudo"}}' users.yml

Revoking access to a machine

WARNING: This will delete all users that aren't explicitly named in host_vars. Try with --check before committing!

  • Remove user from host_vars/servername
  • Run a check command to which users get deleted:
ansible-playbook --check -e "remove_users=true" -e "HOSTS=<servername>" users.yml
  • Run the real deletion command:
ansible-playbook -e "remove_users=true" -e "HOSTS=<servername>" users.yml