-
-
Save duk3luk3/f87e6cbf0ccab360dbdc to your computer and use it in GitHub Desktop.
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
erlacher@vmrbg51:/srv/saltstack$ cat states/keepalived/init.sls | |
install-keepalived: | |
pkg.installed: | |
- name: keepalived | |
write-keepalived-conf: | |
file.managed: | |
- source: salt://keepalived/keepalived.conf.j2 | |
- name: /etc/keepalived/keepalived.conf | |
- template: jinja | |
- context: | |
vrrp: {{ salt['pillar.get']('keepalived') }} | |
write-notify-script: | |
file.managed: | |
- source: salt://keepalived/notify.sh | |
- name: /etc/keepalived/notify.sh | |
{% for instance in salt['pillar.get']('keepalived:vrrp_instances') %} | |
{% if 'track_script' in instance %} | |
write-track-script-{{ instance.name }}: | |
file.managed: | |
- source: salt://keepalived/{{ instance.track_script.script }} | |
- name: /etc/keepalived/{{ instance.track_script.script }} | |
{% endif %} | |
{% endfor %} | |
restart-keepalived: | |
service.running: | |
- name: keepalived | |
- enable: True | |
- watch: | |
- file: write-keepalived-conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment