file {'/tmp/filetest':
content => "aaa",
ensure => file,
}
ensure => present
file {'/tmp/filetest':
content => "aaa",
}
file {"":
ensure
path
content
}
file {"/tmp/filetest":
content => "wess",
ensure => absent,
}
file {"/tmp/s":ensure => directory,}
删除目录: file {"/tmp/s": ensure => directory,force => true,}
符号连接: file {'/tmp/testfile':ensure => link,target => '/tmp/ssss',}
同步文件
![img_0d2157f444e5eb33370f7c53717e09d2.png](https://i-blog.csdnimg.cn/blog_migrate/9ea439d8b78882b7b0556feaefa5a767.png)
![img_87cdb606c3cf05e910c703324fe254c8.png](https://i-blog.csdnimg.cn/blog_migrate/f2b80880291e2f93e4e802ba80176467.png)
![img_fa58864859715181c642a7d2a6da8ce0.png](https://i-blog.csdnimg.cn/blog_migrate/26e630163b25f09b07fe279392e8c7d8.png)
同步目录
![img_90d92a177138384cc590cbd50b2af74a.png](https://i-blog.csdnimg.cn/blog_migrate/0d450b2c0b95a47efbc6ae3a2ea7300a.png)
recurse true,purge false,服务端文件传到客户端,客户端多的文件不会被删除
recurse true,purge true,服务端和客户端完全相同
recurse remote,只扫描服务端文件,并发送到客户端
recurse => true,recurselimit =>3 同步到第3层
recurse => true,ignore => '.svn',不同步.svn文件
多个目录同步到一个目录sourceselect=>all
![img_f37205b7c14c96826f7d3e2b23619fb8.png](https://i-blog.csdnimg.cn/blog_migrate/8e1dd4ead16b86f9008cd08b4b730ada.png)
同步目录,客户端存在时不覆盖,replace => false