From e1ae8fefb99e7e1cf96ee66a82f8f0f97413ce7a Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Wed, 13 Apr 2022 17:26:59 +0200 Subject: [PATCH] post-install: add the date into the ldif generated file --- roles/post-install/template/generateldif.sh.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/post-install/template/generateldif.sh.j2 b/roles/post-install/template/generateldif.sh.j2 index ade6ba9..4deab9c 100755 --- a/roles/post-install/template/generateldif.sh.j2 +++ b/roles/post-install/template/generateldif.sh.j2 @@ -35,8 +35,10 @@ opensshFingerprintECDSA=$(ssh-keyscan -t ecdsa-sha2-nistp256 localhost 2>/dev/nu Fingerprint="${opensshFingerprintRSA}${opensshFingerprintRSA:+;}"\ "${opensshFingerprintED25519}${opensshFingerprintED25519:+;}${opensshFingerprintECDSA}" -cat</root/${EvoComputerName}.ldif -# ldapvi --profile evolix --add --in ${EvoComputerName}.ldif +ldif_file="/root/${EvoComputerName}.$(date +"%Y%m%d%H%M%S").ldif" + +cat<${ldif_file} +# ldapvi --profile evolix --add --in ${ldif_file} dn: EvoComputerName=${EvoComputerName},ou=computer,dc=evolix,dc=net dnsArecord: $EvoComputerName @@ -149,7 +151,7 @@ ServiceVersion: packetfilter EOT if egrep -q 'sd.*RAID' /var/run/dmesg.boot; then -cat<>/root/${EvoComputerName}.ldif +cat<>${ldif_file} dn: ServiceName=bioctl,EvoComputerName=${EvoComputerName},ou=computer,dc=evolix,dc=net objectClass: EvoService NagiosEnabled: TRUE