This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/apache2/sites-enabled: | |
file: | |
- managed | |
- source salt://LAMP/virtual-hosts.conf.jinja | |
- template: jinja | |
- user: root | |
- group: root | |
- mode: 644 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove 000-default.conf: | |
file.absent: | |
- name: /etc/apache2/sites-enabled/000-default.conf | |
- require: | |
- pkg: apache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/apache2/sites-enabled/000-default.conf | |
file: | |
- managed | |
- absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
master.d/reactor.conf | |
reactor: | |
- 'salt/states/base/nginx_update': | |
- srv/salt/reactor/stop.sls | |
.sls file event | |
disable_server_in_LB: | |
event: | |
- wait | |
- name: salt/states/base/nginx_update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Master Terminal: Successful | |
sudo salt 'LB' cmd.run 'echo "disable server here/salt-minion1" | socat stdio /var/lib/haproxy/stats' | |
Master .sls file: Fail | |
disable server in haproxy: | |
- name: | | |
- tgt: 'LB' | |
echo "disable server here/salt-minion1" | socat stdio /var/lib/haproxy/stats | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reactor.conf, in master.d--- | |
reactor: | |
- salt/states/base/nginx: | |
- /srv/salt/reactor/stop.sls | |
event on web server--- | |
disable_server_in_LB: | |
event: | |
- wait | |
- name: salt/states/base/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disable_server_in_LB: | |
event: | |
- wait | |
- name: salt/states/base/nginx | |
- data: | |
id: {{ salt['grains.get']('host') }} | |
- watch: | |
- service: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disable server in haproxy: | |
cmd.run: | |
- name: | | |
minion=$(hostname) | |
echo "disable server here/$minion" | sudo socat stdio /var/lib/haproxy/stats | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frontend www | |
bind 10.0.2.15:80 | |
default_backend nginx_pool | |
backend nginx_pool | |
balance roundrobin | |
mode tcp | |
server web1 10.0.15.21 check port 80 | |
server web2 10.0.15.22 check port 80 | |
server web3 10.0.15.23 check port 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend nginx_pool | |
balance roundrobin | |
mode tcp | |
{% for server, addr in salt['mine.get']('G@role:webserver and G@env:' ~ env, 'internal_ip', expr_form='compound').items() -%} | |
server {{ server }} {{ addr }}:80 check | |
{% endfor -%} |
NewerOlder