###################初始化時定義好的包########################################## include: - pkg.pkg-init ###################HAPROXY安裝########################################### haproxy-install: file.managed: - name: /usr/local/src/haproxy-1.7.2.tar.gz - source: salt://haproxy/files/haproxy-1.7.2.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src/ && tar zxf haproxy-1.7.2.tar.gz && cd haproxy-1.7.2 && make TARGET=linux26 PREFIX=/usr/loc al/haproxy && make install PREFIX=/usr/local/haproxy - unless: test -d /usr/local/haproxy - require: - pkg: 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-install cmd.run: - name: chkconfig --add haproxy - unless: chkconfig --list |grep haproxy - require: - file: /etc/init.d/haproxy net.ipv4.ip_nonlocal_bind: sysctl.present: - value: 1 haproxy-config-dir: file.directory: - name: /etc/haproxy - user: root - group: root - mode: 755
創(chuàng)新互聯(lián)公司主打移動網(wǎng)站、網(wǎng)站制作、做網(wǎng)站、網(wǎng)站改版、網(wǎng)絡(luò)推廣、網(wǎng)站維護(hù)、域名申請、等互聯(lián)網(wǎng)信息服務(wù),為各行業(yè)提供服務(wù)。在技術(shù)實力的保障下,我們?yōu)榭蛻舫兄Z穩(wěn)定,放心的服務(wù),根據(jù)網(wǎng)站的內(nèi)容與功能再決定采用什么樣的設(shè)計。最后,要實現(xiàn)符合網(wǎng)站需求的內(nèi)容、功能與設(shè)計,我們還會規(guī)劃穩(wěn)定安全的技術(shù)方案做保障。
########################haproxy-outside.sls###################################### include: - haproxy.install haproxy-service: file.managed: - name: /etc/haproxy/haproxy.cfg - source: salt://cluster/files/haproxy-outside.cfg - user: root - group: root - mode: 644 cmd.run: - name: useradd -s /sbin/nologin haproxy - onlyif: id haproxy|echo $? service.running: - name: haproxy - enable: True - reload: True - require: - cmd: haproxy-init - watch: - file: haproxy-service
#########################top.sls################################################### base: '*' : - init.env_init prod: 'web12.limingyu.com': - cluster.haproxy-outside 'web13.limingyu.com': - cluster.haproxy-outside