ansible/playbooks/set_root_auth_keys.yml
Ryan Lerch 2cf38c1f17 [yaml-lint] fix yamllint errors and warnings on plabooks
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2024-11-25 19:04:25 +10:00

19 lines
582 B
YAML

# 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
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/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={{ item }}
with_lines:
- "{{ auth_keys_from_fas}} @sysadmin-main {{ root_auth_users }}"