mirror of
https://github.com/openshift/community.okd.git
synced 2026-03-27 03:13:08 +00:00
* Initialize OpenshiftGroupsSync attributes early The fail_json() method calls close_connection(), but this can fail when the python-ldap library is not installed as close_connection() gets called before the __ldap_connection attribute has been defined. * Use already defined virtualenv_command * Fix tests * Add changelog fragment
63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
---
|
|
- name: Get cluster information
|
|
kubernetes.core.k8s_cluster_info:
|
|
register: info
|
|
|
|
- name: Create LDAP Pod
|
|
community.okd.k8s:
|
|
namespace: "default"
|
|
wait: yes
|
|
definition:
|
|
kind: Pod
|
|
apiVersion: v1
|
|
metadata:
|
|
name: ldap-pod
|
|
labels:
|
|
app: ldap
|
|
spec:
|
|
containers:
|
|
- name: ldap
|
|
image: bitnami/openldap
|
|
env:
|
|
- name: LDAP_ADMIN_USERNAME
|
|
value: "{{ ldap_admin_user }}"
|
|
- name: LDAP_ADMIN_PASSWORD
|
|
value: "{{ ldap_admin_password }}"
|
|
- name: LDAP_USERS
|
|
value: "ansible"
|
|
- name: LDAP_PASSWORDS
|
|
value: "ansible123"
|
|
- name: LDAP_ROOT
|
|
value: "{{ ldap_root }}"
|
|
ports:
|
|
- containerPort: 1389
|
|
register: pod_info
|
|
|
|
- name: Set Pod Internal IP
|
|
set_fact:
|
|
podIp: "{{ pod_info.result.status.podIP }}"
|
|
|
|
- name: Set LDAP Common facts
|
|
set_fact:
|
|
ldap_server_uri: "ldap://{{ podIp }}:1389"
|
|
ldap_bind_dn: "cn={{ ldap_admin_user }},{{ ldap_root }}"
|
|
ldap_bind_pw: "{{ ldap_admin_password }}"
|
|
|
|
- name: Display LDAP Server URI
|
|
debug:
|
|
var: ldap_server_uri
|
|
|
|
- name: Test existing user from LDAP server
|
|
openshift_ldap_entry_info:
|
|
bind_dn: "{{ ldap_bind_dn }}"
|
|
bind_pw: "{{ ldap_bind_pw }}"
|
|
dn: "ou=users,{{ ldap_root }}"
|
|
server_uri: "{{ ldap_server_uri }}"
|
|
# ignore_errors: true
|
|
# register: ping_ldap
|
|
|
|
- include_tasks: "tasks/python-ldap-not-installed.yml"
|
|
- include_tasks: "tasks/rfc2307.yml"
|
|
- include_tasks: "tasks/activeDirectory.yml"
|
|
- include_tasks: "tasks/augmentedActiveDirectory.yml"
|