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.

35 lines
769B

  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. {% set pkgs = [] %}
  6. {% set specials = [] %}
  7. {% if pkginfo is iterable and pkginfo is not string %}
  8. {% for pkg in pkginfo %}
  9. {% if pkg is mapping %}
  10. {% do specials.append(pkg) %}
  11. {% else %}
  12. {% do pkgs.append(pkg) %}
  13. {% endif %}
  14. {% endfor %}
  15. {% else %}
  16. {% do pkgs.append(pkginfo) %}
  17. {% endif %}
  18. php_install_{{ state }}:
  19. pkg.installed:
  20. - name: {{ state }}
  21. - pkgs: {{ pkgs|json() }}
  22. {% for pkg in specials %}
  23. php_install_{{ state }}_{{ pkg.get('name') }}:
  24. pkg.installed:
  25. {{ sls_block(pkg) }}
  26. {% endfor %}