From c96f18feee69f1bd621ba4ddeb180e95d4278f27 Mon Sep 17 00:00:00 2001 From: Kai Wohlfahrt Date: Sun, 27 Sep 2020 23:23:31 +0100 Subject: [PATCH] nixos/openldap: migrate sssd-ldap to new settings --- nixos/tests/openldap.nix | 14 ++++++-------- nixos/tests/sssd-ldap.nix | 24 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/nixos/tests/openldap.nix b/nixos/tests/openldap.nix index e9339523ca9f..392fae243467 100644 --- a/nixos/tests/openldap.nix +++ b/nixos/tests/openldap.nix @@ -26,14 +26,12 @@ in { enable = true; settings = { children = { - "cn=schema" = { - includes = [ - "${pkgs.openldap}/etc/schema/core.ldif" - "${pkgs.openldap}/etc/schema/cosine.ldif" - "${pkgs.openldap}/etc/schema/inetorgperson.ldif" - "${pkgs.openldap}/etc/schema/nis.ldif" - ]; - }; + "cn=schema".includes = [ + "${pkgs.openldap}/etc/schema/core.ldif" + "${pkgs.openldap}/etc/schema/cosine.ldif" + "${pkgs.openldap}/etc/schema/inetorgperson.ldif" + "${pkgs.openldap}/etc/schema/nis.ldif" + ]; "olcDatabase={1}mdb" = { # This tests string, base64 and path values, as well as lists of string values attrs = { diff --git a/nixos/tests/sssd-ldap.nix b/nixos/tests/sssd-ldap.nix index 8cb398d0e170..4831eaa4ba20 100644 --- a/nixos/tests/sssd-ldap.nix +++ b/nixos/tests/sssd-ldap.nix @@ -17,10 +17,26 @@ machine = { pkgs, ... }: { services.openldap = { enable = true; - database = "mdb"; - rootdn = "cn=${ldapRootUser},${dbSuffix}"; - rootpw = ldapRootPassword; - suffix = dbSuffix; + settings = { + children = { + "cn=schema".includes = [ + "${pkgs.openldap}/etc/schema/core.ldif" + "${pkgs.openldap}/etc/schema/cosine.ldif" + "${pkgs.openldap}/etc/schema/inetorgperson.ldif" + "${pkgs.openldap}/etc/schema/nis.ldif" + ]; + "olcDatabase={1}mdb" = { + attrs = { + objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ]; + olcDatabase = "{1}mdb"; + olcDbDirectory = "/var/db/openldap"; + olcSuffix = dbSuffix; + olcRootDN = "cn=${ldapRootUser},${dbSuffix}"; + olcRootPW = ldapRootPassword; + }; + }; + }; + }; declarativeContents = { ${dbSuffix} = '' dn: ${dbSuffix}