Saltstack Official PHP Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

35 lines
823B

  1. # Manages the php-fpm pools config files
  2. {% from 'php/ng/map.jinja' import php with context %}
  3. {% from "php/ng/macro.jinja" import sls_block, serialize %}
  4. # Simple path concatenation.
  5. {% macro path_join(file, root) -%}
  6. {{ root ~ '/' ~ file }}
  7. {%- endmacro %}
  8. {% set pool_states = [] %}
  9. {% for pool, config in php.fpm.pools.items() %}
  10. {% set state = 'php_fpm_pool_conf_' ~ loop.index0 %}
  11. {% set fpath = path_join(pool, php.lookup.fpm.pools) %}
  12. {{ state }}:
  13. {% if config.enabled %}
  14. file.managed:
  15. {{ sls_block(config.get('opts', {})) }}
  16. - name: {{ fpath }}
  17. - source: salt://php/ng/files/php.ini
  18. - template: jinja
  19. - context:
  20. config: {{ serialize(config.get('settings', {})) }}
  21. {% else %}
  22. file.absent:
  23. - name: {{ fpath }}
  24. {% endif %}
  25. {% do pool_states.append(state) %}
  26. {% endfor %}