mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Shortened service- to svc-
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
# MemberOf Overlay Configuration for OpenLDAP
|
||||
#
|
||||
# This file activates the memberOf module and configures the memberOf overlay,
|
||||
# which is required by Nextcloud for proper group management.
|
||||
# @see https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/user_auth_ldap.html
|
||||
# @see https://www.adimian.com/blog/how-to-enable-memberof-using-openldap/
|
||||
#
|
||||
# The first section loads the memberof module from the specified path.
|
||||
# - olcModuleLoad: Specifies that the "memberof" module should be loaded.
|
||||
# - olcModulePath: Provides the full path to the memberof shared object.
|
||||
#
|
||||
# The second section configures the memberOf overlay for the designated database.
|
||||
# - The DN "olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config" sets up the overlay
|
||||
# on the database backend (here assumed to be "hdb").
|
||||
# - olcMemberOfDangling: ignore
|
||||
# Instructs the overlay to ignore references to non-existent objects.
|
||||
# - olcMemberOfRefInt: TRUE
|
||||
# Enables referential integrity so that changes in group membership automatically
|
||||
# update the user's "memberOf" attribute.
|
||||
# - olcMemberOfGroupOC: groupOfNames
|
||||
# Specifies that the overlay applies to groups with the object class "groupOfNames".
|
||||
# - olcMemberOfMemberAD: member
|
||||
# Indicates that the group's membership is stored in the "member" attribute.
|
||||
# - olcMemberOfMemberOfAD: memberOf
|
||||
# Defines that the overlay will maintain the "memberOf" attribute in user entries.
|
||||
#
|
||||
# IMPORTANT: All groups created before enabling this module must be deleted and recreated,
|
||||
# as the overlay only assigns the "member" attribute when a new group is created.
|
||||
|
||||
# @todo Solve the following error:
|
||||
#fatal: [echoserver]: FAILED! => {"changed": true, "cmd": "docker exec -i ldap ldapmodify -Y EXTERNAL -H ldapi:/// -f /tmp/ldif/01_member_of_configuration.ldif\n", "delta": "0:00:00.059605", "end": "2025-02-25 12:01:18.218851", "msg": "non-zero return code", "rc": 247, "start": "2025-02-25 12:01:18.159246", "stderr": "SASL/EXTERNAL authentication started\nSASL username: gidNumber=0+uidNumber=1001,cn=peercred,cn=external,cn=auth\nSASL SSF: 0\nldapmodify: modify operation type is missing at line 2, entry \"cn=module,cn=config\"", "stderr_lines": ["SASL/EXTERNAL authentication started", "SASL username: gidNumber=0+uidNumber=1001,cn=peercred,cn=external,cn=auth", "SASL SSF: 0", "ldapmodify: modify operation type is missing at line 2, entry \"cn=module,cn=config\""], "stdout": "", "stdout_lines": []}
|
||||
|
||||
|
||||
dn: cn=module,cn=config
|
||||
cn: module
|
||||
objectClass: olcModuleList
|
||||
olcModuleLoad: memberof
|
||||
olcModulePath: /opt/bitnami/openldap/lib/openldap/memberof.so
|
||||
|
||||
dn: olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config
|
||||
objectClass: olcConfig
|
||||
objectClass: olcMemberOf
|
||||
objectClass: olcOverlayConfig
|
||||
objectClass: top
|
||||
olcOverlay: memberof
|
||||
olcMemberOfDangling: ignore
|
||||
olcMemberOfRefInt: TRUE
|
||||
olcMemberOfGroupOC: groupOfNames
|
||||
olcMemberOfMemberAD: member
|
||||
olcMemberOfMemberOfAD: memberOf
|
@@ -0,0 +1,10 @@
|
||||
# Refint Module Activation for OpenLDAP
|
||||
#
|
||||
# This section adds the refint module to the LDAP configuration.
|
||||
# The refint module ensures referential integrity by automatically updating
|
||||
# or removing references when objects are renamed or deleted.
|
||||
#
|
||||
# In this file, the "olcmoduleload" attribute is used to load the "refint" module.
|
||||
dn: cn=module{1},cn=config
|
||||
add: olcmoduleload
|
||||
olcmoduleload: refint
|
@@ -0,0 +1,23 @@
|
||||
# Refint Overlay Configuration for OpenLDAP
|
||||
#
|
||||
# This file configures the refint overlay for the specified LDAP database.
|
||||
#
|
||||
# The overlay is applied to the database (here using the "hdb" backend) and is
|
||||
# responsible for maintaining referential integrity.
|
||||
#
|
||||
# The attribute "olcRefintAttribute" lists the attributes that will be monitored
|
||||
# for changes. In this case, changes to the following attributes will be tracked:
|
||||
# - memberof
|
||||
# - member
|
||||
# - manager
|
||||
# - owner
|
||||
#
|
||||
# This ensures that any changes in the LDAP directory (such as deletion or modification
|
||||
# of an object) automatically update all references to that object, preventing dangling references.
|
||||
dn: olcOverlay={1}refint,olcDatabase={1}hdb,cn=config
|
||||
objectClass: olcConfig
|
||||
objectClass: olcOverlayConfig
|
||||
objectClass: olcRefintConfig
|
||||
objectClass: top
|
||||
olcOverlay: {1}refint
|
||||
olcRefintAttribute: memberof member manager owner
|
@@ -0,0 +1,6 @@
|
||||
# Activates Password hashing in ldap
|
||||
|
||||
dn: cn=config
|
||||
changetype: modify
|
||||
replace: olcPasswordHash
|
||||
olcPasswordHash: {SSHA}
|
@@ -0,0 +1 @@
|
||||
This folder contains configuration files where a specific logic needs to be applied.
|
30
roles/svc-openldap/templates/ldif/data/01_rbac_group.ldif.j2
Normal file
30
roles/svc-openldap/templates/ldif/data/01_rbac_group.ldif.j2
Normal file
@@ -0,0 +1,30 @@
|
||||
{#
|
||||
@todo: activate
|
||||
{% for dn, entry in (applications | build_ldap_role_entries(users, ldap)).items() %}
|
||||
|
||||
dn: {{ dn }}
|
||||
{% for oc in entry.objectClass %}
|
||||
objectClass: {{ oc }}
|
||||
{% endfor %}
|
||||
{% if entry.ou is defined %}
|
||||
ou: {{ entry.ou }}
|
||||
{% else %}
|
||||
cn: {{ entry.cn }}
|
||||
{% endif %}
|
||||
{% if entry.gidNumber is defined %}
|
||||
gidNumber: {{ entry.gidNumber }}
|
||||
{% endif %}
|
||||
description: {{ entry.description }}
|
||||
{% if entry.memberUid is defined %}
|
||||
{% for uid in entry.memberUid %}
|
||||
memberUid: {{ uid }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if entry.member is defined %}
|
||||
{% for m in entry.member %}
|
||||
member: {{ m }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
#}
|
23
roles/svc-openldap/templates/ldif/data/02_rbac_roles.ldif.j2
Normal file
23
roles/svc-openldap/templates/ldif/data/02_rbac_roles.ldif.j2
Normal file
@@ -0,0 +1,23 @@
|
||||
{% for dn, entry in (applications | build_ldap_role_entries(users, ldap)).items() %}
|
||||
|
||||
dn: {{ dn }}
|
||||
{% for oc in entry.objectClass %}
|
||||
objectClass: {{ oc }}
|
||||
{% endfor %}
|
||||
{% if entry.gidNumber is defined %}
|
||||
gidNumber: {{ entry.gidNumber }}
|
||||
{% endif %}
|
||||
cn: {{ entry.cn }}
|
||||
description: {{ entry.description }}
|
||||
{% if entry.memberUid is defined %}
|
||||
{% for uid in entry.memberUid %}
|
||||
memberUid: {{ uid }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if entry.member is defined %}
|
||||
{% for m in entry.member %}
|
||||
member: {{ m }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
1
roles/svc-openldap/templates/ldif/data/README.md
Normal file
1
roles/svc-openldap/templates/ldif/data/README.md
Normal file
@@ -0,0 +1 @@
|
||||
This folder contains files which are importet via ldapadd without any specific logic
|
Reference in New Issue
Block a user