mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-15 05:52:24 +00:00
Merge pull request #390 from t-woerner/drop_python_2_3_test
ipa[server,replica,client]: Drop deactivated Python2/3 test
This commit is contained in:
@@ -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)
|
|
||||||
@@ -7,9 +7,6 @@
|
|||||||
state: present
|
state: present
|
||||||
when: ipaclient_install_packages | bool
|
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
|
- name: Install - Set ipaclient_servers
|
||||||
set_fact:
|
set_fact:
|
||||||
ipaclient_servers: "{{ groups['ipaservers'] | list }}"
|
ipaclient_servers: "{{ groups['ipaservers'] | list }}"
|
||||||
@@ -113,10 +110,6 @@
|
|||||||
fail: msg="Keytab or password is required for getting otp"
|
fail: msg="Keytab or password is required for getting otp"
|
||||||
when: ipaadmin_keytab is undefined and ipaadmin_password is undefined
|
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
|
- name: Install - Get One-Time Password for client enrollment
|
||||||
no_log: yes
|
no_log: yes
|
||||||
ipaclient_get_otp:
|
ipaclient_get_otp:
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
---
|
---
|
||||||
# tasks to uninstall IPA client
|
# 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
|
- name: Uninstall - Uninstall IPA client
|
||||||
command: >
|
command: >
|
||||||
/usr/sbin/ipa-client-install
|
/usr/sbin/ipa-client-install
|
||||||
|
|||||||
@@ -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)
|
|
||||||
@@ -52,9 +52,6 @@
|
|||||||
|
|
||||||
when: ipareplica_setup_firewalld | bool
|
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
|
- name: Install - Set ipareplica_servers
|
||||||
set_fact:
|
set_fact:
|
||||||
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
|
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
---
|
---
|
||||||
# tasks to uninstall IPA replica
|
# 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
|
- name: Uninstall - Uninstall IPA replica
|
||||||
command: >
|
command: >
|
||||||
/usr/sbin/ipa-server-install
|
/usr/sbin/ipa-server-install
|
||||||
|
|||||||
@@ -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)
|
|
||||||
@@ -51,9 +51,6 @@
|
|||||||
|
|
||||||
when: ipaserver_setup_firewalld | bool
|
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"
|
- include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml"
|
||||||
with_items: "{{ ipaserver_external_cert_files_from_controller }}"
|
with_items: "{{ ipaserver_external_cert_files_from_controller }}"
|
||||||
when: ipaserver_external_cert_files_from_controller is defined and
|
when: ipaserver_external_cert_files_from_controller is defined and
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
---
|
---
|
||||||
# tasks to uninstall IPA server
|
# 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
|
- name: Uninstall - Uninstall IPA server
|
||||||
command: >
|
command: >
|
||||||
/usr/sbin/ipa-server-install
|
/usr/sbin/ipa-server-install
|
||||||
|
|||||||
@@ -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
|
sed -i '1{/\/usr\/bin\/python*/d;}' $i
|
||||||
chmod a-x $i
|
chmod a-x $i
|
||||||
done
|
done
|
||||||
# Add execute flag to py3test.py scripts
|
|
||||||
chmod a+x roles/ipa*/files/py3test.py
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user