Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kharmajbird committed Nov 22, 2012
1 parent 768c476 commit c3943db
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions example.txt
@@ -1,3 +1,17 @@
This example is a transcript of a single run of genpuppet.

Each line is a question and an answer separated by either a "?" or "=>".
See how it simply prompts for user input, and stores the results in
a hash of hashes similar to:

%{ $resource{'package'}{$package_name}{'metaparameter'} }

It doesn't matter what you enter for each prompt, but if you want working
puppet code to be generated, you may wish to enter something syntactically
correct :)



== command line user input ==

# ./genpuppet.pl
Expand Down Expand Up @@ -26,6 +40,54 @@ require => File['alpha']
require => Class['ntp']
require =>
Package name?
Service name? ntp
ensure => running
before =>
require => puppet
require => Service['puppetmaster']
require =>
Service name? cron
ensure => stopped
before => ntpservice
before => Exec['something']
before =>
require => kitchen
require => sink
require =>
Service name?
File path? /etc/sudoers
ensure => file
owner => root
group => root
mode => 0400
source => our source path
content =>
before => Service['ntp']
before =>
require =>
File path?
Exec name? apt-update
command => apt-get update
logoutput => yes
onlyif => test -f /tmp/flag
unless =>
creates =>
before =>
require => Service['ntp']
require => another service
require =>
Exec name? apt-upgrade
command => apt-get upgrade
logoutput => no
onlyif =>
unless =>
creates => /tmp/foo
before => one run
before => second run
before =>
require =>
Exec name?



== generated manuscript ==
Expand Down Expand Up @@ -62,4 +124,52 @@ class myclass {
],
}

service { 'cron':
ensure => stopped,
before => [
ntpservice,
Exec['something'],
],
require => [
kitchen,
sink,
],
}
service { 'ntp':
ensure => running,
require => [
puppet,
Service['puppetmaster'],
],
}

file { '/etc/sudoers':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0400',
source => 'our source path',
before => [
Service['ntp'],
],
}

exec { 'apt-upgrade':
command => 'apt-get upgrade',
logoutput => 'no',
creates => '/tmp/foo',
before => [
one run,
second run,
],
}
exec { 'apt-update':
command => 'apt-get update',
logoutput => 'yes',
onlyif => 'test -f /tmp/flag',
require => [
Service['ntp'],
another service,
],
}
}

0 comments on commit c3943db

Please sign in to comment.