Answer the question
In order to leave comments, you need to log in
Ansible - how best to organize work with ssh keys?
What is the best way to organize work with ssh keys in Ansible?
Let's say I have 10 machines where I want to run playbooks from mine, local, and two laptops.
The start of the playbook looks like this:
- hosts: server
remote_user: test
become: yes
become_method: sudo
- name: Добавляю ssh-ключ
authorized_key: user=test key="{{ lookup('file', '/home/test/.ssh/id_rsa.pub') }}"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question