Vagrant provision samba4 ad example

provision.sh
#!/bin/bash
 
#set -x
unset UCF_FORCE_CONFFOLD
export UCF_FORCE_CONFFNEW=YES
export DEBIAN_FRONTEND=noninteractive
#APT_OPTIONS='-qq -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
 
ucf --purge /boot/grub/menu.lst
apt-get -qq -y --force-yes update
apt-get -qq -y --force-yes dist-upgrade
 
[ -e packages.tar.gz ] || wget -q http://users.ugent.be/~rgevaert/packages.tar.gz 
[ -d packages ] || tar xzf packages.tar.gz
 
for package in dbus libaio1 libasn1-8-heimdal libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libdbus-1-3 libfile-copy-recursive-perl libglib2.0-0 libglib2.0-data libgssapi3-heimdal libhcrypto4-heimdal libhdb9-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libkdc2-heimdal libkrb5-26-heimdal libparse-yapp-perl libpopt-dev libpython2.7 libroken18-heimdal libsubunit0 libsystemd-login0 libwind0-heimdal pkg-config python-crypto python-dnspython shared-mime-info update-inetd krb5-user
do
  apt-get -qq -y --force-yes  install $package
done
 
[ -e packages/.installed ] ||  cd packages && dpkg -i *deb && touch .installed
 
REALM="JU"
DOMAIN="ju.edu.et"
SERVER_ROLE="domain controller"
ADMINPASS="SambaAD1"
 
/usr/share/samba/setoption.py "realm" "${REALM}"
/usr/share/samba/setoption.py "workgroup" "${DOMAIN}"
/usr/share/samba/setoption.py "server role" "${SERVER_ROLE}"
/usr/share/samba/setoption.py "dns forwarder" "10.0.2.2"
/usr/share/samba/addshare.py sysvol /var/lib/samba/sysvol
/usr/share/samba/addshare.py netlogon "/var/lib/samba/sysvol/$REALM/scripts"
 
samba-tool domain provision --realm="$REALM" --domain="$DOMAIN" --server-role="$SERVER_ROLE" --adminpass="$ADMINPASS"
 
echo nameserver 127.0.0.1 > /etc/resolv.conf
[ -f /etc/krb5.conf ] || cp /var/lib/samba/private/krb5.conf /etc/
/etc/init.d/samba stop
/etc/init.d/samba start
 
host -t SRV _ldap._tcp.JU.
host -t SRV _kerberos._udp.JU
host www.google.com
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
 
Vagrant.configure("2") do |config|
 
  config.vm.define :debian do |debian_config|
    debian_config.vm.box = "wheezy64"
    debian_config.vm.hostname = "samba4.rudy.com"
#    debian_config.vm.network :private_network, ip: "192.168.50.2"
#    debian_config.vm.synced_folder "/var/spool/apt-mirror/mirror/", "/var/www/localmirror"
# debian_config.vm.network :forwarded_port, guest: 3030, host: 3030
    debian_config.vm.provision "shell", path: "provision.sh"
  end
end
vlir/projects/vagrant.txt · Last modified: 2013/11/08 10:30 by rudy
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki