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.

28 lines
650B

  1. # Template for installing packages.
  2. {% from "php/ng/map.jinja" import php with context %}
  3. {% from "php/ng/macro.jinja" import sls_block %}
  4. {% set pkginfo = php.lookup.pkgs.get(state) %}
  5. {%- if pkginfo is mapping -%}
  6. {%- for pkg, opts in pkginfo.items() -%}
  7. php_install_{{ state }}_{{ pkg }}:
  8. pkg.installed:
  9. {{ sls_block(opts) }}
  10. - name: {{ state }}
  11. {%- endfor -%}
  12. {%- else -%}
  13. {%- if pkginfo is not sequence or pkginfo is string -%}
  14. {% set pkginfo = [pkginfo] %}
  15. {%- endif -%}
  16. php_install_{{ state }}:
  17. pkg.installed:
  18. - name: {{ state }}
  19. - pkgs: {{ php.lookup.pkgs.get(state)|json() }}
  20. {%- endif -%}