Created
September 7, 2014 09:30
-
-
Save txomon/a3afe985672358927406 to your computer and use it in GitHub Desktop.
Ansible user role for ssh authorized_keys management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
users: | |
- name: txomon | |
realname: Javier Domingo Cansino | |
uid: 10000 | |
ssh_keys: | |
- key: ssh-rsa <my-key> | |
groups: | |
- everyone | |
- sysadmin | |
- name: Test | |
realname: Test user | |
uid: 10001 | |
ssh_keys: | |
- key: user-key | |
groups: | |
- everyone | |
- development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Create the public ssh authorized_keys file | |
template: src=authorized_keys.j2 dest=/root/.ssh/authorized_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
user: root | |
vars: | |
- user_groups: | |
- sysadmin | |
roles: | |
- users | |
- hosts: others | |
user: root | |
vars: | |
- user_groups: | |
- development | |
roles: | |
- users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment