Saltstack Official PHP Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

29 rindas
964B

  1. {% set state = 'cli' %}
  2. {% include "php/ng/installed.jinja" %}
  3. {%- if salt['grains.get']('os_family') == "Debian" %}
  4. {% set current_php = salt['alternatives.show_current']('php') %}
  5. {% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
  6. {% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
  7. {% if 'alternatives_version' in salt['pillar.get']('php:ng') %}
  8. {% set phpng_version = salt['pillar.get']('php:ng:alternatives_version') %}
  9. {% else %}
  10. {% set phpng_version = false %}
  11. {% endif %}
  12. {% else %}
  13. {% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
  14. {% endif %}
  15. {% if phpng_version %}
  16. php_{{ phpng_version }}_link:
  17. alternatives.set:
  18. - name: php
  19. - path: /usr/bin/php{{ phpng_version }}
  20. - require_in:
  21. - pkg: php_install_{{ state }}
  22. - onlyif:
  23. - which php
  24. - test {{ current_php }} != $(which php{{ phpng_version }})
  25. {% endif %}
  26. {% endif %}