【发布时间】:2021-10-19 17:11:33
【问题描述】:
我需要使用转发代理选项。我在tf里
provisioner "local-exec" {
command = <<-EOT
cd ../systems/ac/ansible/
ansible-playbook playbooks/install/ac/playbooks/preinstall.yml --inventory=../../ansible/ansible-local-environment/inventory/${var.domain}/${var.system}.${var.domain}
我在哪里克隆了一个 git 存储库,但访问被拒绝。
当我在本地启动剧本时 - 存储库被正确克隆,因为密钥正确显示在 ssh-add -l 中
ssh-add -l
3072 SHA256:4RjItcuYK0WoCvSZsSmSDUsoYwuo+/M859066Y3d/E8 knex@local.ac.d (RSA)
3072 SHA256:gCZ+VTwFnOaLnYk9N+LNkDBzfcokQm4VG6+l/qzHxZg knex@Mac-knex.local (RSA)
我有正确的 ~/.ssh/config
Host *.ac.example.eu
User knex
ForwardAgent yes
IdentityFile ~/.ssh/id_rsa
我的 ansible.cfg
[defaults]
interpreter_python = auto_silent
transform_invalid_group_chars = always
deprecation_warnings = false
roles_path = ./ansible-roles
host_key_checking = False
sudo_flags=-HE
ANSIBLE_DEBUG=1
[ssh_connection]
ssh_args = -o ForwardAgent=yes -o StrictHostKeyChecking=no
pipelining=True
但是当我从 terraform 运行剧本时 - terraform ignore ssh-add -l 我明白了
"Could not open a connection to your authentication agent."
有没有办法解决这个问题?我必须转发这些密钥
当我自己启动剧本时 - 一切正常。
【问题讨论】:
标签: terraform