diff --git a/roles/ipaclient/files/py3test.py b/roles/ipaclient/files/py3test.py deleted file mode 100644 index 6bf70ab588b48d69a82b624dd1053eb130e963e3..0000000000000000000000000000000000000000 --- a/roles/ipaclient/files/py3test.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/python3 - -# Test ipaclient python3 binding -from ipaclient.install.client import SECURE_PATH # noqa: F401 - -# Check ipapython version to be >= 4.6 -from ipapython.version import NUM_VERSION, VERSION -if NUM_VERSION < 40600: - raise Exception("ipa %s not usable with python3" % VERSION) diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml index 97bf7949135f21a6444194f5bb9c6351f56d943a..fccc72e06d0865c5890a7ab47fdf6e5332989df0 100644 --- a/roles/ipaclient/tasks/install.yml +++ b/roles/ipaclient/tasks/install.yml @@ -7,9 +7,6 @@ state: present when: ipaclient_install_packages | bool -#- name: Install - Include Python2/3 import test -# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml" - - name: Install - Set ipaclient_servers set_fact: ipaclient_servers: "{{ groups['ipaservers'] | list }}" @@ -113,10 +110,6 @@ fail: msg="Keytab or password is required for getting otp" when: ipaadmin_keytab is undefined and ipaadmin_password is undefined - #- name: Install - Include Python2/3 import test - # import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml" - # delegate_to: "{{ result_ipaclient_test.servers[0] }}" - - name: Install - Get One-Time Password for client enrollment no_log: yes ipaclient_get_otp: diff --git a/roles/ipaclient/tasks/python_2_3_test.yml b/roles/ipaclient/tasks/python_2_3_test.yml deleted file mode 100644 index 511dea4604d9f92994952938bf1b16a81b3cf672..0000000000000000000000000000000000000000 --- a/roles/ipaclient/tasks/python_2_3_test.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- 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: Set python interpreter to 2 - set_fact: - ansible_python_interpreter: "/usr/bin/python2" - when: result_py3test.failed or result_py3test.rc != 0 diff --git a/roles/ipaclient/tasks/uninstall.yml b/roles/ipaclient/tasks/uninstall.yml index 095099a37f31608d62b599a1e3d0133be790fb43..90078542ef1db8deecf502455d265cd3118a349a 100644 --- a/roles/ipaclient/tasks/uninstall.yml +++ b/roles/ipaclient/tasks/uninstall.yml @@ -1,9 +1,6 @@ --- # tasks to uninstall IPA client -# - name: Uninstall - Include Python2/3 import test -# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml" - - name: Uninstall - Uninstall IPA client command: > /usr/sbin/ipa-client-install diff --git a/roles/ipareplica/files/py3test.py b/roles/ipareplica/files/py3test.py deleted file mode 100644 index ffb009cd498fc5d17f346d4a7db9eb4327663fb7..0000000000000000000000000000000000000000 --- a/roles/ipareplica/files/py3test.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python3 - -# Test ipaerver python3 binding -try: - from ipaserver.install.server.replicainstall import ( # noqa: F401 - install_check, - ) -except ImportError: - from ipaserver.install.server.replicainstall import ( # noqa: F401 - promote_check, - ) - -# Check ipapython version to be >= 4.6 -from ipapython.version import NUM_VERSION, VERSION -if NUM_VERSION < 40590: - raise Exception("ipa %s not usable with python3" % VERSION) diff --git a/roles/ipareplica/tasks/install.yml b/roles/ipareplica/tasks/install.yml index dbfc5f35652d42e62e6625e39898b5ca67a2f2cf..45af06a993c27ab8778160b3094c2292d8b5fa88 100644 --- a/roles/ipareplica/tasks/install.yml +++ b/roles/ipareplica/tasks/install.yml @@ -52,9 +52,6 @@ when: ipareplica_setup_firewalld | bool -#- name: Install - Include Python2/3 import test -# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml" - - name: Install - Set ipareplica_servers set_fact: ipareplica_servers: "{{ groups['ipaservers'] | list }}" diff --git a/roles/ipareplica/tasks/python_2_3_test.yml b/roles/ipareplica/tasks/python_2_3_test.yml deleted file mode 100644 index d407932bf0a004c013462532600a11639374a47f..0000000000000000000000000000000000000000 --- a/roles/ipareplica/tasks/python_2_3_test.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- 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 diff --git a/roles/ipareplica/tasks/uninstall.yml b/roles/ipareplica/tasks/uninstall.yml index 65068e6f3b05730b239bee2b6cb591128c9fb9c1..5df73e93bb6b0a00dc05773356992dc7628d0721 100644 --- a/roles/ipareplica/tasks/uninstall.yml +++ b/roles/ipareplica/tasks/uninstall.yml @@ -1,9 +1,6 @@ --- # tasks to uninstall IPA replica -# - name: Uninstall - Include Python2/3 import test -# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml" - - name: Uninstall - Uninstall IPA replica command: > /usr/sbin/ipa-server-install diff --git a/roles/ipaserver/files/py3test.py b/roles/ipaserver/files/py3test.py deleted file mode 100644 index 701e342409ec1f13d17b5dcc5b4a83eb8d9695ac..0000000000000000000000000000000000000000 --- a/roles/ipaserver/files/py3test.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/python3 - -# Test ipaerver python3 binding -from ipaserver.install.server.install import install_check # noqa: F401 - -# Check ipapython version to be >= 4.6 -from ipapython.version import NUM_VERSION, VERSION -if NUM_VERSION < 40590: - raise Exception("ipa %s not usable with python3" % VERSION) diff --git a/roles/ipaserver/tasks/install.yml b/roles/ipaserver/tasks/install.yml index 427cd5668eb1d43ea2426d9d40e4060f5a79e035..c1e3a95a7bd67122135e749c91a6174b49705008 100644 --- a/roles/ipaserver/tasks/install.yml +++ b/roles/ipaserver/tasks/install.yml @@ -51,9 +51,6 @@ when: ipaserver_setup_firewalld | bool -#- name: Install - Include Python2/3 import test -# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml" - - include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml" with_items: "{{ ipaserver_external_cert_files_from_controller }}" when: ipaserver_external_cert_files_from_controller is defined and diff --git a/roles/ipaserver/tasks/python_2_3_test.yml b/roles/ipaserver/tasks/python_2_3_test.yml deleted file mode 100644 index c8b2009a6fa90b790cbabd41943a8fa3e2416dd9..0000000000000000000000000000000000000000 --- a/roles/ipaserver/tasks/python_2_3_test.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- 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 diff --git a/roles/ipaserver/tasks/uninstall.yml b/roles/ipaserver/tasks/uninstall.yml index d018429f158cab2b664bd98b00e50fe3380d9dfd..71de9faf1fe331c8ceea3c4d3f2d0f98ec952f50 100644 --- a/roles/ipaserver/tasks/uninstall.yml +++ b/roles/ipaserver/tasks/uninstall.yml @@ -1,9 +1,6 @@ --- # tasks to uninstall IPA server -# - name: Uninstall - Include Python2/3 import test -# import: "{{ role_path }}/tasks/python_2_3_test.yml" - - name: Uninstall - Uninstall IPA server command: > /usr/sbin/ipa-server-install diff --git a/utils/ansible-freeipa.spec.in b/utils/ansible-freeipa.spec.in index 554059d52f656a82c518846c2e9aa9500fbe4164..2761f6dd6f0bb6978723f733e096c32a651edfb1 100644 --- a/utils/ansible-freeipa.spec.in +++ b/utils/ansible-freeipa.spec.in @@ -37,8 +37,6 @@ for i in roles/ipa*/library/*.py roles/ipa*/module_utils/*.py plugins/*/*.py; do sed -i '1{/\/usr\/bin\/python*/d;}' $i chmod a-x $i done -# Add execute flag to py3test.py scripts -chmod a+x roles/ipa*/files/py3test.py %build