add playbook for setting auth keys easily on transient instances
This commit is contained in:
parent
b66d5dbe75
commit
c1a4d9889a
1 changed files with 18 additions and 0 deletions
18
playbooks/set_root_auth_keys.yml
Normal file
18
playbooks/set_root_auth_keys.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
# optionally can take --extra-vars="hostbase=hostnamebase root_auth_users='user1 user2 user3'"
|
||||
- name: set auth keys
|
||||
hosts: $target
|
||||
user: root
|
||||
gather_facts: False
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- ${private}/vars.yml
|
||||
- ${vars}/${ansible_distribution}.yml
|
||||
vars:
|
||||
- root_auth_users: ''
|
||||
|
||||
tasks:
|
||||
- name: add root keys for sysadmin-main and other allowed users
|
||||
action: authorized_key user=root key='$PIPE(${auth_keys_from_fas} @sysadmin-main ${root_auth_users})'
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue