我使用 GitHub 操作设置了部署管道,但遇到了 Ansible 似乎无法找到 python 解释器的问题。
作业的步骤如下。我设置了 informer_python 参数并尝试了“auto”以及“/usr/bin/python3”但无济于事。我也设置了 collections_path,因为这是 Windows 后配置步骤。
- name: Windows configuration via Ansible
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: ansible/windows/site.yml
# directory: ansible/windows/
configuration: |
[defaults]
callbacks_enabled = ansible.posix.profile_tasks, stdout_callback = yaml, interpreter_python = /usr/bin/python3, collections_path = ./collections/ansible_collections/
inventory: |
[all]
${{ steps.vmip.outputs.vmIp }}
vault_password: ${{secrets.VAULT_PASSWORD}}
options: |
-vvv
完整的回溯是:
At line:4 char:1
+ /usr/bin/python C:\Users\ansible_svc\AppData\Local\Temp\ansible-tmp-1 ...
+ ~~~~~~~~~~~~~~~
[WARNING]: No python interpreters found for host 10.188.218.55 (tried
['/usr/bin/python', 'python3.7', 'python3.6', 'python3.5', 'python2.7',
'python2.6', '/usr/libexec/platform-python', '/usr/bin/python3', 'python'])
fatal: [10.188.218.55]: FAILED! => ***
"ansible_facts": ***
"discovered_interpreter_python": "/usr/bin/python"
***,
"changed": false,
"msg": "The term '/usr/bin/python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
***
我正在使用一个自托管运行器池,并以 Ansible 和 Python 3.8.10 作为依赖项。一切都应该在那里。
各位有什么想法吗?
Привет возможно эта статья тебе поможет брат https://www.toptechskills.com/ansible-tutorials-courses/how-to-fix-usr-bin-python-not-found-error-tutorial/