π£οΈ Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
π» Brief Description
Sorting of schemas results in missing attributes
π₯ Cookbook version
6.0.3
π©βπ³ Chef-Infra Version
17.10.3
π© Platform details
Ubuntu Bionic 18.04
Steps To Reproduce
- add ldap-autofs to list of packages installed by cookbook
- create list of schemas containing
autofs.schema, ex:
node.default['openldap']['schemas'] = %w(
core.schema
cosine.schema
inetorgperson.schema
nis.schema
autofs.schema
)
- note that "autofs" is last as it depends on schema attributes from core (and maybe nis?)
- converging will fail- the slapd service will not start.
systemctl status slapd doesn't contain useful messages- slaptest does:
vagrant@default-ubuntu-1804:~$ sudo slaptest -f /etc/ldap/slapd.conf -v
6303e2b4 /etc/ldap/schema/autofs.schema: line 26 objectclass: AttributeType not found: "ou"
slaptest: bad configuration file!
π Expected behavior
A running slapd service with the autofs schema loaded.
I would expect that the ordering of the schema names in the attribute node[openldap][schemas] would be honored in the generated slapd configuration file.
β Additional context
When slapd processes the config file, each include line is processed in order (see include in the "Global Configuration Options" of the slapd.conf manpage). When sorted lexically, the schema for autofs is loaded first, but slapd doesn't have a definition for ou (available in the core schema) so fails.
This seems to occur in the template generating slapd.conf at line 22
I believe- given the algorithm for loading include files- that it's improper to sort this lexically and that the ordering of the array should be maintained in the output of this template.
π£οΈ Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
π» Brief Description
Sorting of schemas results in missing attributes
π₯ Cookbook version
6.0.3
π©βπ³ Chef-Infra Version
17.10.3
π© Platform details
Ubuntu Bionic 18.04
Steps To Reproduce
autofs.schema, ex:systemctl status slapddoesn't contain useful messages-slaptestdoes:π Expected behavior
A running slapd service with the autofs schema loaded.
I would expect that the ordering of the schema names in the attribute
node[openldap][schemas]would be honored in the generated slapd configuration file.β Additional context
When
slapdprocesses the config file, eachincludeline is processed in order (seeincludein the "Global Configuration Options" of the slapd.conf manpage). When sorted lexically, the schema for autofs is loaded first, butslapddoesn't have a definition forou(available in thecoreschema) so fails.This seems to occur in the template generating
slapd.confat line 22I believe- given the algorithm for loading include files- that it's improper to sort this lexically and that the ordering of the array should be maintained in the output of this template.