Using ssh agent forwarding with salt states

So, I have the following in my wandering file:

config.ssh.forward_agent = true

And the following state of salt:

git+ssh://git@bitbucket.org/xxx/repo.git:
  git.latest:
    - rev: rest
    - target: /home/vagrant/src

However, I get a public key message when this salt state is executed.

It is annoying that if I manually execute git clone git+ssh://git@bitbucket.org/xxx/repo.gitfrom my instance, everything works fine. Any ideas?

+4
source share
2 answers

Is bitbucket.org in the known_hosts file?

git+ssh://git@bitbucket.org/xxx/repo.git:
  git.latest:
    - rev: rest
    - target: /home/vagrant/src
    - require:
      - ssh_known_hosts: bitbucket.org
0
source

I had a similar requirement with capistrano. I used ssh-forwardingto check repo from github to a remote server. I had to add the host to a file ~/.ssh/configon my computer as shown below.

vim ~/.ssh/config

Content

Host <some host or IP>
   ForwardAgent yes

* , .

0

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


All Articles