Package installation freezes when installing a private gem through an available playbook

I am trying to run bundle installon a remote host that uses gem from a private repo. The task freezes because it stops accepting the host key, since I cannot manually accept the key on the remote host when I run the available downloadable book locally.

Task in the book book

  - name: bundle install
    command: bundle install chdir={{ deploy_directory }}

How to check or add a github connection through a key file present on the remote host.

I also tried to explicitly accept the key before installing the package by establishing a test connection to github via ssh.

  - name: test connection to git
    command: ssh -vvv git@github.co key_file=/home/ubuntu/.ssh/id_rsa accept_hostkey=yes

Now this command also freezes.

+4
source share
2

@Ankit_Kukarni, github.com known_hosts , , .

  - name: ensure github.com is a known host
    sudo: yes
    lineinfile:
      dest: /home/ubuntu/.ssh/known_hosts
      create: yes
      state: present
      line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
      regexp: "^github\\.com"

0

export ANSIBLE_HOST_KEY_CHECKING=False . , .

environment:
    ANSIBLE_HOST_KEY_CHECKING:  False

, , - ssh-. - StrictHostKeyChecking=no UserKnownHostsFile=/dev/null. ssh ansible_ssh_common_args ansible_ssh_extra_args

+1

Source: https://habr.com/ru/post/1614355/


All Articles