From a1a7ae4cf77b4161b6874e60ab06078bf4e6f081 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 22 Apr 2005 18:43:50 +0000 Subject: moving to the language tree git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@212 980ebf18-57e1-0310-9a29-db15c13687c0 --- examples/assignments | 1 - examples/code.bl | 1 - examples/code/file.bl | 7 --- examples/cron2.bl | 57 --------------------- examples/events.bl | 36 ------------- examples/facts | 47 ----------------- examples/objects | 25 ---------- examples/one.bl | 30 ----------- examples/root/bin/sleeper | 97 ------------------------------------ examples/root/etc/configfile | 0 examples/root/etc/debian-passwd | 29 ----------- examples/root/etc/debian-syslog.conf | 71 -------------------------- examples/root/etc/init.d/sleeper | 27 ---------- examples/service.bl | 52 ------------------- 14 files changed, 480 deletions(-) delete mode 100644 examples/assignments delete mode 100644 examples/code.bl delete mode 100644 examples/code/file.bl delete mode 100644 examples/cron2.bl delete mode 100644 examples/events.bl delete mode 100644 examples/facts delete mode 100644 examples/objects delete mode 100644 examples/one.bl delete mode 100755 examples/root/bin/sleeper delete mode 100644 examples/root/etc/configfile delete mode 100644 examples/root/etc/debian-passwd delete mode 100644 examples/root/etc/debian-syslog.conf delete mode 100755 examples/root/etc/init.d/sleeper delete mode 100644 examples/service.bl 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