summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'documentation')
-rw-r--r--documentation/index.page5
-rw-r--r--documentation/introduction.page62
-rw-r--r--documentation/languagetutorial.page44
-rw-r--r--documentation/structures.page78
4 files changed, 95 insertions, 94 deletions
diff --git a/documentation/index.page b/documentation/index.page
index 708f1e305..b53dd933e 100644
--- a/documentation/index.page
+++ b/documentation/index.page
@@ -15,8 +15,9 @@ Puppet is a declarative *language* for expressing system configuration, a
*client and server* for distributing it, and a *library* for realizing the
configuration.
-The Puppet [Introduction](intro.html) covers the basic architecture and design goals,
-including whether and why you should be using Puppet on your network.
+The Puppet [Introduction](introduction.html) covers the basic architecture and
+design goals, including whether and why you should be using Puppet on your
+network.
Installation
diff --git a/documentation/introduction.page b/documentation/introduction.page
index 562acfaf9..5604d5133 100644
--- a/documentation/introduction.page
+++ b/documentation/introduction.page
@@ -23,16 +23,16 @@ contains the configuration for all of your nodes, needs to be on the central
server, most likely at `/etc/puppet/manifests/site.pp`.
Start the `puppetmasterd` daemon, and then tell your clients to contact that
-server by specifying `-s <servername>` as arguments to `puppetd`, replacing
-"<servername>" with the name of the server. Alternatively, `puppetd` defaults
-to looking for a server named "puppet", so you can just create a CNAME for
-your server, so that it answers to "puppet".
+server by specifying `-s &lt;servername&gt;` as arguments to `puppetd`,
+replacing "&lt;servername&gt;" with the name of the server. Alternatively,
+`puppetd` defaults to looking for a server named "puppet", so you can just
+create a CNAME for your server, so that it answers to "puppet".
It is a good idea to run both the server and client in verbose mode, enabled
with the `-v` flag, until you are sure everything is working. As each new
client connects, you will need to run `puppetca --list` to list the
-certificates waiting to be signed, and then `puppetca --sign <name>`,
-replacing "<name>" with the name of the client whose certificate you want to
+certificates waiting to be signed, and then `puppetca --sign &lt;name&gt;`,
+replacing "&lt;name&gt;" with the name of the client whose certificate you want to
sign. You can turn on autosigning by creating `/etc/puppet/autosign.conf` and
put the hosts, domains, or IP addresses or ranges that you want to sign in
there.
@@ -44,9 +44,9 @@ of actions, action instances, and instance parameters. Here is how a file
element would look in puppet:
file { "/etc/passwd":
- owner => root,
- group => root,
- mode => 644
+ owner =&gt; root,
+ group =&gt; root,
+ mode =&gt; 644
}
Each instance of a low-level element like ``file`` must have a name parameter
@@ -69,16 +69,16 @@ fundamental unit of association is a 'definition':
# this might change
define sudo(source,group) {
package { sudo:
- version => "1.6.7"
+ version =&gt; "1.6.7"
}
file { "/etc/sudoers":
- source => $source, # parameterization; copy the file from where?
- mode => 440 # the 'file' type converts this appropriately to
+ source =&gt; $source, # parameterization; copy the file from where?
+ mode =&gt; 440 # the 'file' type converts this appropriately to
# octal
}
file { "/usr/sbin/sudo":
- owner => root,
- group => $group
+ owner =&gt; root,
+ group =&gt; $group
}
}
@@ -88,8 +88,8 @@ available within the definition itself.
This definition can now be treated as a type:
sudo {
- group => root,
- source => "http://fileserver/files/sudoers?v=production"
+ group =&gt; root,
+ source =&gt; "http://fileserver/files/sudoers?v=production"
}
One significant difference between definitions and types is that types
@@ -142,7 +142,7 @@ strings don't have be quoted or otherwise marked, but variables must have the
$group = "root"
file { "/etc/sudoers":
- group => $group
+ group =&gt; $group
}
Strings and booleans (``true`` and ``false``) are the only data types; even
@@ -153,8 +153,8 @@ arrays is for implicit iteration:
$files = ["/etc/passwd","/etc/group","/etc/fstab"]
file { $files:
- owner => root,
- group => root
+ owner =&gt; root,
+ group =&gt; root
}
This implicitly iterates across the file list and performs all of the
@@ -203,9 +203,9 @@ mechanism for this is currently called a 'selector'; it is similar to the
trinary operator ``:?``:
$value = $variable ? {
- value1 => setvalue1,
- value2 => setvalue2,
- default => other
+ value1 =&gt; setvalue1,
+ value2 =&gt; setvalue2,
+ default =&gt; other
}
This sets the variable ``$value`` depending on the value of ``$variable``. If
@@ -214,18 +214,18 @@ gets set to ``other``.
The brackets can be in either part of the expression, or not at all:
- $value = $variable ? "value1" => "setvalue1"
+ $value = $variable ? "value1" =&gt; "setvalue1"
A selector that doesn't match a value is a compile error.
These structures are useful for simplistic abstraction across platforms:
file { "/etc/sudoers":
- owner => root,
- group => $operatingsystem ? {
- SunOS => root,
- Linux => root,
- FreeBSD => wheel
+ owner =&gt; root,
+ group =&gt; $operatingsystem ? {
+ SunOS =&gt; root,
+ Linux =&gt; root,
+ FreeBSD =&gt; wheel
}
}
@@ -265,8 +265,8 @@ types can also have non-state parameters which modify how that type instance
behaves:
file { "/bin":
- owner => bin,
- recurse => true
+ owner =&gt; bin,
+ recurse =&gt; true
}
The ``recurse`` parameter to ``file`` does not modify the system itself, it
@@ -307,7 +307,7 @@ considered the name:
isnamevar
end
-With this declaration, ``file { "/tmp/file": }`` is basically equivalent to ``file { path => "/tmp/file" }``.
+With this declaration, ``file { "/tmp/file": }`` is basically equivalent to ``file { path =&gt; "/tmp/file" }``.
See [Creating a Puppet Type](creating-a-puppet-type.html) for more
information.
diff --git a/documentation/languagetutorial.page b/documentation/languagetutorial.page
index 413176b55..15d823e61 100644
--- a/documentation/languagetutorial.page
+++ b/documentation/languagetutorial.page
@@ -16,9 +16,9 @@ abstraction, selection, and overriding capabilities.
For simple elements, we just specify the element type, name, and parameters:
file { "/etc/passwd":
- owner => root,
- group => root,
- mode => 644
+ owner =&gt; root,
+ group =&gt; root,
+ mode =&gt; 644
}
Any machine on which this snippet is executed will use it to verify that the
@@ -31,20 +31,20 @@ For files that vary across systems, it makes sense to create a *symbolic name*
for your element:
file { sshdconfig:
- path => $operatingsystem ? {
- solaris => "/usr/local/etc/ssh/sshd_config",
- default => "/etc/ssh/sshd_config"
+ path =&gt; $operatingsystem ? {
+ solaris =&gt; "/usr/local/etc/ssh/sshd_config",
+ default =&gt; "/etc/ssh/sshd_config"
},
- owner => root,
- group => root,
- mode => 644
+ owner =&gt; root,
+ group =&gt; root,
+ mode =&gt; 644
}
Here we create a symbolic name instead of using the path as the name, and now
we can refer to that element by name elsewhere in the manifest:
service { sshd:
- subscribe => file[sshdconfig]
+ subscribe =&gt; file[sshdconfig]
}
This will cause the ``sshd`` service to get restarted when the ``sshdconfig``
@@ -58,12 +58,12 @@ name, because otherwise the language will assume you are managing separate
elements, which might result in an error in the library:
file { sshdconfig:
- path => "/usr/local/etc/ssh/sshd_config",
- owner => root
+ path =&gt; "/usr/local/etc/ssh/sshd_config",
+ owner =&gt; root
}
file { "/usr/local/etc/ssh/sshd_config":
- owner => sshd
+ owner =&gt; sshd
}
The Puppet parser does not know that these element specifications will attempt
@@ -81,20 +81,20 @@ variable. This will result in an error:
$user = root
file { "/etc/passwd":
- owner => $user
+ owner =&gt; $user
}
$user = bin
file { "/bin":
- owner => $user,
- recurse => true
+ owner =&gt; $user,
+ recurse =&gt; true
}
You will almost always find that you can avoid resetting variable values using
the builtin [conditionals](structures.html#conditionals):
$group = $operatingsystem ? {
- solaris => sysadmin,
- default => wheel
+ solaris =&gt; sysadmin,
+ default =&gt; wheel
}
This is only one assignment, so no errors.
@@ -106,13 +106,13 @@ trees are created as a manifest is parsed. Take the following configuration:
class base {
file { "/etc/issue":
- source => "puppet://server/module/common/issue"
+ source =&gt; "puppet://server/module/common/issue"
}
}
class sub inherits base {
file { "/etc/issue":
- source => "puppet://server/module/mysite/issue"
+ source =&gt; "puppet://server/module/mysite/issue"
}
}
@@ -128,7 +128,7 @@ Puppet elements are normally specified using a lower-case element type. You
can specify default values for a given type using the capitalized form of the
element type, though:
- Exec { path => "/usr/bin:/bin:/usr/sbin:/sbin" }
+ Exec { path =&gt; "/usr/bin:/bin:/usr/sbin:/sbin" }
import "classes/*.pp"
@@ -146,7 +146,7 @@ This can be used for any element type. For instance, CentOS defaults to using
case $operatingsystem {
centos: {
- Package { type => yum }
+ Package { type =&gt; yum }
}
}
diff --git a/documentation/structures.page b/documentation/structures.page
index 74cff0c68..9d0c3ff41 100644
--- a/documentation/structures.page
+++ b/documentation/structures.page
@@ -12,8 +12,8 @@ The basic unit of configuration in Puppet are ``types``. Types model objects
on the computer being managed, and each builtin type has attributes that
determine the final type configuration:
- file { "/etc/passwd": owner => root, mode => 644 }
- package { apache: install => true }
+ file { "/etc/passwd": owner =&gt; root, mode =&gt; 644 }
+ package { apache: install =&gt; true }
Puppet also provides facilities for defining new types as collections of
existing types (see Components below), but there is no syntactic difference
@@ -78,13 +78,13 @@ Functions defined and Classes created within a scope will not be available
outside the scope in which they are created:
define testing {
- file { "/etc/passwd": owner => root }
+ file { "/etc/passwd": owner =&gt; root }
}
class osx {
# override the existing testing definition
define testing {
- file { "/etc/other": owner => root }
+ file { "/etc/other": owner =&gt; root }
}
}
@@ -96,10 +96,10 @@ of ``/file_repository/test-httpd.conf`` to ``/etc/httpd/conf/httpd.conf``:
class webserver {
$filename = "/etc/httpd/conf/httpd.conf"
define httpd_service (config_file) {
- file { $filename : source => $config_file }
+ file { $filename : source =&gt; $config_file }
}
httpd_service { "test_httpd" :
- config_file => "/file_repository/test-httpd.conf"
+ config_file =&gt; "/file_repository/test-httpd.conf"
}
}
@@ -107,7 +107,7 @@ of ``/file_repository/test-httpd.conf`` to ``/etc/httpd/conf/httpd.conf``:
# Components
- define <name>(<param1>,<param2>,...) {...}
+ define <name&gt;(<param1&gt;,<param2&gt;,...) {...}
Definition of fuctions allows the composition of lower level types into higher
level types.
@@ -117,33 +117,33 @@ similarly to variables, by preceding their names with the ``$`` character:
define svnserve(source, path, user = false, password = false) {
file { $path:
- create => directory,
- owner => root,
- group => root
+ create =&gt; directory,
+ owner =&gt; root,
+ group =&gt; root
}
$svncmd = $user ? {
- false => "/usr/bin/svn co --non-interactive $source/$name .",
- default => "/usr/bin/svn co --non-interactive --username $user --password '$password' $source/$name ."
+ false =&gt; "/usr/bin/svn co --non-interactive $source/$name .",
+ default =&gt; "/usr/bin/svn co --non-interactive --username $user --password '$password' $source/$name ."
}
exec { $svncmd:
- cwd => $path,
- require => file[$path],
- creates => "$path/.svn"
+ cwd =&gt; $path,
+ require =&gt; file[$path],
+ creates =&gt; "$path/.svn"
}
}
svnserve { dist:
- source => "https://reductivelabs.com/svn",
- path => "/dist",
- user => "puppet",
- password => "password"
+ source =&gt; "https://reductivelabs.com/svn",
+ path =&gt; "/dist",
+ user =&gt; "puppet",
+ password =&gt; "password"
}
svnserve { "dist/config/apps/puppet":
- source => "https://reductivelabs.com/svn",
- path => "/etc/puppet",
- user => "puppet",
- password => "password"
+ source =&gt; "https://reductivelabs.com/svn",
+ path =&gt; "/etc/puppet",
+ user =&gt; "puppet",
+ password =&gt; "password"
}
Note that calling components results in a unique instance of all contained
@@ -159,7 +159,7 @@ result in an error at run time.
# Server Classes
- class <class_name> [inherits <super_class_name>] { ... }
+ class <class_name&gt; [inherits <super_class_name&gt;] { ... }
Class definitions allow the specification of a hierarchy of server classes; a
host that is a member of a subclass will apply the configuration from the
@@ -173,15 +173,15 @@ each of the subclasses.
# really simple example
class solaris {
file {
- "/etc/passwd": owner => root, group => root, mode => 644;
- "/etc/shadow": owner => root, group => root, mode => 440
+ "/etc/passwd": owner =&gt; root, group =&gt; root, mode =&gt; 644;
+ "/etc/shadow": owner =&gt; root, group =&gt; root, mode =&gt; 440
}
}
class solworkstation inherits solaris {
file {
- "/etc/sudoers": owner => root, group => root, mode => 440;
- "/bin/sudo": owner => root, group => root, mode => 4111
+ "/etc/sudoers": owner =&gt; root, group =&gt; root, mode =&gt; 440;
+ "/bin/sudo": owner =&gt; root, group =&gt; root, mode =&gt; 4111
}
}
@@ -191,7 +191,7 @@ Because ``include`` is a function, any normal value can be used, including
variables and selectors:
include $operatingsystem, $hostname ? {
- myhost => classA, default classB
+ myhost =&gt; classA, default classB
}
## Subclassing
@@ -201,15 +201,15 @@ class is that the subclass can override elements in the parent class:
class unix {
file { "/etc/sudoers":
- owner => root,
- group => root,
- mode => 440
+ owner =&gt; root,
+ group =&gt; root,
+ mode =&gt; 440
}
}
class bsd inherits unix {
file { "/etc/sudoers":
- group => wheel
+ group =&gt; wheel
}
}
@@ -245,7 +245,7 @@ even though there is no code associated with them. The syntax is just like
# Nodes
- node <hostname> { ... }
+ node <hostname&gt; { ... }
Node definitions specify the configuration to apply to a specific node. By
default they are looked for by ``puppetmasterd`` but not by ``puppet``. See
@@ -257,7 +257,7 @@ code inside will only apply to the specified node or nodes:
class webserver { ... }
class dbserver { ... }
- file { "/etc/sudoers": mode => 440 } # apply to everyone
+ file { "/etc/sudoers": mode =&gt; 440 } # apply to everyone
node host1, host2 {
include webserver
@@ -285,11 +285,11 @@ specify a default value:
define testing(os) {
owner = $os ? {
- sunos => adm,
- redhat => bin,
- default => root
+ sunos =&gt; adm,
+ redhat =&gt; bin,
+ default =&gt; root
}
- file { "/some/file": owner => $owner }
+ file { "/some/file": owner =&gt; $owner }
}