के रूप में आप देख सकते हैं से कोड स्निपेट के नीचे, ansible के निष्पादन हो रहा है की अनदेखी ansible_python_interpreter चर. सहारा के बिना एक सूची के लिए फ़ाइल (यह है के लिए एक gitlab पाइप लाइन के आधार पर hashicorp के पैकर - जो कॉल ansible), कैसे कर सकता है मैं लागू ansible का उपयोग करने के लिए जो कुछ भी अजगर संस्करण मैं? इस मामले में, यह एक Ubuntu 18.04, तो मैं चाहता हूँ से स्विच करने के लिए अजगर 2.7 के लिए अजगर-3.6.
एक और संबंधित के कारण couldto हो सकता है तथ्य यह है कि ansibles pkg (नीति?) हमेशा स्थापित अजगर-2.7 पर बायोनिक.
root@ubuntu18:~# ansible --version
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]
root@ubuntu18:~# /usr/bin/python3.6 --version
Python 3.6.9
root@ubuntu18:~# ansible --version -e 'ansible_python_interpreter=/usr/bin/python3.6'
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]
root@ubuntu18:~#
मेरी अंतिम उपाय करने के लिए लगता है हो सकता है स्थापित करने ansible का उपयोग कर pip3, लेकिन की आवश्यकता होगी कि एक महत्वपूर्ण फिर से लिखना दोनों की पाइप लाइन yaml और पैकर की json.
किसी भी मदद की बहुत सराहना की जाएगी.
चियर्स