Kaptain.
Telegram /
LinkedIn /
Email /
GIT /
RSS /
GPG /
Заказ печатных плат

№ 9442 В разделе
Sysadmin
от September 28th, 2018,
В подшивках: Ansible
Most of Ansible plugins requires Python 2 installed but modern Linux OS doesn’t have it. I created separated from other playbook task to install python 2 but temporarily changed interpreter with ansible_python_interpreter: /usr/bin/python3. After this you can start other tasks as usual.
Playbook project.yml:
- name: Checkout python2
hosts: project
vars:
ansible_python_interpreter: /usr/bin/python3
roles:
- python2
- name: Configure platform
hosts: project
roles:
- system
Sample code https://git.blindage.org/21h/ansible-library/src/branch/python3_trick
Fortune cookie: Xerox your lunch and file it under "sex offenders"!
Leave a Reply