Merge pull request #110 from 3flex/patch-1
Improve formatting of README code example
This commit is contained in:
commit
75cdbf4fc6
1 changed files with 31 additions and 31 deletions
62
README.md
62
README.md
|
@ -28,53 +28,53 @@ Puppet modules on this server:
|
||||||
Local sysadmins can also append to the file by just editing /etc/motd.local
|
Local sysadmins can also append to the file by just editing /etc/motd.local
|
||||||
their changes will be incorporated into the puppet managed motd.
|
their changes will be incorporated into the puppet managed motd.
|
||||||
|
|
||||||
<pre>
|
```puppet
|
||||||
# class to setup basic motd, include on all nodes
|
# class to setup basic motd, include on all nodes
|
||||||
class motd {
|
class motd {
|
||||||
$motd = "/etc/motd"
|
$motd = '/etc/motd'
|
||||||
|
|
||||||
concat{$motd:
|
concat { $motd:
|
||||||
owner => root,
|
owner => 'root',
|
||||||
group => root,
|
group => 'root',
|
||||||
mode => '0644',
|
mode => '0644'
|
||||||
}
|
}
|
||||||
|
|
||||||
concat::fragment{"motd_header":
|
concat::fragment{ 'motd_header':
|
||||||
target => $motd,
|
target => $motd,
|
||||||
content => "\nPuppet modules on this server:\n\n",
|
content => "\nPuppet modules on this server:\n\n",
|
||||||
order => 01,
|
order => '01'
|
||||||
}
|
}
|
||||||
|
|
||||||
# local users on the machine can append to motd by just creating
|
# local users on the machine can append to motd by just creating
|
||||||
# /etc/motd.local
|
# /etc/motd.local
|
||||||
concat::fragment{"motd_local":
|
concat::fragment{ 'motd_local':
|
||||||
target => $motd,
|
target => $motd,
|
||||||
source => "/etc/motd.local",
|
source => '/etc/motd.local',
|
||||||
order => 15
|
order => '15'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# used by other modules to register themselves in the motd
|
# used by other modules to register themselves in the motd
|
||||||
define motd::register($content="", $order=10) {
|
define motd::register($content="", $order=10) {
|
||||||
if $content == "" {
|
if $content == "" {
|
||||||
$body = $name
|
$body = $name
|
||||||
} else {
|
} else {
|
||||||
$body = $content
|
$body = $content
|
||||||
}
|
}
|
||||||
|
|
||||||
concat::fragment{"motd_fragment_$name":
|
concat::fragment{ "motd_fragment_$name":
|
||||||
target => "/etc/motd",
|
target => '/etc/motd',
|
||||||
content => " -- $body\n"
|
content => " -- $body\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# a sample apache module
|
# a sample apache module
|
||||||
class apache {
|
class apache {
|
||||||
include apache::install, apache::config, apache::service
|
include apache::install, apache::config, apache::service
|
||||||
|
|
||||||
motd::register{"Apache": }
|
motd::register{ 'Apache': }
|
||||||
}
|
}
|
||||||
</pre>
|
```
|
||||||
|
|
||||||
Detailed documentation of the class options can be found in the
|
Detailed documentation of the class options can be found in the
|
||||||
manifest files.
|
manifest files.
|
||||||
|
|
Loading…
Reference in a new issue