摘要: 比如我们有这样一个需求,就是需要apache监听自己服务器的ip地址. 这个可以用jinjia模板来实现的. 实现jianjia模板需要三部 1.file状态使用template参数 2.模板文件里面变量使用{{名称}} {{PORT}} 3.变量列表 -default: PORT:8080 示例: 阅读全文
posted @ 2019-03-13 15:35 auxiaoliu 阅读(622) 评论(0) 推荐(0) 编辑
摘要: 这个使用情况是需要在minion上执行命令时用到的. 示例: apache-auth: pkg.installed: - name: httpd-tools cmd.run: -name: htpasswd -bc /etc/httpd/conf/htpasswd_file 但是会遇到一个问题,就是 阅读全文
posted @ 2019-03-13 15:17 auxiaoliu 阅读(704) 评论(0) 推荐(0) 编辑
摘要: 功能名称: requisites 示例: 比如可以更改apache.sls文件,加上require vim apache.sls apache-install: pkg.installed: - name: httpd apache-config: file.managed: - name: /et 阅读全文
posted @ 2019-03-13 14:57 auxiaoliu 阅读(180) 评论(0) 推荐(0) 编辑
摘要: cd /src/salt/lamp vim apache.sls apache-install: pkg.installed: - name: httpd apache-config: file.managed: - name: /etc/httpd/conf/httpd.conf - source 阅读全文
posted @ 2019-03-13 14:42 auxiaoliu 阅读(188) 评论(0) 推荐(0) 编辑
摘要: sls 就是salt state的缩写 sls描述了系统最终应该的状态. 下面体统一个案例: 1 apache: 2 pkg.installed: 3 - name: httpd 4 service.running: 5 - name: httpd 6 file.managed: 7 - name: 阅读全文
posted @ 2019-03-13 11:21 auxiaoliu 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 这里涉及到return模块. 先在如下页面找到config 点进去后倒数第二个 进去后查看返回列表 如下,也就是说salt支持下面这么多的返回方式. 注意这里的返回是minion直接返回给mysql,不是master的返回的. 同时也要注意可以通过设置让master来返回的. 下面是master返回 阅读全文
posted @ 2019-03-13 10:55 auxiaoliu 阅读(398) 评论(0) 推荐(0) 编辑