mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 02:35:54 +00:00
python_2_3_test needs to be executed also in test mode to make sure that the follwing ipa[server,replica,client]_test modules could be executed also in test mode.
22 lines
655 B
YAML
22 lines
655 B
YAML
- block:
|
|
- name: Verify Python3 import
|
|
script: py3test.py
|
|
register: result_py3test
|
|
failed_when: False
|
|
changed_when: False
|
|
check_mode: no
|
|
|
|
- name: Set python interpreter to 3
|
|
set_fact:
|
|
ansible_python_interpreter: "/usr/bin/python3"
|
|
when: result_py3test.rc == 0
|
|
|
|
- name: Fail for IPA 4.5.90
|
|
fail: msg="You need to install python2 bindings for ipa server usage"
|
|
when: result_py3test.rc != 0 and "not usable with python3" in result_py3test.stdout
|
|
|
|
- name: Set python interpreter to 2
|
|
set_fact:
|
|
ansible_python_interpreter: "/usr/bin/python2"
|
|
when: result_py3test.failed or result_py3test.rc != 0
|