summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-04 18:24:24 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-04 18:24:24 +0000
commit28cee40689440388994a4768bd301ae32c8ecc05 (patch)
treec865ab44f4c9247052cf83de16ffc8ebe8b15e54 /examples
parente0e291332bd4676962a28c7b220ae5c5e9651c0a (diff)
downloadpuppet-28cee40689440388994a4768bd301ae32c8ecc05.tar.gz
Merging the changes from the override-refactor branch. This is a significant rewrite of the parser, but it has little affect on the rest of the code tree.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'examples')
-rw-r--r--examples/code/failers/badclassnoparam10
-rw-r--r--examples/code/failers/badclassparam10
-rw-r--r--examples/code/failers/badcompnoparam9
-rw-r--r--examples/code/failers/badcompparam9
-rw-r--r--examples/code/failers/badtypeparam3
-rw-r--r--examples/code/failers/noobjectrvalue1
-rw-r--r--examples/code/snippets/aliastest.pp16
-rw-r--r--examples/code/snippets/argumentdefaults14
-rw-r--r--examples/code/snippets/casestatement.pp58
-rw-r--r--examples/code/snippets/classheirarchy.pp15
-rw-r--r--examples/code/snippets/classincludes.pp17
-rw-r--r--examples/code/snippets/classpathtest11
-rw-r--r--examples/code/snippets/componentmetaparams.pp11
-rw-r--r--examples/code/snippets/deepclassheirarchy.pp23
-rw-r--r--examples/code/snippets/defineoverrides.pp17
-rw-r--r--examples/code/snippets/dirchmod19
-rw-r--r--examples/code/snippets/emptyclass.pp9
-rw-r--r--examples/code/snippets/emptyexec.pp3
-rw-r--r--examples/code/snippets/failmissingexecpath.pp13
-rw-r--r--examples/code/snippets/falsevalues.pp3
-rw-r--r--examples/code/snippets/filecreate11
-rw-r--r--examples/code/snippets/implicititeration15
-rw-r--r--examples/code/snippets/multipleinstances7
-rw-r--r--examples/code/snippets/namevartest9
-rw-r--r--examples/code/snippets/scopetest13
-rw-r--r--examples/code/snippets/selectorvalues.pp42
-rw-r--r--examples/code/snippets/simpledefaults5
-rw-r--r--examples/code/snippets/simpleselector38
-rw-r--r--examples/code/snippets/singleary.pp19
-rw-r--r--examples/code/snippets/singlequote.pp11
-rw-r--r--examples/code/snippets/singleselector.pp22
-rw-r--r--examples/code/snippets/tag.pp9
-rw-r--r--examples/code/snippets/tagged.pp35
33 files changed, 0 insertions, 507 deletions
diff --git a/examples/code/failers/badclassnoparam b/examples/code/failers/badclassnoparam
deleted file mode 100644
index a0397aacc..000000000
--- a/examples/code/failers/badclassnoparam
+++ /dev/null
@@ -1,10 +0,0 @@
-class comp() {
- file { "/etc/passwd":
- mode => 644
- }
-}
-
-# this argument is invalid, thus we should get a falure
-comp {
- fakearg => "yay"
-}
diff --git a/examples/code/failers/badclassparam b/examples/code/failers/badclassparam
deleted file mode 100644
index 4c9ff6199..000000000
--- a/examples/code/failers/badclassparam
+++ /dev/null
@@ -1,10 +0,0 @@
-class comp(arg1) {
- file { "/etc/passwd":
- mode => 644
- }
-}
-
-# i've specified an arg but it's an invalid one
-comp {
- fakearg => "yay"
-}
diff --git a/examples/code/failers/badcompnoparam b/examples/code/failers/badcompnoparam
deleted file mode 100644
index fd25c9445..000000000
--- a/examples/code/failers/badcompnoparam
+++ /dev/null
@@ -1,9 +0,0 @@
-define comp() {
- file { "/etc/passwd":
- mode => 644
- }
-}
-
-comp {
- fakearg => "yay"
-}
diff --git a/examples/code/failers/badcompparam b/examples/code/failers/badcompparam
deleted file mode 100644
index 346e64b25..000000000
--- a/examples/code/failers/badcompparam
+++ /dev/null
@@ -1,9 +0,0 @@
-define comp($arg1) {
- file { "/etc/passwd":
- mode => 644
- }
-}
-
-comp {
- fakearg => "yay"
-}
diff --git a/examples/code/failers/badtypeparam b/examples/code/failers/badtypeparam
deleted file mode 100644
index 4634f2052..000000000
--- a/examples/code/failers/badtypeparam
+++ /dev/null
@@ -1,3 +0,0 @@
-file { "/etc/passwd":
- fakeparam => 644
-}
diff --git a/examples/code/failers/noobjectrvalue b/examples/code/failers/noobjectrvalue
deleted file mode 100644
index ef6064740..000000000
--- a/examples/code/failers/noobjectrvalue
+++ /dev/null
@@ -1 +0,0 @@
-$variable = file { "/etc/passwd": owner => root }
diff --git a/examples/code/snippets/aliastest.pp b/examples/code/snippets/aliastest.pp
deleted file mode 100644
index 2a8fc9cb9..000000000
--- a/examples/code/snippets/aliastest.pp
+++ /dev/null
@@ -1,16 +0,0 @@
-file { "a file":
- path => "/tmp/aliastest",
- ensure => file
-}
-
-file { "another":
- path => "/tmp/aliastest2",
- ensure => file,
- require => file["a file"]
-}
-
-file { "a third":
- path => "/tmp/aliastest3",
- ensure => file,
- require => file["/tmp/aliastest"]
-}
diff --git a/examples/code/snippets/argumentdefaults b/examples/code/snippets/argumentdefaults
deleted file mode 100644
index eac9dd757..000000000
--- a/examples/code/snippets/argumentdefaults
+++ /dev/null
@@ -1,14 +0,0 @@
-# $Id$
-
-define testargs($file, $mode = 755) {
- file { $file: ensure => file, mode => $mode }
-}
-
-testargs { "testingname":
- file => "/tmp/argumenttest1"
-}
-
-testargs { "testingother":
- file => "/tmp/argumenttest2",
- mode => 644
-}
diff --git a/examples/code/snippets/casestatement.pp b/examples/code/snippets/casestatement.pp
deleted file mode 100644
index 4fcf2e408..000000000
--- a/examples/code/snippets/casestatement.pp
+++ /dev/null
@@ -1,58 +0,0 @@
-# $Id$
-
-$var = "value"
-
-case $var {
- "nope": {
- file { "/tmp/fakefile": mode => 644, ensure => file }
- }
- "value": {
- file { "/tmp/existsfile": mode => 755, ensure => file }
- }
-}
-
-$ovar = "yayness"
-
-case $ovar {
- "fooness": {
- file { "/tmp/nostillexistsfile": mode => 644, ensure => file }
- }
- "booness", "yayness": {
- case $var {
- "nep": {
- file { "/tmp/noexistsfile": mode => 644, ensure => file }
- }
- "value": {
- file { "/tmp/existsfile2": mode => 755, ensure => file }
- }
- }
- }
-}
-
-case $ovar {
- "fooness": {
- file { "/tmp/nostillexistsfile": mode => 644, ensure => file }
- }
- default: {
- file { "/tmp/existsfile3": mode => 755, ensure => file }
- }
-}
-
-$bool = true
-
-case $bool {
- true: {
- file { "/tmp/existsfile4": mode => 755, ensure => file }
- }
-}
-
-$yay = yay
-$a = yay
-$b = boo
-
-case $yay {
- $a: { file { "/tmp/existsfile5": mode => 755, ensure => file } }
- $b: { file { "/tmp/existsfile5": mode => 644, ensure => file } }
- default: { file { "/tmp/existsfile5": mode => 711, ensure => file } }
-
-}
diff --git a/examples/code/snippets/classheirarchy.pp b/examples/code/snippets/classheirarchy.pp
deleted file mode 100644
index 36619d8b9..000000000
--- a/examples/code/snippets/classheirarchy.pp
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id$
-
-class base {
- file { "/tmp/classheir1": ensure => file, mode => 755 }
-}
-
-class sub1 inherits base {
- file { "/tmp/classheir2": ensure => file, mode => 755 }
-}
-
-class sub2 inherits base {
- file { "/tmp/classheir3": ensure => file, mode => 755 }
-}
-
-include sub1, sub2
diff --git a/examples/code/snippets/classincludes.pp b/examples/code/snippets/classincludes.pp
deleted file mode 100644
index 927800599..000000000
--- a/examples/code/snippets/classincludes.pp
+++ /dev/null
@@ -1,17 +0,0 @@
-# $Id$
-
-class base {
- file { "/tmp/classincludes1": ensure => file, mode => 755 }
-}
-
-class sub1 inherits base {
- file { "/tmp/classincludes2": ensure => file, mode => 755 }
-}
-
-class sub2 inherits base {
- file { "/tmp/classincludes3": ensure => file, mode => 755 }
-}
-
-$sub = "sub2"
-
-include sub1, $sub
diff --git a/examples/code/snippets/classpathtest b/examples/code/snippets/classpathtest
deleted file mode 100644
index 68610958b..000000000
--- a/examples/code/snippets/classpathtest
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Id$
-
-define component {
- file { "/tmp/classtest": ensure => file, mode => 755 }
-}
-
-class testing {
- component { "componentname": }
-}
-
-include testing
diff --git a/examples/code/snippets/componentmetaparams.pp b/examples/code/snippets/componentmetaparams.pp
deleted file mode 100644
index 1d2c020c3..000000000
--- a/examples/code/snippets/componentmetaparams.pp
+++ /dev/null
@@ -1,11 +0,0 @@
-file { "/tmp/component1":
- ensure => file
-}
-
-define thing {
- file { $name: ensure => file }
-}
-
-thing { "/tmp/component2":
- require => file["/tmp/component1"]
-}
diff --git a/examples/code/snippets/deepclassheirarchy.pp b/examples/code/snippets/deepclassheirarchy.pp
deleted file mode 100644
index 249e6334d..000000000
--- a/examples/code/snippets/deepclassheirarchy.pp
+++ /dev/null
@@ -1,23 +0,0 @@
-# $Id$
-
-class base {
- file { "/tmp/deepclassheir1": ensure => file, mode => 755 }
-}
-
-class sub1 inherits base {
- file { "/tmp/deepclassheir2": ensure => file, mode => 755 }
-}
-
-class sub2 inherits sub1 {
- file { "/tmp/deepclassheir3": ensure => file, mode => 755 }
-}
-
-class sub3 inherits sub2 {
- file { "/tmp/deepclassheir4": ensure => file, mode => 755 }
-}
-
-class sub4 inherits sub3 {
- file { "/tmp/deepclassheir5": ensure => file, mode => 755 }
-}
-
-include sub4
diff --git a/examples/code/snippets/defineoverrides.pp b/examples/code/snippets/defineoverrides.pp
deleted file mode 100644
index 1b6561668..000000000
--- a/examples/code/snippets/defineoverrides.pp
+++ /dev/null
@@ -1,17 +0,0 @@
-# $Id$
-
-$file = "/tmp/defineoverrides1"
-
-define myfile($mode) {
- file { $name: ensure => file, mode => $mode }
-}
-
-class base {
- myfile { $file: mode => 644 }
-}
-
-class sub inherits base {
- myfile { $file: mode => 755 }
-}
-
-include sub
diff --git a/examples/code/snippets/dirchmod b/examples/code/snippets/dirchmod
deleted file mode 100644
index dc2cc8949..000000000
--- a/examples/code/snippets/dirchmod
+++ /dev/null
@@ -1,19 +0,0 @@
-# $Id$
-
-file {
- "/tmp/dirchmodtesta": ensure => directory;
- "/tmp/dirchmodtesta/testing": ensure => file
-}
-
-file { "/tmp/dirchmodtesta":
- mode => 644, recurse => true
-}
-
-file {
- "/tmp/dirchmodtestb": ensure => directory;
- "/tmp/dirchmodtestb/testing": ensure => file
-}
-
-file { "/tmp/dirchmodtestb":
- mode => 600, recurse => true
-}
diff --git a/examples/code/snippets/emptyclass.pp b/examples/code/snippets/emptyclass.pp
deleted file mode 100644
index 48047e748..000000000
--- a/examples/code/snippets/emptyclass.pp
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id$
-
-define component {
-}
-
-class testing {
-}
-
-include testing
diff --git a/examples/code/snippets/emptyexec.pp b/examples/code/snippets/emptyexec.pp
deleted file mode 100644
index 847a30d18..000000000
--- a/examples/code/snippets/emptyexec.pp
+++ /dev/null
@@ -1,3 +0,0 @@
-exec { "touch /tmp/emptyexectest":
- path => "/usr/bin:/bin"
-}
diff --git a/examples/code/snippets/failmissingexecpath.pp b/examples/code/snippets/failmissingexecpath.pp
deleted file mode 100644
index ca5b25f4c..000000000
--- a/examples/code/snippets/failmissingexecpath.pp
+++ /dev/null
@@ -1,13 +0,0 @@
-define distloc($path) {
- file { "/tmp/exectesting1":
- ensure => file
- }
- exec { "touch $path":
- subscribe => file["/tmp/exectesting1"],
- refreshonly => true
- }
-}
-
-distloc {
- path => "/tmp/execdisttesting",
-}
diff --git a/examples/code/snippets/falsevalues.pp b/examples/code/snippets/falsevalues.pp
deleted file mode 100644
index 2143b79a7..000000000
--- a/examples/code/snippets/falsevalues.pp
+++ /dev/null
@@ -1,3 +0,0 @@
-$value = false
-
-file { "/tmp/falsevalues$value": ensure => file }
diff --git a/examples/code/snippets/filecreate b/examples/code/snippets/filecreate
deleted file mode 100644
index d7972c234..000000000
--- a/examples/code/snippets/filecreate
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Id$
-
-file {
- "/tmp/createatest": ensure => file, mode => 755;
- "/tmp/createbtest": ensure => file, mode => 755
-}
-
-file {
- "/tmp/createctest": ensure => file;
- "/tmp/createdtest": ensure => file;
-}
diff --git a/examples/code/snippets/implicititeration b/examples/code/snippets/implicititeration
deleted file mode 100644
index 6f34cb29c..000000000
--- a/examples/code/snippets/implicititeration
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id$
-
-$files = ["/tmp/iterationatest", "/tmp/iterationbtest"]
-
-file { $files: ensure => file, mode => 755 }
-
-file { ["/tmp/iterationctest", "/tmp/iterationdtest"]:
- ensure => file,
- mode => 755
-}
-
-file {
- ["/tmp/iterationetest", "/tmp/iterationftest"]: ensure => file, mode => 755;
- ["/tmp/iterationgtest", "/tmp/iterationhtest"]: ensure => file, mode => 755;
-}
diff --git a/examples/code/snippets/multipleinstances b/examples/code/snippets/multipleinstances
deleted file mode 100644
index 2f9b3c2e8..000000000
--- a/examples/code/snippets/multipleinstances
+++ /dev/null
@@ -1,7 +0,0 @@
-# $Id$
-
-file {
- "/tmp/multipleinstancesa": ensure => file, mode => 755;
- "/tmp/multipleinstancesb": ensure => file, mode => 755;
- "/tmp/multipleinstancesc": ensure => file, mode => 755;
-}
diff --git a/examples/code/snippets/namevartest b/examples/code/snippets/namevartest
deleted file mode 100644
index dbee1c356..000000000
--- a/examples/code/snippets/namevartest
+++ /dev/null
@@ -1,9 +0,0 @@
-define filetest($mode, $ensure = file) {
- file { $name:
- mode => $mode,
- ensure => $ensure
- }
-}
-
-filetest { "/tmp/testfiletest": mode => 644}
-filetest { "/tmp/testdirtest": mode => 755, ensure => directory}
diff --git a/examples/code/snippets/scopetest b/examples/code/snippets/scopetest
deleted file mode 100644
index 3d3b31d8a..000000000
--- a/examples/code/snippets/scopetest
+++ /dev/null
@@ -1,13 +0,0 @@
-
-$mode = 640
-
-define thing {
- file { "/tmp/scopetest": ensure => file, mode => $mode }
-}
-
-class testing {
- $mode = 755
- thing {}
-}
-
-include testing
diff --git a/examples/code/snippets/selectorvalues.pp b/examples/code/snippets/selectorvalues.pp
deleted file mode 100644
index cd8cf77a7..000000000
--- a/examples/code/snippets/selectorvalues.pp
+++ /dev/null
@@ -1,42 +0,0 @@
-$value1 = ""
-$value2 = true
-$value3 = false
-$value4 = yay
-
-$test = "yay"
-
-$mode1 = $value1 ? {
- "" => 755,
- default => 644
-}
-
-$mode2 = $value2 ? {
- true => 755,
- default => 644
-}
-
-$mode3 = $value3 ? {
- false => 755,
- default => 644
-}
-
-$mode4 = $value4 ? {
- $test => 755,
- default => 644
-}
-
-$mode5 = yay ? {
- $test => 755,
- default => 644
-}
-
-$mode6 = $mode5 ? {
- 755 => 755
-}
-
-file { "/tmp/selectorvalues1": ensure => file, mode => $mode1 }
-file { "/tmp/selectorvalues2": ensure => file, mode => $mode2 }
-file { "/tmp/selectorvalues3": ensure => file, mode => $mode3 }
-file { "/tmp/selectorvalues4": ensure => file, mode => $mode4 }
-file { "/tmp/selectorvalues5": ensure => file, mode => $mode5 }
-file { "/tmp/selectorvalues6": ensure => file, mode => $mode6 }
diff --git a/examples/code/snippets/simpledefaults b/examples/code/snippets/simpledefaults
deleted file mode 100644
index 63d199a68..000000000
--- a/examples/code/snippets/simpledefaults
+++ /dev/null
@@ -1,5 +0,0 @@
-# $Id$
-
-File { mode => 755 }
-
-file { "/tmp/defaulttest": ensure => file }
diff --git a/examples/code/snippets/simpleselector b/examples/code/snippets/simpleselector
deleted file mode 100644
index 8b9bc7292..000000000
--- a/examples/code/snippets/simpleselector
+++ /dev/null
@@ -1,38 +0,0 @@
-# $Id$
-
-$var = "value"
-
-file { "/tmp/snippetselectatest":
- ensure => file,
- mode => $var ? {
- nottrue => 641,
- value => 755
- }
-}
-
-file { "/tmp/snippetselectbtest":
- ensure => file,
- mode => $var ? {
- nottrue => 644,
- default => 755
- }
-}
-
-$othervar = "complex value"
-
-file { "/tmp/snippetselectctest":
- ensure => file,
- mode => $othervar ? {
- "complex value" => 755,
- default => 644
- }
-}
-$anothervar = Yayness
-
-file { "/tmp/snippetselectdtest":
- ensure => file,
- mode => $anothervar ? {
- Yayness => 755,
- default => 644
- }
-}
diff --git a/examples/code/snippets/singleary.pp b/examples/code/snippets/singleary.pp
deleted file mode 100644
index 1a6aebb21..000000000
--- a/examples/code/snippets/singleary.pp
+++ /dev/null
@@ -1,19 +0,0 @@
-# $Id$
-
-file { "/tmp/singleary1":
- ensure => file
-}
-
-file { "/tmp/singleary2":
- ensure => file
-}
-
-file { "/tmp/singleary3":
- ensure => file,
- require => [file["/tmp/singleary1"], file["/tmp/singleary2"]]
-}
-
-file { "/tmp/singleary4":
- ensure => file,
- require => [file["/tmp/singleary1"]]
-}
diff --git a/examples/code/snippets/singlequote.pp b/examples/code/snippets/singlequote.pp
deleted file mode 100644
index dc876a2f8..000000000
--- a/examples/code/snippets/singlequote.pp
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Id$
-
-file { "/tmp/singlequote1":
- ensure => file,
- content => 'a $quote'
-}
-
-file { "/tmp/singlequote2":
- ensure => file,
- content => 'some "\yayness\"'
-}
diff --git a/examples/code/snippets/singleselector.pp b/examples/code/snippets/singleselector.pp
deleted file mode 100644
index 520a14017..000000000
--- a/examples/code/snippets/singleselector.pp
+++ /dev/null
@@ -1,22 +0,0 @@
-$value1 = ""
-$value2 = true
-$value3 = false
-$value4 = yay
-
-$test = "yay"
-
-$mode1 = $value1 ? {
- "" => 755
-}
-
-$mode2 = $value2 ? {
- true => 755
-}
-
-$mode3 = $value3 ? {
- default => 755
-}
-
-file { "/tmp/singleselector1": ensure => file, mode => $mode1 }
-file { "/tmp/singleselector2": ensure => file, mode => $mode2 }
-file { "/tmp/singleselector3": ensure => file, mode => $mode3 }
diff --git a/examples/code/snippets/tag.pp b/examples/code/snippets/tag.pp
deleted file mode 100644
index e6e770dd9..000000000
--- a/examples/code/snippets/tag.pp
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id$
-
-$variable = value
-
-tag yayness, rahness
-
-tag booness, $variable
-
-file { "/tmp/settestingness": ensure => file }
diff --git a/examples/code/snippets/tagged.pp b/examples/code/snippets/tagged.pp
deleted file mode 100644
index e3ca93838..000000000
--- a/examples/code/snippets/tagged.pp
+++ /dev/null
@@ -1,35 +0,0 @@
-# $Id$
-
-tag testing
-tag(funtest)
-
-define tagdefine {
- $path = tagged(tagdefine) ? {
- true => "true", false => "false"
- }
-
- file { "/tmp/taggeddefine$path": ensure => file }
-}
-
-tagdefine {}
-
-$yayness = tagged(yayness) ? {
- true => "true", false => "false"
-}
-
-$funtest = tagged(testing) ? {
- true => "true", false => "false"
-}
-
-$both = tagged(testing, yayness) ? {
- true => "true", false => "false"
-}
-
-$bothtrue = tagged(testing, testing) ? {
- true => "true", false => "false"
-}
-
-file { "/tmp/taggedyayness$yayness": ensure => file }
-file { "/tmp/taggedtesting$funtest": ensure => file }
-file { "/tmp/taggedboth$both": ensure => file }
-file { "/tmp/taggedbothtrue$bothtrue": ensure => file }