diff options
author | Luke Kanies <luke@madstop.com> | 2005-04-22 18:43:50 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-04-22 18:43:50 +0000 |
commit | a1a7ae4cf77b4161b6874e60ab06078bf4e6f081 (patch) | |
tree | f52e4417fcb65c84a0b103bee2925a0f23a781f8 | |
parent | 85b9f915e96241eb8ccb44d7b963b44fc44baa08 (diff) | |
download | puppet-a1a7ae4cf77b4161b6874e60ab06078bf4e6f081.tar.gz puppet-a1a7ae4cf77b4161b6874e60ab06078bf4e6f081.tar.xz puppet-a1a7ae4cf77b4161b6874e60ab06078bf4e6f081.zip |
moving to the language tree
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@212 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | examples/assignments | 1 | ||||
-rw-r--r-- | examples/code.bl | 1 | ||||
-rw-r--r-- | examples/code/file.bl | 7 | ||||
-rw-r--r-- | examples/cron2.bl | 57 | ||||
-rw-r--r-- | examples/events.bl | 36 | ||||
-rw-r--r-- | examples/facts | 47 | ||||
-rw-r--r-- | examples/objects | 25 | ||||
-rw-r--r-- | examples/one.bl | 30 | ||||
-rwxr-xr-x | examples/root/bin/sleeper | 97 | ||||
-rw-r--r-- | examples/root/etc/configfile | 0 | ||||
-rw-r--r-- | examples/root/etc/debian-passwd | 29 | ||||
-rw-r--r-- | examples/root/etc/debian-syslog.conf | 71 | ||||
-rwxr-xr-x | examples/root/etc/init.d/sleeper | 27 | ||||
-rw-r--r-- | examples/service.bl | 52 |
14 files changed, 0 insertions, 480 deletions
diff --git a/examples/assignments b/examples/assignments deleted file mode 100644 index d21895392..000000000 --- a/examples/assignments +++ /dev/null @@ -1 +0,0 @@ -name = "value" diff --git a/examples/code.bl b/examples/code.bl deleted file mode 100644 index 782991582..000000000 --- a/examples/code.bl +++ /dev/null @@ -1 +0,0 @@ -$var = "funtest"; diff --git a/examples/code/file.bl b/examples/code/file.bl deleted file mode 100644 index 220a727b9..000000000 --- a/examples/code/file.bl +++ /dev/null @@ -1,7 +0,0 @@ -# $Id$ - -file["/etc/sudoers"] { - :owner => "root" - :group => "root" - :mode => "0440" -} diff --git a/examples/cron2.bl b/examples/cron2.bl deleted file mode 100644 index 61d48b4dc..000000000 --- a/examples/cron2.bl +++ /dev/null @@ -1,57 +0,0 @@ -# $Id: cron2.bl,v 1.1 2003/06/19 06:29:53 luke Exp $ - -# some data definitions - -# this kind of sucks because i have two very different syntaxes: -# one for inside the object, and one for outside -# that doesn't really seem to make sense..... - -# is there a way around it? can i scope all variables automatically -# inside the objects? - -# there's a difference between a collector that joins members of an object -# and a collector that joins multiple objects together, right? -cron("cfengine") = { - comment => "This is cfengine"; - command => "/usr/local/sbin/cfexecd -F"; - minute => ( 0,30 ); - user => user("root") || "root"; # this sucks -}; - -# this is less pure, but it's less muddy at the same time, somehow -# hmmm -cron("cfengine") = { - $comment = "This is cfengine"; - $command = "/usr/local/sbin/cfexecd -F"; - $minute = ( 0,30 ); - $user = user("root") || "root"; # this sucks; is it a code reference? - # a string? i have no idea -}; - -# are these hash members? am i assigning a hash, or filling in the members -# on an object? -chunk("cronjob") = { - separator => "\n"; - requires => cron; - members => (comment || name, command); -}; - -# this ends up abstracting the members -# how do i get to the username now? -# a chunk is formatting for an individual object; there doesn't need to -# be an abstraction -chunk("cronline") = { - separator => " "; - requires => chunk("cronjob"); - members => (minute || "*", hour || "*", mday || "*", month || "*", wday || "*", - command); -}; - -pile("crontab") = { - separator => "\n"; - members => chunk("cronline")->user(user); -}; - -# and then some actual logic, and stuff - - diff --git a/examples/events.bl b/examples/events.bl deleted file mode 100644 index 475d66fab..000000000 --- a/examples/events.bl +++ /dev/null @@ -1,36 +0,0 @@ -load(trigger); - -trigger { - onchange => { - /etc/inetd.conf => process(restart => inetd), - /etc/syslog.conf => process(restart => syslogd), - /etc/syslog-ng.conf => process(restart => syslog-ng), - }, -}; - -load(process); - -process::inetd.binary("/usr/sbin/inetd"); -process::inetd.pattern("inetd"); -process::inetd.arguments("-s -t"); -process::inetd.config("/etc/inet/inetd.conf"); - -# crap, does this get interpreted at run time, set time, or execution time? -# ugh -# and how the hell do I pass that back in to the process? -# basically, the arguments need to be parsed, and then passed to the -# method, but it's the method that knows it's dealing with its own object -process::inetd.start($_.binary, " ", $_.arguments); -process::inetd.restart("/usr/bin/pkill -HUP ", $_.pattern); - -# this is a system-level notification, isn't it? notifies that -# process is now subscribed to this event -# we could have both parts do something; the system is responsible -# for registering the subscription, and the process module is responsible -# for actually dealing with it - -# what i'm trying to say here is "reload inetd if this file changes" -process::inetd.event(filechange($_.config) => $_.restart); -process::inetd.subscribe(filechange.{$_.config} => {$_.restart}); - -*sycamore:: { process(inetd)++ } diff --git a/examples/facts b/examples/facts deleted file mode 100644 index de8d83e6e..000000000 --- a/examples/facts +++ /dev/null @@ -1,47 +0,0 @@ -platform? { - :sunos => { thing("name"){ :param => "value" } } -} - -thing("name") { - :param => platform{ - :sunos => "sunosvalue" - :aix => "aixvalue" - :default => "defaultvalue" - } -} - -thing("name") { - :param => test ? true : false - :param => platform? < - :sunos => "sunosvalue" - :aix => "aixvalue" - hostname?(:myhost) => "hostvalue" - > - true : false -} - -string = case platform - when :sunos then "sunosvalue" - when :aix then "aixvalue" - when :aix then "aixvalue" -end - -string = platform ? { - :sunos => :value1 - :aix => :value2 - :hpux => :value3 -} - -if platform == :sunos then "sunosvalue" -string = Fact["platform"] ? { - :sunos => "sunosvalue" -} - -platform = retrieve("platform") - - ----------------------- - / :sunos => :sunosvalue \ -string = platform? < :aix => :aixvalue > - \ :hpux => :hpuxvalue / - ----------------------- - diff --git a/examples/objects b/examples/objects deleted file mode 100644 index 4c4e6cf8b..000000000 --- a/examples/objects +++ /dev/null @@ -1,25 +0,0 @@ -type = filetype["colon-separated"] { - :recordseparator => "\n" - :fieldseparator => "\n" - :fields = %{name password uid gid ....} - :namefield = "name" -} - -passwd = filetype["colon-separated"].new("/etc/passwd") -shadow = filetype["colon-separated"].new("/etc/shadow") - -user = jointype { - passwd => "name" - shadow => "name" -} - -passwd = type["/etc/passwd"] - - -user.new() - - -passwd["yaytest"] = { - :uid => 100 - ... -} diff --git a/examples/one.bl b/examples/one.bl deleted file mode 100644 index 428372dd9..000000000 --- a/examples/one.bl +++ /dev/null @@ -1,30 +0,0 @@ -#!/home/luke/cvs/blink/bin/blink - -# okay, we'll have a constraint system later, and it will look something like -# the following: - -# Constraint.isbinary = sub { |path| -x path } -# binary.constrain(isbinary) -# protocol.constrain { |string| -# string == "udp" || string == "tcp" -# } - -class Base { - strings = format - -} - -class Inetd { - strings = wait, endpoint, command, binary, protocol, uid, name - -} - -Inetd::telnet = { - wait => "nowait", - endpoint => "stream", - command => "in.telnetd", - binary => "/usr/sbin/in.telnetd", - protocol => "tcp6", - uid => "root", - name => "telnet", -} diff --git a/examples/root/bin/sleeper b/examples/root/bin/sleeper deleted file mode 100755 index 6c1495928..000000000 --- a/examples/root/bin/sleeper +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -w - -### -# sleep indefinitely as a debug - -use strict; -use Getopt::Long; -use Pod::Usage; - -#----------------------------------------------------------------- -sub daemonize -{ - use POSIX 'setsid'; - $| = 1; - chdir '/' or die "Can't chdir to /: $!\n"; - open STDIN, "/dev/null" or die "Can't read /dev/null: $!\n"; - open STDOUT, "> /dev/null" or die "Can't write to /dev/null: $!\n"; - defined(my $pid = fork()) or die "Can't fork: $!\n"; - #print STDERR $pid, "\n"; - exit if $pid; - setsid or die "Can't start a new session: $!\n"; - open STDERR, ">&STDOUT" or die "Can't dup stdout: $!\n"; -} -#----------------------------------------------------------------- - -my ($help,$opt_result,$debug,$fun); - -$opt_result = GetOptions -( - "help" => \$help, - "debug" => \$debug, - "fun" => \$fun, -); - -if (! $opt_result) -{ - pod2usage('-exitval' => 1, '-verbose' => 0); - exit(1); -} - -if ($help) -{ - pod2usage('-exitval' => 1, '-verbose' => 2); - exit; -} - -unless ($debug) { - daemonize(); -} - -while(1){ - sleep 600; -} - -=head1 NAME - -template - this is a template script and should be copied and modded - -=head1 SYNOPSIS - -template [-help] - -=head1 DESCRIPTION - -B<template> is a stub script. - -=head1 OPTIONS - -=over 4 - -=item help - -Prints out help page. - -=back - -B<Example> - -template - -=head1 BUGS - -This script shouldn't be modified, or has apparently not been documented. - -=head1 SEE ALSO - -L<Cat> - -=head1 AUTHOR - -Luke A. Kanies, luke.kanies@cat.com - -=for html <hr> - -I<$Id$> - -=cut diff --git a/examples/root/etc/configfile b/examples/root/etc/configfile deleted file mode 100644 index e69de29bb..000000000 --- a/examples/root/etc/configfile +++ /dev/null diff --git a/examples/root/etc/debian-passwd b/examples/root/etc/debian-passwd deleted file mode 100644 index 59cdf4acf..000000000 --- a/examples/root/etc/debian-passwd +++ /dev/null @@ -1,29 +0,0 @@ -root:x:0:0:root:/root:/bin/bash -daemon:x:1:1:daemon:/usr/sbin:/bin/sh -bin:x:2:2:bin:/bin:/bin/sh -sys:x:3:3:sys:/dev:/bin/sh -sync:x:4:65534:sync:/bin:/bin/sync -games:x:5:60:games:/usr/games:/bin/sh -man:x:6:12:man:/var/cache/man:/bin/sh -lp:x:7:7:lp:/var/spool/lpd:/bin/sh -mail:x:8:8:mail:/var/mail:/bin/sh -news:x:9:9:news:/var/spool/news:/bin/sh -uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh -proxy:x:13:13:proxy:/bin:/bin/sh -postgres:x:31:32:postgres:/var/lib/postgres:/bin/sh -www-data:x:33:33:www-data:/var/www:/bin/sh -backup:x:34:34:backup:/var/backups:/bin/sh -operator:x:37:37:Operator:/var:/bin/sh -list:x:38:38:Mailing List Manager:/var/list:/bin/sh -irc:x:39:39:ircd:/var/run/ircd:/bin/sh -gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh -nobody:x:65534:65534:nobody:/nonexistent:/bin/sh -sshd:x:102:65534::/var/run/sshd:/bin/false -gdm:x:101:101:Gnome Display Manager:/var/lib/gdm:/bin/false -telnetd:x:103:103::/usr/lib/telnetd:/bin/false -nagios:x:1000:1001::/home/nagios: -messagebus:x:104:107::/var/run/dbus:/bin/false -saned:x:109:109::/home/saned:/bin/false -ganglia:x:105:110:Ganglia Monitor:/var/lib/ganglia:/bin/false -zope:x:106:111::/var/lib/zope2.7/var:/bin/false -fbgetty:x:112:112::/home/fbgetty:/bin/false diff --git a/examples/root/etc/debian-syslog.conf b/examples/root/etc/debian-syslog.conf deleted file mode 100644 index 8f2925960..000000000 --- a/examples/root/etc/debian-syslog.conf +++ /dev/null @@ -1,71 +0,0 @@ -# /etc/syslog.conf Configuration file for syslogd. -# -# For more information see syslog.conf(5) -# manpage. - -# -# First some standard logfiles. Log by facility. -# - -auth,authpriv.* /var/log/auth.log -*.*;auth,authpriv.none -/var/log/syslog -#cron.* /var/log/cron.log -daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -lpr.* -/var/log/lpr.log -mail.* -/var/log/mail.log -user.* -/var/log/user.log -uucp.* /var/log/uucp.log - -# -# Logging for the mail system. Split it up so that -# it is easy to write scripts to parse these files. -# -mail.info -/var/log/mail.info -mail.warn -/var/log/mail.warn -mail.err /var/log/mail.err - -# Logging for INN news system -# -news.crit /var/log/news/news.crit -news.err /var/log/news/news.err -news.notice -/var/log/news/news.notice - -# -# Some `catch-all' logfiles. -# -*.=debug;\ - auth,authpriv.none;\ - news.none;mail.none -/var/log/debug -*.=info;*.=notice;*.=warn;\ - auth,authpriv.none;\ - cron,daemon.none;\ - mail,news.none -/var/log/messages - -# -# Emergencies are sent to everybody logged in. -# -*.emerg * - -# -# I like to have messages displayed on the console, but only on a virtual -# console I usually leave idle. -# -#daemon,mail.*;\ -# news.=crit;news.=err;news.=notice;\ -# *.=debug;*.=info;\ -# *.=notice;*.=warn /dev/tty8 - -# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, -# you must invoke `xconsole' with the `-file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -# NOTE: adjust the list below, or you'll go crazy if you have a reasonably -# busy site.. -# -daemon.*;mail.*;\ - news.crit;news.err;news.notice;\ - *.=debug;*.=info;\ - *.=notice;*.=warn |/dev/xconsole - diff --git a/examples/root/etc/init.d/sleeper b/examples/root/etc/init.d/sleeper deleted file mode 100755 index bb3bb4eb7..000000000 --- a/examples/root/etc/init.d/sleeper +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# $Id$ - -script=$0 -path=`echo $script | sed 's/etc..*/bin/'` - -PATH=$PATH:$path - -case "$1" in - start) - sleeper - ;; - stop) - kill `ps -ef | grep -v grep | grep sleeper | grep perl | awk '{print $2}'` - ;; - status) - output=`ps -ef | grep -v grep | grep -v init.d | grep sleeper` - exit $? - ;; - *) - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/examples/service.bl b/examples/service.bl deleted file mode 100644 index 0426ff6ec..000000000 --- a/examples/service.bl +++ /dev/null @@ -1,52 +0,0 @@ -service("ftp") = { - port => "21"; - protocol => "tcp"; - name => "ftp"; - comment => "this protocol sucks"; -}; - -service("telnet") = { - port => "23"; - protocol => "tcp"; - name => "telnet"; -}; - -inetsvc("telnet") = { - port => "telnet"; - protocol => "tcp"; - binary => "/usr/sbin/in.telnetd"; - command => "in.telnetd" -}; - -inetsvc("ftp") = { - port => "ftp"; - protocol => "tcp"; - binary => "/usr/sbin/in.ftpd"; - command => "in.ftpdd" -}; - -chunk("inetdline") = { - separator => " "; - members => (port, protocol, binary, command); -}; - -chunk("inetdset") = { - separator => "\n"; - members => (comment || name); -}; - -# yep, this sucks... -chunk("service") = { - separator => "\n"; - members => (name, protocol . "/" . name, " " * alias || "", "# " . comment || ""); -}; - -pile("inetd") = { - separator => "\n"; - members => chunk("inetdset"); -}; - -pile("services") = { - separator => "\n"; - members => chunk("service"); -}; |