Debian Codegraph @

ansible_collections/community/okd/molecule/default/roles/openshift_adm_groups/tasks/python-ldap-not-installed.yml

raw
1 ---
2 - block:
3 - name: Create temp directory
4 tempfile:
5 state: directory
6 register: test_dir
7
8 - set_fact:
9 test_dir: "{{ test_dir.path }}"
10
11 - set_fact:
12 venv: "{{ test_dir }}/virtualenv"
13
14 - pip:
15 name:
16 - kubernetes
17 virtualenv: "{{ venv }}"
18 virtualenv_command: "{{ virtualenv_command }}"
19 virtualenv_site_packages: false
20
21 - name: Load test configurations
22 set_fact:
23 configs: "{{ lookup('template', 'rfc2307/sync-config.j2') | from_yaml }}"
24
25 - name: Synchronize Groups without python-ldap
26 community.okd.openshift_adm_groups_sync:
27 config: "{{ configs.simple }}"
28 register: result
29 ignore_errors: true
30 vars:
31 ansible_python_interpreter: "{{ venv }}/bin/python"
32
33 - name: Check that module failed gracefully
34 assert:
35 that:
36 - '"Failed to import the required Python library (python-ldap)" in result.msg'
37
38 always:
39 - name: Remove temp directory
40 file:
41 path: "{{ test_dir }}"
42 state: absent
43 ignore_errors: true