how to define ssh private key for servers fetched by dynamic inventory in files

前端 未结 5 1169
小蘑菇
小蘑菇 2020-12-12 15:32

I met one configuration problem when coding ansible playbook for ssh private key file.

As we know, we can define combination with host server, ip & related ssh p

5条回答
  •  天命终不由人
    2020-12-12 16:13

    I'm using the following configuration:

    #site.yml:
    - name: Example play
      hosts: all
      remote_user: ansible
      become: yes
      become_method: sudo
      vars:
        ansible_ssh_private_key_file: "/home/ansible/.ssh/id_rsa"
    

提交回复
热议问题