1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
1
、puppet服务端
Release:RHEL6.
4
HOSTNAME:
TCP/IP:
172.16
.
200.100
/
24
Packages:
puppet-server-
2.7
.
21
-
1
.el6.noarch
mcollective-client-
2.2
.
4
activemq-
5.5
.
0
2
、puppet节点
Release:
8
HOSTNAME:
TCP/IP:
172.16
.
200.101
/
24
Packages:
puppet-
2.7
.
21
-
1
.el5
mcollective-
2.2
.
4
-
1
.el5
3
、puppet节点
Release:
4
HOSTNAME:
TCP/IP:
172.16
.
200.103
/
24
Packages:
puppet-
2.7
.
21
-
1
.el6
mcollective-
2.2
.
4
-
1
.el6
|
1
2
3
4
5
6
7
8
9
10
11
|
class
motd::motd {
package
{ setup:
ensure => present,
}
file{
"/etc/motd"
:
owner =>
"puppet"
,
group =>
"puppet"
,
mode =>
0700
,
source =>
"puppet://$puppetserver/modules/motd/etc/motd"
,
require => Package[
"setup"
],
}
|
1
2
3
4
5
6
7
|
[root@agent1
info:
for
agent1.rsyslog.org
info:
'1378193573'
notice:
as
'{md5}0acb622c16dbdecb670d8920d96bdd30'
notice:
in
0.41
seconds
[root@agent1
-rwx------
1
puppet puppet
82
Sep
3
15
:
33
/etc/motd
|
1
2
3
4
5
6
7
8
|
class
motd::file2 {
file{
"/etc/file2"
:
owner =>
"puppet"
,
group =>
"puppet"
,
ensure => link,
target =>
"/etc/passwd"
,
}
}
|
1
2
3
4
5
6
7
|
[root@agent1
info:
for
agent1.rsyslog.org
info:
'1378194373'
notice:
notice:
in
0.07
seconds
[root@agent1
lrwxrwxrwx
1
puppet puppet
11
Sep
3
15
:
46
/etc/file2 -> /etc/passwd
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
class
motd::dir1 {
file{
"/etc/dir1"
:
owner =>
"puppet"
,
group =>
"puppet"
,
mode =>
0700
,
ensure => directory,
recurse =>
true
,
purge =>
true
,
force =>
true
,
ignore =>
"dir2"
,
}
notify {
"This is dir1!"
:
#
true
,
}
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
[root@agent1
info:
for
agent1.rsyslog.org
info:
'1378195554'
notice:
is
dir1!
notice:
is
dir1!]/message: defined
'message'
as
'This is dir1!'
notice:
'root'
to
'puppet'
notice:
'root'
to
'puppet'
notice:
'0755'
to
'0700'
notice:
'root'
to
'system_u'
notice:
'root'
to
'puppet'
notice:
'root'
to
'puppet'
notice:
'0644'
to
'0700'
notice:
'root'
to
'system_u'
notice:
in
0.11
seconds
[root@agent1
[root@agent1
[root@agent1
total
16
drwxrwxrwx
2
puppet puppet
4096
Sep
3
16
:
00
dir2
drwx------
2
puppet puppet
4096
Sep
3
16
:
06
dir3
|
1
2
3
4
5
6
7
8
9
10
11
12
|
class
motd::dir2 {
file{
"/etc/dir2"
:
owner =>
"puppet"
,
group =>
"puppet"
,
mode =>
0700
,
ensure => directory,
recurse =>
true
,
purge =>
true
,
force =>
true
,
ignore =>
"dir1"
,
}
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
[root@agent1
info:
info:
in
/
var
/lib/puppet/lib/facter/my_apply2.rb
info:
in
/
var
/lib/puppet/lib/facter/my_apply1.rb
info:
in
/
var
/lib/puppet/lib/facter/my_apply3.rb
info:
in
/
var
/lib/puppet/lib/facter/backup_date.rb
info:
for
agent1.rsyslog.org
info:
'1378195951'
notice:
notice:
in
0.05
seconds
[root@agent1
[root@agent1
[root@agent1
[root@agent1
[root@agent1
info:
info:
in
/
var
/lib/puppet/lib/facter/my_apply2.rb
info:
in
/
var
/lib/puppet/lib/facter/my_apply1.rb
info:
in
/
var
/lib/puppet/lib/facter/my_apply3.rb
info:
in
/
var
/lib/puppet/lib/facter/backup_date.rb
info:
for
agent1.rsyslog.org
info:
'1378195951'
info:
info:
info:
with
sum d41d8cd98f00b204e9800998ecf8427e
notice:
notice:
in
0.09
seconds
[root@agent1
total
8
drwxr-xr-x
2
root root
4096
Sep
3
16
:
13
dir1
[root@agent1
|