mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Solved ldap schema bug
This commit is contained in:
32
roles/docker-ldap/tasks/create_nextcloud_schema.yml
Normal file
32
roles/docker-ldap/tasks/create_nextcloud_schema.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
- name: "pkgmgr install"
|
||||
include_role:
|
||||
name: pkgmgr-install
|
||||
vars:
|
||||
package_name: ldapsm
|
||||
|
||||
- name: Ensure custom LDAP schema snippet via ldapsm
|
||||
vars:
|
||||
schema_name: "nextcloud"
|
||||
attribute_defs:
|
||||
- "( 1.3.6.1.4.1.99999.1 NAME 'nextcloudQuota' DESC 'Quota for Nextcloud' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )"
|
||||
objectclass_defs:
|
||||
- "( 1.3.6.1.4.1.99999.2 NAME 'nextcloudUser' DESC 'Auxiliary class for Nextcloud attributes' AUXILIARY MAY ( nextcloudQuota ) )"
|
||||
command: >
|
||||
ldapsm
|
||||
-s {{ ldap_server_uri }}
|
||||
-D '{{ ldap_bind_dn }}'
|
||||
-W '{{ ldap_bind_pw }}'
|
||||
-n {{ schema_name }}
|
||||
{% for at in attribute_defs %}
|
||||
-a "{{ at }}"
|
||||
{% endfor %}
|
||||
{% for oc in objectclass_defs %}
|
||||
-c "{{ oc }}"
|
||||
{% endfor %}
|
||||
register: ldapsm_result
|
||||
changed_when: "'Created schema entry' in ldapsm_result.stdout"
|
||||
check_mode: no
|
||||
|
||||
- name: Show ldapsm output
|
||||
debug:
|
||||
var: ldapsm_result.stdout_lines
|
@@ -49,36 +49,12 @@
|
||||
- python-ldap
|
||||
state: present
|
||||
|
||||
- name: Create Nextcloud Schema
|
||||
ldap_entry:
|
||||
dn: "cn=nextcloud,cn=schema,cn=config"
|
||||
objectClass:
|
||||
- top
|
||||
- olcSchemaConfig
|
||||
attributes:
|
||||
cn: nextcloud
|
||||
olcAttributeTypes:
|
||||
- >-
|
||||
( 1.3.6.1.4.1.99999.1
|
||||
NAME 'nextcloudQuota'
|
||||
DESC 'Quota for Nextcloud'
|
||||
EQUALITY integerMatch
|
||||
ORDERING integerOrderingMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
|
||||
SINGLE-VALUE
|
||||
)
|
||||
olcObjectClasses:
|
||||
- >-
|
||||
( 1.3.6.1.4.1.99999.2
|
||||
NAME 'nextcloudUser'
|
||||
DESC 'Auxiliary class for Nextcloud attributes'
|
||||
AUXILIARY
|
||||
MAY ( nextcloudQuota )
|
||||
)
|
||||
server_uri: "ldap://127.0.0.1:{{ ports.localhost.ldap.ldap }}"
|
||||
bind_dn: "cn={{ applications.ldap.users.administrator.username }},cn=config"
|
||||
bind_pw: "{{ applications.ldap.administrator_password }}"
|
||||
state: present
|
||||
- name: "Include Nextcloud Schema"
|
||||
include_tasks: create_nextcloud_schema.yml
|
||||
vars:
|
||||
ldap_server_uri: "ldap://127.0.0.1:{{ ports.localhost.ldap.ldap }}"
|
||||
ldap_bind_dn: "cn={{ applications.ldap.users.administrator.username }},cn=config"
|
||||
ldap_bind_pw: "{{ applications.ldap.administrator_password }}"
|
||||
|
||||
###############################################################################
|
||||
# 1) Create the LDAP entry if it does not yet exist
|
||||
|
Reference in New Issue
Block a user