Ansible批量配置SSH公钥
Ansible 批量配置 ssh 公钥
---
- hosts: k8s
remote_user: root
tasks:
- name: Set authorized key taken from file
authorized_key:
user: root
state: present
key: "{{ lookup('file', item) }}"
with_items:
- "/root/.ssh/id_rsa.pub"
- "/root/id_rsa.pub"