diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-16 20:41:23 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-16 20:41:23 +0000 |
commit | e74b8affe2aefcea3294ac4567c76e8a15624b73 (patch) | |
tree | 6e96d8732f65863ef9b1a7310a73a9a457a470e6 /documentation/languagetutorial.page | |
parent | 8273f2176114c670a75d8784280dd97e77892788 (diff) | |
download | puppet-e74b8affe2aefcea3294ac4567c76e8a15624b73.tar.gz puppet-e74b8affe2aefcea3294ac4567c76e8a15624b73.tar.xz puppet-e74b8affe2aefcea3294ac4567c76e8a15624b73.zip |
fixing html markup
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1398 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'documentation/languagetutorial.page')
-rw-r--r-- | documentation/languagetutorial.page | 44 |
1 files changed, 22 insertions, 22 deletions
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 => root, + group => root, + mode => 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 => $operatingsystem ? { + solaris => "/usr/local/etc/ssh/sshd_config", + default => "/etc/ssh/sshd_config" }, - owner => root, - group => root, - mode => 644 + owner => root, + group => root, + mode => 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 => 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 => "/usr/local/etc/ssh/sshd_config", + owner => root } file { "/usr/local/etc/ssh/sshd_config": - owner => sshd + owner => 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 => $user } $user = bin file { "/bin": - owner => $user, - recurse => true + owner => $user, + recurse => 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 => sysadmin, + default => 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 => "puppet://server/module/common/issue" } } class sub inherits base { file { "/etc/issue": - source => "puppet://server/module/mysite/issue" + source => "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 => "/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 => yum } } } |