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.

32 satır
996B

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