如果存在特定文件就不执行,例如不存在/etc/nginx目录就安装nginx:
nginx:
pkg:
- name: nginx
- installed
- unless: test -d /etc/nginx
只有存在特定文件才执行,如存在/etc/init.d/httpd就删除httpd:
httpd:
pkg:
- name: httpd
- removed
- onlyif: test -f /etc/init.d/httpd
发布时间:April 2, 2015 // 分类:Puppet // No Comments
如果存在特定文件就不执行,例如不存在/etc/nginx目录就安装nginx:
nginx:
pkg:
- name: nginx
- installed
- unless: test -d /etc/nginx
只有存在特定文件才执行,如存在/etc/init.d/httpd就删除httpd:
httpd:
pkg:
- name: httpd
- removed
- onlyif: test -f /etc/init.d/httpd