diff options
author | Juri Jensen <juri@xenux.dk> | 2001-09-13 13:06:06 +0000 |
---|---|---|
committer | Juri Jensen <juri@xenux.dk> | 2001-09-13 13:06:06 +0000 |
commit | f1847d55033af2bb5d9fbee6a3845534e0d329fc (patch) | |
tree | b9450c1ff2f690f7159bfa4f7d474027e0229c5f | |
parent | a06f2d5e639d6a3bdeeb3062ebc754cce287eb19 (diff) |
* Added printcap.xenuxlocal
* Added some checks to cf.services.file to determine which services is
running and define classes based on that.
# Corrected a few errors.
* Only lprng is supported in cf.services.file - cups is about to come.
-rw-r--r-- | cfengine/cf.groups.xenux | 34 | ||||
-rw-r--r-- | cfengine/cf.services.file | 126 | ||||
-rw-r--r-- | cfengine/cf.site | 2 | ||||
-rw-r--r-- | cfengine/cf.site.xenux | 7 | ||||
-rw-r--r-- | printcap.xenuxlocal | 15 |
5 files changed, 122 insertions, 62 deletions
diff --git a/cfengine/cf.groups.xenux b/cfengine/cf.groups.xenux index baa9ad2..2804f3c 100644 --- a/cfengine/cf.groups.xenux +++ b/cfengine/cf.groups.xenux @@ -2,29 +2,29 @@ # NB! Avoid adding new groups! We pollute the namespace already... # groups: - xenux = ( ns mail www pc17 pc20 insight ) - xenux = ( samba pc60 pc61 pc62 pc63 pc64 pc65 pc66 pc67 pc68 pc69 pc70 pc71 pc72 pc73 pc74 pc75 pc76 pc77 pc78 pc79 pc80 ) + xenux = ( elrond oin smaug bilbo orcrist insight ) + xenuxlocal = ( gandalf pc60 pc61 pc62 pc63 pc64 pc65 pc66 pc67 pc68 pc69 pc70 pc71 pc72 pc73 pc74 pc75 pc76 pc77 pc78 pc79 pc80 ) raps = ( aries ) grinsted = ( debian-grinsted ) - mogensen = ( mogl-filer mogl-firewall mogl-mail ) + mogensen = ( mogl-filer mogl-firewall ) - Standalone_xenux = ( pc17 ) - WWWServer_xenux = ( pc21 ) - FTPServer_xenux = ( pc21 ) - NameServer_xenux = ( ns ) - FileServer_xenux = ( pc20 freja mogl-filer raps samba ) - VPNServer_xenux = ( pc20 mogl-firewall raps ) - Firewall_xenux = ( pc20 mogl-firewall raps ) - CVSServer_xenux = ( pc17 ) - GMServer_xenux = ( pc17 ) - CDWriter_xenux = ( pc17 ) - IMAPServer_xenux = ( mail ) - MailHub_xenux = ( mail ) + 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 = ( smaug ) + FTPServer_xenux = ( smaug ) + NameServer_xenux = ( elrond gandalf ) + FileServer_xenux = ( orcrist gandalf mogl-filer aries ) + VPNServer_xenux = ( orcrist mogl-firewall aries debian-grinsted ) + Firewall_xenux = ( orcrist mogl-firewall aries debian-grinsted ) + CVSServer_xenux = ( bilbo ) + GMServer_xenux = ( bilbo ) + CDWriter_xenux = ( bilbo ) + IMAPServer_xenux = ( oin ) + MailHub_xenux = ( oin ) # MailClient_xenux = ( ) # wol_xenux = ( ) - cc_xenux = ( freja ) +# cc_xenux = ( ) # tdk_xenux = ( ) - wp_xenux = ( mail www pc17 pc20 pc21 ) + wp_xenux = ( oin www bilbo orcrist smaug ) # dnai_xenux = ( ) # sunrise_xenux = ( ) diff --git a/cfengine/cf.services.file b/cfengine/cf.services.file index ee3bdac..13b2583 100644 --- a/cfengine/cf.services.file +++ b/cfengine/cf.services.file @@ -1,5 +1,5 @@ control: - AddInstallable = ( samba_reload netatalk_reload lprng_reload cups_reload lprng cups ) + AddInstallable = ( samba samba_reload netatalk netatalk_reload lprng lprng_reload cups cups_reload ) # # Variables for shares @@ -19,11 +19,21 @@ control: printdir = ( /var/spool/samba ) # - # Variables for lprng + # Determine if this is a samba server, netatalk server or both, and define + # classes based on that. # + samba = ( '/usr/bin/test -x /usr/sbin/smbd' ) + netatalk = ( '/usr/bin/test -x /usr/sbin/afpd' ) + + # + # Determine which print system is in use, and define classes based on that. + # We only support lprng and cups + # + lprng = ( '/usr/bin/test -x /usr/sbin/lpd' ) + cups = ( '/usr/bin/test -x /usr/sbin/cupsd' ) editfiles: - any:: + samba:: # # Samba configuration stuff. # @@ -47,11 +57,23 @@ editfiles: # Append the include lines for the files decribed above # AppendIfNoSuchLine "include = smb-shares-COMMON.conf" - AppendIfNoSuchLine "include = smb-shares-local.conf" + AppendIfNoSuchLine "include = smb-shares-$(site).conf" AppendIfNoSuchLine "include = smb-printers.conf" ResetSearch "1" # + # printing = lprng + # + LocateLineMatching "^[;[:blank:]]*æprinting[[:blank:]]*=.*" + BeginGroupIfNoLineMatching '^[[:blank:]]*printing[[:blank:]]*=[[:blank:]]*lprng[[:blank:]]*' + ReplaceLineWith ' printing = lprng' + EndGroup + CatchAbort + BeginGroupIfNoMatch '^[[:blank:]]*printing[[:blank:]]*=[[:blank:]]*lprng[[:blank:]]*' + InsertLine ' printing = lprng' + EndGroup + + # # workgroup = $(site) # LocateLineMatching "^[;[:blank:]]*workgroup[[:blank:]]*=.*" @@ -172,6 +194,21 @@ editfiles: EndGroup DefineClasses "samba_reload" } + lprng:: + { /etc/samba/smb.conf + # + # printing = lprng + # + LocateLineMatching "^[;[:blank:]]*æprinting[[:blank:]]*=.*" + BeginGroupIfNoLineMatching '^[[:blank:]]*printing[[:blank:]]*=[[:blank:]]*lprng[[:blank:]]*' + ReplaceLineWith ' printing = lprng' + EndGroup + CatchAbort + BeginGroupIfNoMatch '^[[:blank:]]*printing[[:blank:]]*=[[:blank:]]*lprng[[:blank:]]*' + InsertLine ' printing = lprng' + EndGroup + DefineClasses "samba_reload" + } samba_reload:: { /etc/samba/smb.conf LocateLineMatching "^; EDITED BY CFENGINE .*" @@ -181,7 +218,7 @@ editfiles: Append '; EDITED BY CFENGINE $(date)' EndGroup } - any:: + samba:: { /etc/samba/smb-shares-COMMON.conf # # This file contains all the shares common to all installations. @@ -258,45 +295,13 @@ editfiles: Append '; EDITED BY CFENGINE $(date)' EndGroup } - any:: - # - # Local shares special for the site - # - { /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. - # - BeginGroupIfFileIsNewer "/etc/local-$(host).$(domain)/samba/smb-shares-$(site).conf" - EmptyEntireFilePlease - InsertFile "/etc/local-$(host).$(domain)/samba/smb-shares-$(site).conf" - Append "# Edited by cfengine $(date)" - EndGroup - DefineClasses "lprng_reload" - } - any:: - # - # Printer configuration stuff - # - { /etc/printcap - # - # We don't make the printcap dynamically, but instead we copy the contents - # of a master file, but only if it's newer than the one installed. - # - BeginGroupIfFileIsNewer "/etc/local-$(host).$(domain)/printcap" - EmptyEntireFilePlease - InsertFile "/etc/local-$(host).$(domain)/printcap" - Append "# Edited by cfengine $(date)" - EndGroup - DefineClasses "lprng_reload" - } - any:: + samba:: { /etc/samba/smb-printers.conf # # This file contains all the printers defined in the Linux printing # system. There shouldn't be any need for setting up additional # printer entries. Manage the printers through the Linux print - # system. + # system you have installed - cups or lprng. # We check if the proper sections are there and add them if they # isn't. We don't check the file line for line. # @@ -324,12 +329,42 @@ editfiles: Append '; EDITED BY CFENGINE $(date)' EndGroup } + samba:: + # + # 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. + # + BeginGroupIfFileIsNewer "/etc/local-$(host).$(domain)/samba/smb-shares-$(site).conf" + EmptyEntireFilePlease + InsertFile "/etc/local-$(host).$(domain)/samba/smb-shares-$(site).conf" + Append "# Edited by cfengine $(date)" + EndGroup + DefineClasses "lprng_reload" + } + lprng:: + # + # Printer configuration stuff + # + { /etc/printcap + # + # We don't make the printcap 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/printcap.$(site)" + EmptyEntireFilePlease + InsertFile "/etc/local-COMMON/printcap.$(site)" + Append "# Edited by cfengine $(date)" + EndGroup + DefineClasses "lprng_reload" + } directories: - $(netlogshare) - mode=755 - owner=root - group=root + any:: $(commonsharedir) mode=755 owner=root @@ -342,6 +377,11 @@ directories: mode=775 owner=root group=users + samba:: + $(netlogshare) + mode=755 + owner=root + group=root $(profshare) mode=775 owner=root diff --git a/cfengine/cf.site b/cfengine/cf.site index 2c552b5..6c2b454 100644 --- a/cfengine/cf.site +++ b/cfengine/cf.site @@ -1,5 +1,5 @@ import: jones|macvaerk|homebase|adamatic:: $(cfroot)/cf.site.jones - xenux|raps|grinsted|mogl:: + xenux|xenuxlocal|raps|grinsted|mogensen:: $(cfroot)/cf.site.xenux diff --git a/cfengine/cf.site.xenux b/cfengine/cf.site.xenux index 14e70b5..7f9c2b3 100644 --- a/cfengine/cf.site.xenux +++ b/cfengine/cf.site.xenux @@ -42,7 +42,9 @@ control: defaultroute: xenux:: - 192.184.114.1 + 195.184.114.1 + xenuxlocal:: + 192.168.200.1 grinsted:: 62.242.55.89 mogl:: @@ -54,6 +56,9 @@ resolve: xenux:: "search xenux.dk" + xenuxlocal:: + "search xenux.local" + "search xenux.dk" raps:: "search xenux.dk" grinsted:: diff --git a/printcap.xenuxlocal b/printcap.xenuxlocal new file mode 100644 index 0000000..07ea5a6 --- /dev/null +++ b/printcap.xenuxlocal @@ -0,0 +1,15 @@ +lp|brlaser|Brother 1270N:\ + :lp=:\ + :sd=/var/spool/lpd/brlaser:\ + :rm=192.168.200.10:\ + :rp=POSTSCRIPT_P1:\ + :af=/var/log/lp-acct:\ + :lf=/var/log/lp-errs: + +lp1|brlasertxt|Brother 1270N Text Only:\ + :lp=:\ + :sd=/var/spool/lpd/brlasertxt:\ + :rm=192.168.200.10:\ + :rp=TEXT_P1:\ + :af=/var/log/lp-acct:\ + :lf=/var/log/lp-errs: |