#
# This is the main cfengine config file for the Debian Edu project.  All
# other cfengine config files are included from this file.
###############################################################################

control:

	cfinputs_version = ( 2 )
	
	#
	#  Decides what to be done and in which sequence
	#
	#  "copy" should come before "shellcommands" so that it is possible
	#  to drop in a script and then run it from a cfengine
	#  config file.
	#
	
	actionsequence = (
              			mountall
              			mountinfo
              			unmount
              			addmounts
              			directories
				links
              			mountall
				tidy
              			files
              			editfiles
                		copy
              	 		shellcommands
              			files.secondpass
              	 		shellcommands.secondpass
              	 		shellcommands.thirdpass
              	 		shellcommands.forthpass
              	 		shellcommands.fifthpass
       			 )

	
	#
	#  Adds a class where the tasks that should be executes only after the 
	#  installation is done, should be contained.
	#  We can then run
	#  "cfengine -N installation"
	#  and then these taske wount be executed.
	#
	
	#addclasses 		= ( installation )
	
	#
	#  Setting some variables
	#

        site                    = ( skole )     # Name on installation
        mountpattern            = ( /$(site)/$(host) )
        homepattern             = ( home? )

        access                  = ( root ) 	# Who is allowed to run cfengine
        sysadm                  = ( root ) 	# Name or mail alias to sysadm
        editfilesize            = ( 200000 )    # Max size on textfiles that can be edited

        ltsp_arch               = ( ExecResult(/usr/bin/ltsp-arch-debian-edu) )

        ldapserver              = ( ExecResult(/usr/bin/debian-edu-ldapserver -f) )
        ldapbase                = ( ExecResult(/usr/bin/debian-edu-ldapserver -b -f) )
        syslogserver            = ( ExecResult(/usr/share/debian-edu-config/tools/locate-syslog-collector) )
	
	#
	# Variables that defines some important cataloges
	#
	
	adminfiles              = ( /etc/cfengine/debian-edu ) 	
        repository              = ( /var/backups/cfengine ) 
	masterfiles		= ( /etc/cfengine/debian-edu/masterfiles ) 
	
	cfserver                = ( cfengine ) 
	
###############################################################################

groups:

	server			= ( "/bin/grep -q 'Main-Server' /etc/debian-edu/config" )
	installation		= ( "/usr/bin/test -e /sbin/start-stop-daemon.REAL" )
	testinstall		= ( "/bin/grep -q 'TESTINSTALL=\"true\"' /etc/debian-edu/config" )
	ltspserver		= ( "/usr/bin/test -x /usr/sbin/ltsp-build-client" )
	workstation		= ( "/usr/bin/test -e /etc/desktop-profiles/debian-edu-menus.listing -a -e /usr/bin/ntpq" )
	roaming			= ( "/bin/grep -q 'Roaming-Workstation' /etc/debian-edu/config" )
	standalone		= ( "/usr/bin/test ! -e /usr/bin/ntpq" )
	ltspclient		= ( "/usr/bin/test -e /usr/bin/getltscfg" )

	# Set if the internet is reachable for downloading files
	internet                = ( "/usr/bin/wget -qO /dev/null http://ftp.skolelinux.org/welcome.msg " )

###############################################################################

import:

	debian.installation::

			cf.apt
			cf.cups
			cf.dhcpserver
			cf.exim
			cf.fstab
			cf.iceweasel
			cf.imap
			cf.inetd
			cf.kdm
			cf.krb5client
			cf.ldapclient
			cf.ldapserver
			cf.ntp
			cf.squid
			cf.pxeinstall
			cf.syslog
			cf.testsetup

	debian.server.installation::
			cf.apache2
			cf.nagios3
			cf.bind
			cf.samba
			cf.squid
			cf.sysstat
			cf.ldap2zone

	debian.ltspserver.installation::
			cf.ltsp
			cf.sysstat
	
	debian.workstation.installation::
			cf.cfengine

	debian.installation.!standalone::
			cf.adduser
			cf.homes
			
###############################################################################
