{% set pkg = salt['grains.filter_by']({ | |||||
'Debian': {'name': 'apache2'}, | |||||
'RedHat': {'name': 'httpd'}, | |||||
}) %} | |||||
{% from "apache/package-map.jinja" import apache with context %} | |||||
apache: | apache: | ||||
pkg: | pkg: | ||||
- installed | - installed | ||||
- name: {{ pkg.name }} | |||||
- name: {{ apache.server }} | |||||
service: | service: | ||||
- running | - running | ||||
- name: {{ pkg.name }} | |||||
- name: {{ apache.service }} | |||||
- enable: True | - enable: True |
{% set apache = salt['grains.filter_by']({ | |||||
'Debian': { | |||||
'server': 'apache2', | |||||
'service': 'apache2', | |||||
'conf': '/etc/apache2/conf.d', | |||||
}, | |||||
'RedHat': { | |||||
'server': 'httpd', | |||||
'service': 'httpd', | |||||
'conf': '/etc/httpd/conf.d', | |||||
}, | |||||
}, merge=salt['pillar.get']('apache:lookup')) %} |
# Example for the apache.debian_full formula: | |||||
# ``apache`` formula configuration: | |||||
apache: | |||||
server: apache2 | |||||
service: apache2 | |||||
conf: /etc/apache2/conf.d | |||||
# ``apache.debian_full`` formula additional configuration: | |||||
apache: | apache: | ||||
php-ini: 'salt://path/to/file/php.ini' | |||||
register-site: | register-site: | ||||
# any name as an array index, and you can duplicate this section | # any name as an array index, and you can duplicate this section | ||||
{{UNQIUE}}: | {{UNQIUE}}: |