Create a user for ansible, and lock down access to the root user.
None.
The following are the variables used by the role and their defaults.
admin_user: ansible
admin_user_shell: /bin/bashadmin_user_public_keys:
- ~/.ssh/id_rsa.pubIt is crucial that a valid SSH key be added for the user since that is the only way to login as the user.
None.
Running the role is fairly straightforward. The only issue is that if access to the root user has already been disabled, the role might fail to connect if run again.
- hosts: all
remote_user: root
roles:
- { role: cdriehuys.lock-root, admin_user: ansible }
MIT
Chathan Driehuys (cdriehuys@gmail.com)