Files
ansible-freeipa/roles/ipaclient/tasks/python_2_3_test.yml
Kellin 75cd130d4a Capturing python3 check result is not a change
- Do not register a change in the playbook run when registering the
  variable checking for whether or not Python 3 imports work

Signed-off-by: Kellin <kellin@retromud.org>
2018-04-10 21:01:13 -04:00

17 lines
415 B
YAML

- block:
- name: Verify Python3 import
script: py3test.py
register: py3test
failed_when: False
changed_when: False
- name: Set python interpreter to 3
set_fact:
ansible_python_interpreter: "/usr/bin/python3"
when: py3test.rc == 0
- name: Set python interpreter to 2
set_fact:
ansible_python_interpreter: "/usr/bin/python2"
when: py3test.failed or py3test.rc != 0