[iyunv@sh-web1 ~]# ls /tmp/
test
[iyunv@sh-web1 ~]# puppet apply dire.pp
Notice: Compiled catalog for sh-web1.localdomain in environment production in 0.06 seconds
Notice: /Stage[main]/Main/File[/tmp/test]/ensure: removed
Notice: Finished catalog run in 0.05 seconds
[iyunv@sh-web1 ~]# ls /tmp/
[iyunv@sh-web1 ~]#
[iyunv@sh-web1 ~]# cat link.pp
file {"/tmp/3.pp":
ensure=> link,
target=> '/root/3.pp',
}
[iyunv@sh-web1 ~]# puppet apply link.pp
Notice: Compiled catalog for sh-web1.localdomain in environment production in 0.06 seconds
Notice: /Stage[main]/Main/File[/tmp/3.pp]/ensure: created
Notice: Finished catalog run in 0.03 seconds
[iyunv@sh-web1 ~]# ls /tmp/
3.pp test test..bak
# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1507549594'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Notice: /Stage[main]/Main/Node[base]/File[/tmp/test]/content:
--- /tmp/test2017-10-09 19:02:15.527825330 +0800
+++ /tmp/puppet-file20171009-5104-6zk5y1-02017-10-09 19:46:34.951821641 +0800
@@ -1 +1 @@
-this is test.
\ No newline at end of file
+this is lisi.
\ No newline at end of file
Info: Computing checksum on file /tmp/test
Info: /Stage[main]/Main/Node[base]/File[/tmp/test]: Filebucketed /tmp/test to main with sum 480fc0d368462326386da7bb8ed56ad7
Notice: /Stage[main]/Main/Node[base]/File[/tmp/test]/content: content changed '{md5}480fc0d368462326386da7bb8ed56ad7' to '{md5}b58ff837e1152bf6d13212d1860c1219'
Notice: Finished catalog run in 0.39 seconds
注意:当资源改变时agent更新就会提示备份.
puppet 3.8的版本发现个问题:
master端并未备份到puppet 代码指定的位置:
1
2
3
4
5
6
7
8
9
10
11
12
[iyunv@puppet e]# tree
.
└── 8
└── d
└── 6
└── 1
└── 0
└── f
└── 1e8d610ffbe27bf880c7d734386dbde1
├── contents
└── paths
7 directories, 2 files