Files
salt-states/nginx/init.sls
2020-05-09 00:19:38 -04:00

50 lines
1.0 KiB
Plaintext

nginx:
pkg.installed:
- name: nginx-light
service.running:
- enable: True
- reload: True
{% if salt.pillar.get('use_php', True) %}
{% from "nginx/map.jinja" import php_ver with context %}
{% set timezone = salt.timezone.get_zone() %}
php-fpm:
pkg.installed: []
{% if php_ver is not none %}
service.running:
- name: php{{php_ver}}-fpm
- enable: True
- watch:
- file: php_cgi.fixpathinfo=1
- file: php_date.timezone={{ timezone }}
php_cgi.fixpathinfo=1:
file.uncomment:
- name: /etc/php/{{php_ver}}/fpm/php.ini
- char: ;
- regex: cgi\.fix\_pathinfo\=1
php_date.timezone={{ timezone }}:
file.replace:
- name: /etc/php/{{php_ver}}/fpm/php.ini
- append_if_not_found: True
- pattern: \;date\.timezone.*
- repl: date.timezone = {{ timezone }}
{% else %}
{% do salt.log.error('Could not determine php_ver; might need to re-run state') %}
{% endif %}
{% endif %}
/var/www/html/index.html:
file.managed:
- user: root
- group: root
- mode: 644
- contents: ''