生活随笔
收集整理的這篇文章主要介紹了
saltstack (6) 配置管理(2)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
以源碼安裝haproxy為例,介紹sls 配置
[root@redis01-jp?~]#?tree?/srv/salt/
/srv/salt/
├──?base
│???├──?apache
│???│???└──?init.sls
│???├──?files
│???├──?nginx.sls
│???└──?top.sls
├──?prod
│???├──?haproxy
│???│???├──?files
│???│???│???├──?haproxy-1.7.1.tar.gz
│???│???│???└──?haproxy.init
│???│???└──?init.sls
│???└──?pkg
│???????└──?init.sls
└──?test
8?directories,?7?files
[root@redis01-jp?~]#?cat?/srv/salt/base/top.sls
base:'redis02-jp':-?apache
prod:'redis02-jp':-?haproxy
[root@redis01-jp?~]#?cat?/srv/salt/prod/pkg/init.sls
init:pkg.installed:-?names:-?gcc-?gcc-c++-?glibc-?make-?autoconf-?openssl-?openssl-devel[root@redis01-jp?~]#?cat?/srv/salt/prod/haproxy/init.sls
include:-?pkg
haproxy-install:file.managed:-?name:?/usr/local/src/haproxy-1.7.1.tar.gz-?source:?salt://haproxy/files/haproxy-1.7.1.tar.gz-?user:?root-?group:?root-?mode:?644cmd.run:-?name:?cd?/usr/local/src/?&&?tar?xfz?haproxy-1.7.1.tar.gz?&&?cd?haproxy-1.7.1?&&?make?TARGET=linux26?PREFIX=/usr/local/haproxy?&&?make?install?PREFIX=/usr/local/haproxy-?unless:?test?-d?/usr/local/haproxy-?require:-?pkg:?init-?file:?haproxy-install
haproxy-init:file.managed:-?name:?/etc/init.d/haproxy-?source:?salt://haproxy/files/haproxy.init-?user:?root-?group:?root-?mode:?755-?require:-?cmd:?haproxy-installcmd.run:-?name:?chkconfig?--add?haproxy-?unless:?chkconfig?--list?|grep?haproxy-?require:-?file:?haproxy-init
net.ipv4.ip_nonlocal_bind:sysctl.present:-?value:?1
haproxy-config-dir:file.directory:-?name:?/etc/haproxy-?user:?root-?group:?root-?mode:?755
[root@redis01-jp?~]#
轉載于:https://blog.51cto.com/caiyuanji/1885098
總結
以上是生活随笔為你收集整理的saltstack (6) 配置管理(2)的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。