so i have this play to do some rpm package management. this involves removing the python package from the system. so i install some fallback python package which should be used while the sytem python is not available.
my play consists of three roles, the first two should use the system python and the third should use the fallback python. i have set the “ansible_python_interpreter” var in the third role but for unknown reasons this gest smeared over
to the first two roles, so i get “/usr/bin/ksh: /opt/bin/python: not found.” so how to set the “ansible_python_interpreter” var solely for one role?
the play:
`
root@lpgaixmgmtlx01:/etc/ansible/aix/roles/do_aixtoolbox_migration>cat …/…/deploy_aixtoolbox.yml
- name: deploy aixtoolbox
hosts: AIXTESTLPAR01
gather_facts: false
environment:
PATH: “/opt/bin:/opt/freeware/bin:{{ ansible_env.PATH }}”
SHELL: “/usr/bin/ksh”
LIBPATH: “/opt/lib:/usr/lib:/lib:/opt/freeware/lib”
roles:
- install_additional_python
- update_openssl_lpp
- do_aixtoolbox_migration
`
ansible_python_interpreter is set in role "do_aixtoolbox_migration" but also effects two two other roles.
root@lpgaixmgmtlx01:/etc/ansible/aix/roles/do_aixtoolbox_migration>cat vars/main.yml
ansible_shell_executable: “/usr/bin/ksh”
ansible_shell_interpreter: “/usr/bin/ksh”
ansible_python_interpreter: “/opt/bin/python”