From 324ebd84af8d0a330c25b50c5542c03c212e673d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Rosada?= Date: Mon, 25 Mar 2019 08:15:05 +0100 Subject: [PATCH 1/4] Add enablerepo option to php-salt-formula --- php/ng/installed.jinja | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/php/ng/installed.jinja b/php/ng/installed.jinja index 5dd4749..fb778ef 100644 --- a/php/ng/installed.jinja +++ b/php/ng/installed.jinja @@ -75,15 +75,15 @@ php_ppa_{{ state }}: {% elif grains['os_family'] == "RedHat" and (state == 'cli' or state == 'fpm' or state == 'php') %} {% set use_scl_repo = salt['pillar.get']('php:use_scl_repo', False) %} {% set scl_php_version = salt['pillar.get']('php:scl_php_version', 71) %} + {% set enable_php_repo = salt['pillar.get']('php:ng:lookup:enable_php_repo', False) %} {% if use_scl_repo and grains['os'] == 'CentOS' %} php_centos_scl_enable_{{ state }}: pkg.installed: - - name: centos-release-scl - {% elif use_scl_repo and grains['os'] == 'RedHat' %} -php_redhat_scl_enable_{{ state }}: - cmd.run: - - name: yum-config-manager --enable rhel-server-rhscl-{{ grains['osmajorrelease'] }}-rpms - {% endif %} + pkg.installed: + - name: {{ state }} + - pkgs: {{ pkgs|json() }} +{% if enable_php_repo %} + - enablerepo: {{ enable_php_repo }} {% endif %} php_install_{{ state }}: From 77b1b3520f8940d7d362264faea64c2e73a88184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Rosada?= Date: Mon, 25 Mar 2019 08:20:33 +0100 Subject: [PATCH 2/4] Add missing php_install_ --- php/ng/installed.jinja | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/php/ng/installed.jinja b/php/ng/installed.jinja index fb778ef..a2530d9 100644 --- a/php/ng/installed.jinja +++ b/php/ng/installed.jinja @@ -79,6 +79,15 @@ php_ppa_{{ state }}: {% if use_scl_repo and grains['os'] == 'CentOS' %} php_centos_scl_enable_{{ state }}: pkg.installed: + - name: centos-release-scl + {% elif use_scl_repo and grains['os'] == 'RedHat' %} +php_redhat_scl_enable_{{ state }}: + cmd.run: + - name: yum-config-manager --enable rhel-server-rhscl-{{ grains['osmajorrelease'] }}-rpms + {% endif %} +{% endif %} + +php_install_{{ state }}: pkg.installed: - name: {{ state }} - pkgs: {{ pkgs|json() }} From 6965059af47667819104e63fef1c2070c9842d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Rosada?= Date: Mon, 25 Mar 2019 08:22:28 +0100 Subject: [PATCH 3/4] Remove copy of php_install_{{ state }} --- php/ng/installed.jinja | 5 ----- 1 file changed, 5 deletions(-) diff --git a/php/ng/installed.jinja b/php/ng/installed.jinja index a2530d9..502059c 100644 --- a/php/ng/installed.jinja +++ b/php/ng/installed.jinja @@ -95,11 +95,6 @@ php_install_{{ state }}: - enablerepo: {{ enable_php_repo }} {% endif %} -php_install_{{ state }}: - pkg.installed: - - name: {{ state }} - - pkgs: {{ pkgs|json() }} - {% for pkg in specials %} php_install_{{ state }}_{{ pkg.get('name') | replace("/", "-") }}: From 1b25ed631e0fd3bc90d0dd664d7ccc16f9ad7270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Rosada?= Date: Tue, 26 Mar 2019 18:53:35 +0100 Subject: [PATCH 4/4] Add documentation --- pillar.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar.example b/pillar.example index 909933a..a2cd342 100644 --- a/pillar.example +++ b/pillar.example @@ -20,7 +20,7 @@ php: # represented, please consider adding it to the map.jinja for # upstream inclusion lookup: - + enable_php_repo: centos-sclo-rh-testing # package definitions, these can be strings, lists of strings, or # lists of dictionaries pkgs: