Saltstack Official PHP Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
762B

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