Files
community.okd/molecule/default/roles/openshift_adm_groups/tasks/python-ldap-not-installed.yml
Mike Graves c2f1d722dc Update ldap image in tests (#274)
* Update ldap image in tests

The bitnami openldap image we had been using is no longer being support
by them. It has been moved over to a bitnamilegacy namespace, but it's
not clear how long that will remain. We should find a better solution at
some point.

* Update versions in Dockerfile

The dockerfile was built around python3.9 which forced the use of
ansible 2.15. This updates the base image to ubi10 which uses python3.12
by default. The version of the oc/kubectl client package was updated to
4.20 as well.

* Try and make it work

* Remove backslash

* debug

* try and force 3.12

* use ubi9

* debug

* try adding packaging

* debug

* Lots of changes

* Add check for none

* Fix python version
2026-03-23 14:01:08 +00:00

43 lines
975 B
YAML

---
- block:
- name: Create temp directory
tempfile:
state: directory
register: test_dir
- set_fact:
test_dir: "{{ test_dir.path }}"
- set_fact:
venv: "{{ test_dir }}/virtualenv"
- pip:
name:
- python-ldap
state: absent
- name: Load test configurations
set_fact:
configs: "{{ lookup('template', 'rfc2307/sync-config.j2') | from_yaml }}"
- name: Synchronize Groups without python-ldap
community.okd.openshift_adm_groups_sync:
config: "{{ configs.simple }}"
register: result
ignore_errors: true
- name: Check that module failed gracefully
assert:
that:
- '"Failed to import the required Python library (python-ldap)" in result.msg'
always:
- pip:
name:
- python-ldap
- name: Remove temp directory
file:
path: "{{ test_dir }}"
state: absent
ignore_errors: true