From 228808c63704bedff3c995e3ddd37d173c4e9d89 Mon Sep 17 00:00:00 2001 From: pcarpent Date: Tue, 14 Apr 2015 17:33:31 +0200 Subject: [PATCH] adding samba ad-dc deployement --- tests/cfg/deploy.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/cfg/deploy.sh b/tests/cfg/deploy.sh index e318f74..2ea38db 100755 --- a/tests/cfg/deploy.sh +++ b/tests/cfg/deploy.sh @@ -13,4 +13,20 @@ sudo sed -i "s%tools.staticdir.dir.*%tools.staticdir.dir = '`pwd`/resources/stat chown -R openldap:openldap /etc/ldap/ /etc/init.d/slapd restart ldapadd -H ldap://localhost -x -D "cn=admin,dc=example,dc=org" -f /etc/ldap/content.ldif -w password -sed -i "s/\(127.0.0.1.*\)/\1 ldap.ldapcherry.org/" /etc/hosts +sed -i "s/\(127.0.0.1.*\)/\1 ldap.ldapcherry.org ad.ldapcherry.org/" /etc/hosts + + +smbconffile=/etc/samba/smb.conf +domain=dc +realm=dc.ldapcherry.org +sambadns=INTERNAL +targetdir=/var/lib/samba/ +role=dc +printf '' > "${smbconffile}" && \ + ${sambacmd} domain provision ${hostip} \ + --domain="${domain}" --realm="${realm}" --dns-backend="${sambadns}" \ + --targetdir="${targetdir}" --workgroup="${domain}" --use-rfc2307 \ + --configfile="${smbconffile}" --server-role="${role}" -d 1 && \ + mv "${targetdir}/etc/smb.conf" "${smbconffile}" + +/etc/init.d/samba-ad-dc restart