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.

29 line
926B

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