File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {% from " haproxy/map.jinja" import haproxy with context % }
2+
3+ {% set config_file = salt[' pillar.get' ](' haproxy:config_file_path' , haproxy.config_file) % }
14haproxy.config:
25 file .managed:
3- - name: {{ salt[ ' pillar.get ' ]( ' haproxy:config_file_path ' , ' /etc/haproxy/haproxy.cfg ' ) }}
4- - source: salt:// haproxy/templates/haproxy.jinja
6+ - name: {{ config_file }}
7+ - source: {{ haproxy.config_file_source }}
58 - template: jinja
6- - user: root
9+ - user: {{ haproxy.user }}
710 {% if salt[' grains.get' ](' os_family' ) == ' FreeBSD' % }
811 - group: wheel
912 {% else % }
10- - group: root
13+ - group: {{ haproxy.group }}
1114 {% endif % }
1215 - mode: 644
1316 - require_in:
@@ -16,5 +19,5 @@ haproxy.config:
1619 - service: haproxy.service
1720 {% if salt[' pillar.get' ](' haproxy:overwrite' , default = True ) == False % }
1821 - unless:
19- - test -e {{ salt[ ' pillar.get ' ]( ' haproxy:config_file_path ' , ' /etc/haproxy/haproxy.cfg ' ) }}
22+ - test - e {{ config_file }}
2023 {% endif % }
Original file line number Diff line number Diff line change 1+ {% from " haproxy/map.jinja" import haproxy with context % }
2+
13haproxy.install:
24 pkg.installed:
3- - name: haproxy
5+ - name: {{ haproxy.package }}
46{% if salt[' pillar.get' ](' haproxy:require' ) % }
57 - require:
68{% for item in salt[' pillar.get' ](' haproxy:require' ) % }
Original file line number Diff line number Diff line change 1+ {% set haproxy = salt ['grains.filter_by' ]({
2+ 'Debian' : {
3+ 'package' : 'haproxy' ,
4+ 'config_file' : '/etc/haproxy/haproxy.cfg' ,
5+ 'config_file_source' : 'salt://haproxy/templates/haproxy.jinja' ,
6+ 'user' : 'root' ,
7+ 'group' : 'root' ,
8+ 'service' : 'haproxy' ,
9+ },
10+ }, merge =salt ['pillar.get' ]('haproxy:lookup' )) %}
11+
Original file line number Diff line number Diff line change 1+ {% from " haproxy/map.jinja" import haproxy with context % }
2+
13haproxy.service:
24{% if salt[' pillar.get' ](' haproxy:enable' , True ) % }
35 service.running:
4- - name: haproxy
6+ - name: {{ haproxy.service }}
57 - enable: True
68 - reload : True
79 - require:
You can’t perform that action at this time.
0 commit comments