2014-05-20 21:59:25 +02:00
|
|
|
{% set state = 'cli' %}
|
|
|
|
{% include "php/ng/installed.jinja" %}
|
2017-09-01 23:59:43 +02:00
|
|
|
|
2019-07-28 07:05:22 +02:00
|
|
|
include:
|
|
|
|
- php.ng.deprecated
|
|
|
|
|
2017-09-01 23:59:43 +02:00
|
|
|
{%- if salt['grains.get']('os_family') == "Debian" %}
|
|
|
|
{% set current_php = salt['alternatives.show_current']('php') %}
|
2019-04-12 15:55:28 +02:00
|
|
|
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
|
|
|
|
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
|
|
|
|
{% if 'alternatives_version' in salt['pillar.get']('php:ng') %}
|
|
|
|
{% set phpng_version = salt['pillar.get']('php:ng:alternatives_version') %}
|
|
|
|
{% else %}
|
|
|
|
{% set phpng_version = false %}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
2017-09-01 23:59:43 +02:00
|
|
|
{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
|
2019-04-12 15:55:28 +02:00
|
|
|
{% endif %}
|
2017-09-01 23:59:43 +02:00
|
|
|
|
2019-04-12 15:55:28 +02:00
|
|
|
{% if phpng_version %}
|
2017-09-01 23:59:43 +02:00
|
|
|
php_{{ phpng_version }}_link:
|
|
|
|
alternatives.set:
|
|
|
|
- name: php
|
|
|
|
- path: /usr/bin/php{{ phpng_version }}
|
|
|
|
- require_in:
|
|
|
|
- pkg: php_install_{{ state }}
|
|
|
|
- onlyif:
|
|
|
|
- which php
|
|
|
|
- test {{ current_php }} != $(which php{{ phpng_version }})
|
|
|
|
{% endif %}
|
2019-04-12 15:55:28 +02:00
|
|
|
{% endif %}
|