Don't create users if they don't have passwords

This commit is contained in:
niten 2024-01-07 17:51:23 -08:00
parent f7a5a43d30
commit 92be492607
2 changed files with 8 additions and 2 deletions

View File

@ -339,6 +339,8 @@ let
"--keytab=${cfg.kdc.secondary.keytabs.hpropd}" "--keytab=${cfg.kdc.secondary.keytabs.hpropd}"
]); ]);
in "${startScript}"; in "${startScript}";
ExecStartPost =
"chown ${cfg.user}:${cfg.group} ${cfg.kdc.database}";
}; };
unitConfig.ConditionPathExists = unitConfig.ConditionPathExists =
[ cfg.kdc.database cfg.kdc.secondary.keytabs.hpropd ]; [ cfg.kdc.database cfg.kdc.secondary.keytabs.hpropd ];

View File

@ -413,7 +413,11 @@ in {
}; };
}; };
declarativeContents = { declarativeContents = let
usersWithPasswords =
filterAttrs (_: userOpts: userOpts.ldap-hashed-password != null)
cfg.users;
in {
"${cfg.base}" = '' "${cfg.base}" = ''
dn: ${cfg.base} dn: ${cfg.base}
objectClass: top objectClass: top
@ -436,7 +440,7 @@ in {
${systemUsersLdif cfg.base cfg.system-users} ${systemUsersLdif cfg.base cfg.system-users}
${groupsLdif cfg.base cfg.groups} ${groupsLdif cfg.base cfg.groups}
${usersLdif cfg.base cfg.groups cfg.users} ${usersLdif cfg.base cfg.groups usersWithPasswords}
''; '';
}; };
}; };