Como posso obter o Ansible para preencher o arquivo correto quando meu /etc/ssh/sshd_config tem AuthorizedKeysFile definido como /etc/ssh/authorized_keys/%u ? O Ansible parece ignorar a configuração e coloca as chaves em $HOME/.ssh/authorized_keys
cartilha :
---
- hosts: all
vars:
vars_files:
- ../group_vars/ssh_root_authorized_keys.yml
gather_facts: false
tasks:
- name: Set up multiple authorized keys
authorized_key:
user: root
state: present
key: '{{ item.key }}'
with_items: "{{ root_auth_keys }}"
ssh_root_authorized_keys.yml
root_auth_keys:
- name: backup@host
key : "{{ lookup('file', '../group_vars/pubkeys/[email protected]') }}"
- name: nagios@host
key : "{{ lookup('file', '../group_vars/pubkeys/[email protected]') }}"