/ansible-playbook-bootstrap

Install Ansible dependencies, create SSH user, place SSH trusted key.

MIT LicenseMIT

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.