diff options
author | Juri Jensen <juri@xenux.dk> | 2002-01-09 22:41:29 +0000 |
---|---|---|
committer | Juri Jensen <juri@xenux.dk> | 2002-01-09 22:41:29 +0000 |
commit | d2035a2e64eba9e38e53f9b2930fc8e7150c102e (patch) | |
tree | fd48b49b38163683fbca74d1e39a58c77ee3f084 /cfengine | |
parent | 89f7f78402a0f4362f59ffd693b8491b34700abe (diff) |
cfengine: Major changes in the way samba is handled - now all shares are
individual for every site (see cf.services.file and
local-COMMON/samba/smb-shares-raatstof.conf as an example). Bind's
named.conf is now edited to include named_$(host).$(domain).conf -
nothing more. The DNSServers part is also turned on again. A new section
for DHCPServers are now included and turned on - it only switches
/etc/init.d/dhcp on and copies the right dhcpd.conf file into /etc,
nothing more. I've also added a new site to cf.site.xenux and
cf.groups.xenux. Well, that's it for now...
Diffstat (limited to 'cfengine')
-rw-r--r-- | cfengine/cf.groups.xenux | 11 | ||||
-rw-r--r-- | cfengine/cf.services | 10 | ||||
-rw-r--r-- | cfengine/cf.services.dhcp | 14 | ||||
-rw-r--r-- | cfengine/cf.services.dns | 5 | ||||
-rw-r--r-- | cfengine/cf.services.file | 162 | ||||
-rw-r--r-- | cfengine/cf.site | 2 | ||||
-rw-r--r-- | cfengine/cf.site.xenux | 8 |
7 files changed, 61 insertions, 151 deletions
diff --git a/cfengine/cf.groups.xenux b/cfengine/cf.groups.xenux index e103854..7d478f8 100644 --- a/cfengine/cf.groups.xenux +++ b/cfengine/cf.groups.xenux @@ -7,17 +7,18 @@ groups: raps = ( aries ) grinsted = ( debian-grinsted ) mogensen = ( mogl-filer mogl-firewall ) + raatstof = ( raatstof ) Standalone_xenux = ( bilbo pc60 pc61 pc62 pc63 pc64 pc65 pc66 pc67 pc68 pc69 pc70 pc71 pc72 pc73 pc74 pc75 pc76 pc77 pc78 pc79 pc80 ) WWWServer_xenux = ( beorn ) FTPServer_xenux = ( beorn smaug ) - NameServer_xenux = ( elrond gandalf ) - FileServer_xenux = ( orcrist gandalf mogl-filer aries ) + NameServer_xenux = ( elrond gandalf raatstof ) + FileServer_xenux = ( orcrist gandalf mogl-filer aries raatstof ) VPNServer_xenux = ( orcrist mogl-firewall aries debian-grinsted ) - Firewall_xenux = ( orcrist mogl-firewall aries debian-grinsted ) + Firewall_xenux = ( orcrist mogl-firewall aries debian-grinsted raatstof ) CVSServer_xenux = ( bilbo ) GMServer_xenux = ( bilbo ) - DHCPServer_xenux = ( orcrist ) + DHCPServer_xenux = ( orcrist raatstof ) FAIServer_xenux = ( thorin ) CDWriter_xenux = ( bilbo ) IMAPServer_xenux = ( oin ) @@ -25,7 +26,7 @@ groups: # MailClient_xenux = ( ) # wol_xenux = ( ) -# cc_xenux = ( ) + cc_xenux = ( raatstof ) # tdk_xenux = ( ) wp_xenux = ( oin www bilbo orcrist smaug beorn ) # dnai_xenux = ( ) diff --git a/cfengine/cf.services b/cfengine/cf.services index adcbd11..9a76a88 100644 --- a/cfengine/cf.services +++ b/cfengine/cf.services @@ -1,15 +1,15 @@ import: -# NameServer:: -# $(cfroot)/cf.services.dns + NameServer:: + $(cfroot)/cf.services.dns FileServer:: $(cfroot)/cf.services.file FTPServer:: $(cfroot)/cf.services.ftp WWWServer:: $(cfroot)/cf.services.web -# DHCPServer:: -# $(cfroot)/cf.services.web + DHCPServer:: + $(cfroot)/cf.services.dhcp # FAIServer:: -# $(cfroot)/cf.services.web +# $(cfroot)/cf.services.fai any:: $(cfroot)/cf.services.harden diff --git a/cfengine/cf.services.dhcp b/cfengine/cf.services.dhcp index 88a6f13..89e5e9a 100644 --- a/cfengine/cf.services.dhcp +++ b/cfengine/cf.services.dhcp @@ -2,6 +2,17 @@ control: AddInstallable = ( dhcpd_reload ) editfiles: + { /etc/init.d/dhcp + # + # First of all, this is a DHCP server so let's make it possible + # for DHCP to start. + # + LocateLineMatching "^run_dhcpd=.*" + BeginGroupIfNoLineMatching '^run_dhcpd=1' + ReplaceLineWith 'run_dhcpd=1' + EndGroup + DefineClasses "dhcpd_reload" + } { /etc/dhcp.conf # # We don't make the dhcp.conf dynamically, but instead we copy the contents @@ -16,6 +27,9 @@ editfiles: DefineClasses "dhcpd_reload" } +processes: + "dhcpd-2.2.x" restart "/etc/init.d/dhcp restart" + shellcommands: dhcpd_reload:: "/etc/init.d/dhcp force-reload" diff --git a/cfengine/cf.services.dns b/cfengine/cf.services.dns index 8b87b1e..e86db47 100644 --- a/cfengine/cf.services.dns +++ b/cfengine/cf.services.dns @@ -30,8 +30,9 @@ editfiles: # Append " category statistics { null; };" # EndGroup # - BeginGroupIfNoLineMatching '^include[[:blank:]]"/etc/local-COMMON/bind/named_$(domain).conf";.*' - Append 'include "/etc/local-COMMON/bind/named_$(domain).conf";' + BeginGroupIfNoLineMatching '^include[[:blank:]]"/etc/local-COMMON/bind/named_$(host).conf";.*' + Append 'include "/etc/local-COMMON/bind/named_$(host).conf";' + Append '# EDITED BY CFENGINE $(date)' EndGroup DefineClasses "bind_reload" } diff --git a/cfengine/cf.services.file b/cfengine/cf.services.file index 47bec59..b2ccab2 100644 --- a/cfengine/cf.services.file +++ b/cfengine/cf.services.file @@ -1,8 +1,8 @@ control: AddInstallable = ( samba samba_reload netatalk netatalk_reload lprng lprng_reload cups cups_reload ) - # - # Variables for shares +# # +# # Variables for shares # You can change the paths here and it will be changed both in # the conf file and in the filesystem - But once it is implemented, # it is not wise to change it - the data in the shares doesn't get @@ -10,21 +10,21 @@ control: # You can change the rights on the shares in the "directories:" # section. # - netlogshare = ( /etc/samba/netlogon ) - commonsharedir = ( /home/fsadmin/COMMON ) - datashare = ( /home/fsadmin/COMMON/documents ) - softshare = ( /home/fsadmin/COMMON/software ) - profshare = ( /home/fsadmin/COMMON/samba/userprofiles ) +# netlogshare = ( /etc/samba/netlogon ) +# commonsharedir = ( /home/fsadmin/COMMON ) +# datashare = ( /home/fsadmin/COMMON/documents ) +# softshare = ( /home/fsadmin/COMMON/software ) +# profshare = ( /home/fsadmin/COMMON/samba/userprofiles ) printdir = ( /var/spool/lpd/sharedprinter ) - privpcshare = ( .pcshare ) - privmacshare = ( .macshare ) - privxchngshare = ( .xchangeshare ) +# privpcshare = ( .pcshare ) +# privmacshare = ( .macshare ) +# privxchngshare = ( .xchangeshare ) # # Administrative user and group # - adminuser = ( fsadmin ) - admingrp = ( fsadmin ) +# adminuser = ( fsadmin ) +# admingrp = ( fsadmin ) # # Determine if this is a samba server, netatalk server or both, and define @@ -40,6 +40,10 @@ classes: # lprng = ( `/usr/bin/test -x /usr/sbin/lpd` ) cups = ( `/usr/bin/test -x /usr/sbin/cupsd` ) + +import: + samba:: + /etc/local-COMMON/samba/smb-shares-$(site).conf editfiles: samba:: @@ -65,7 +69,7 @@ editfiles: # # Append the include lines for the files decribed above # - AppendIfNoSuchLine "include = /etc/samba/smb-shares-COMMON.conf" +# AppendIfNoSuchLine "include = /etc/samba/smb-shares-COMMON.conf" AppendIfNoSuchLine "include = /etc/samba/smb-printers.conf" BeginGroupIfFileExists "/etc/local-COMMON/samba/smb-shares-$(site).conf" AppendIfNoSuchLine "include = /etc/samba/smb-shares-$(site).conf" @@ -148,12 +152,12 @@ editfiles: # logon script = common.bat # LocateLineMatching "^[;[:blank:]]*logon script[[:blank:]]*=.*" - BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*common.bat[[:blank:]]*" - ReplaceLineWith ' logon script = common.bat' + BeginGroupIfNoLineMatching "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*" + ReplaceLineWith ' logon script = logon-$(site).bat' EndGroup CatchAbort - BeginGroupIfNoMatch "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*common.bat[[:blank:]]*" - InsertLine ' logon script = common.bat' + BeginGroupIfNoMatch "^[[:blank:]]*logon script[[:blank:]]*=[[:blank:]]*logon-$(site).bat[[:blank:]]*" + InsertLine ' logon script = logon-$(site).bat' EndGroup # @@ -194,96 +198,6 @@ editfiles: DefineClasses "samba_reload" } - { /etc/samba/smb-shares-COMMON.conf - # - # This file contains all the shares common to all installations. - # We check if the proper sections are there and add them if they - # isn't. We don't check the file line for line. - # - AutoCreate - - # - # [netlogon] - # - BeginGroupIfNoLineMatching "^\[netlogon\]" - Append '[netlogon]' - Append ' comment = Network logon' - Append ' path = $(netlogshare)' - Append ' browsable = no' - Append ' writeable = no' - Append ' share modes = no' - EndGroup - # - # [userprofiles] - # - BeginGroupIfNoLineMatching "^\[userprofiles\]" - Append '[userprofiles]' - Append ' path = $(profshare)' - Append ' force user = %u' - Append ' writable = yes' - Append ' browsable = no' - Append ' root preexec = /bin/mkdir $(profshare)/%U \' - Append ' /bin/chown %U $(profshare)/%U \' - Append ' /bin/chmod 700 $(profshare)/%U' - EndGroup - # - # [homes] - # - BeginGroupIfNoLineMatching "^\[homes\]" - Append '[homes]' - Append ' path = /home/%u/$(privpcshare)' - Append ' browsable = no' - Append ' root preexec = /bin/mkdir /home/%u/$(privpcshare) \' - Append ' /bin/chown %U /home/%u/$(privpcshare) \' - Append ' /bin/chmod 644 /home/%u/$(privpcshare)' - EndGroup - # - # [programmer] - # - BeginGroupIfNoLineMatching "^\[software\]" - Append '[software]' - Append ' path = $(softshare)' - Append ' comment = Fælles software' - Append ' browsable = yes' - Append ' guest ok = no' - Append ' writeable = yes' - Append ' valid users = @$(admingrp)' - Append ' force group = +$(admingrp)' - EndGroup - # - # [dokumenter] - # - BeginGroupIfNoLineMatching "^\[dokumenter\]" - Append '[dokumenter]' - Append ' path = $(datashare)' - Append ' comment = Fælles dokumenter' - Append ' browsable = yes' - Append ' guest ok = no' - Append ' writeable = yes' - Append ' valid users = @$(admingrp)' - Append ' force group = +$(admingrp)' - EndGroup - DefineClasses "samba_reload" - } - - # - # Local shares special for the site. - # In this file you can define special shares that you need - # - { /etc/samba/smb-shares-$(site).conf - # - # We don't make this file dynamically, but instead we copy the contents - # of a master file, but only if it's newer than the one installed. - # - AutoCreate - BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/smb-shares-$(site).conf" - EmptyEntireFilePlease - InsertFile "/etc/local-COMMON/samba/smb-shares-$(site).conf" - Append "; Edited by cfengine $(date)" - EndGroup - DefineClasses "samba_reload" - } - { /etc/samba/smb-printers.conf # # This file contains all the printers defined in the Linux printing @@ -312,15 +226,15 @@ editfiles: # # Batch file for mounting shares automatically # - { /etc/samba/netlogon/common.bat + { /etc/samba/netlogon/logon-$(site).bat # # We don't make this file dynamically, but instead we copy the contents # of a master file, but only if it's newer than the one installed. # - BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/netlogon/common.bat" + BeginGroupIfFileIsNewer "/etc/local-COMMON/samba/netlogon/logon-$(site).bat" AutoCreate EmptyEntireFilePlease - InsertFile "/etc/local-COMMON/samba/netlogon/common.bat" + InsertFile "/etc/local-COMMON/samba/netlogon/logon-$(site).bat" Append "rem Edited by cfengine $(date)" EndGroup DefineClasses "samba_reload" @@ -396,34 +310,6 @@ editfiles: EndGroup } -directories: - any:: - $(commonsharedir) - mode=755 - owner=$(adminuser) - group=$(admingrp) - $(softshare) - mode=775 - owner=$(adminuser) - group=$(admingrp) - $(datashare) - mode=775 - owner=$(adminuser) - group=$(admingrp) - samba:: - $(netlogshare) - mode=755 - owner=root - group=root - $(profshare) - mode=775 - owner=$(adminuser) - group=$(admingrp) - $(printdir) - mode=775 - owner=root - group=root - processes: "smbd" restart "/etc/init.d/samba restart" "afpd" restart "/etc/init.d/netatalk restart" diff --git a/cfengine/cf.site b/cfengine/cf.site index 6c2b454..12672e8 100644 --- a/cfengine/cf.site +++ b/cfengine/cf.site @@ -1,5 +1,5 @@ import: jones|macvaerk|homebase|adamatic:: $(cfroot)/cf.site.jones - xenux|xenuxlocal|raps|grinsted|mogensen:: + xenux|xenuxlocal|raps|grinsted|mogensen|raatstof:: $(cfroot)/cf.site.xenux diff --git a/cfengine/cf.site.xenux b/cfengine/cf.site.xenux index 8dabf9a..45b9089 100644 --- a/cfengine/cf.site.xenux +++ b/cfengine/cf.site.xenux @@ -33,6 +33,10 @@ control: site = ( mogensen ) domain = ( mogensen.com ) sysadm = ( root@mogensen.com ) + raatstof:: # Radio Råtstof + site = ( raatstof ) + domain = ( raatstof.local ) + sysadm = ( postmaster@raatstof.dk ) # netmask = ( 255.255.255.0 ) @@ -47,6 +51,8 @@ defaultroute: 62.242.55.89 mogl:: 192.168.11.1 + raatstof:: + 10.0.0.1 ###################################################################### @@ -63,6 +69,8 @@ resolve: "search grinsted.dk" mogl:: "search mogensen.com" + raatstof:: + "search raatstof.local" NameServer:: 127.0.0.1 # localhost |