Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Latest commit

 

History

History
18 lines (11 loc) · 670 Bytes

README.md

File metadata and controls

18 lines (11 loc) · 670 Bytes

Ansible Playbook

Purpose

Execute this play against a supported server, it will install dependencies, create an "ansible" user and group, then place the executing machine's SSH public key into the target's trusted keystore.


Execution

    
    ansible-playbook add_ansible_user.yml -u user -e user_to_create=ansible -e path_to_ssh_pub_key=/root/.ssh/id_rsa.pub -k -K -v

Notes

  • To maintain simplicity, this is really only meant to be run once. Though, it could easily be integrated into idempotent roles with some additional checks, such as the lineinfile to check for the user@server entry in the ssh key.