Skip to content

Commit 27ec474

Browse files
authored
Merge pull request #172 from ze42/php_ng_modules
php.ng.modules
2 parents 14bb2b3 + 0e43147 commit 27ec474

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

README.rst

+7
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,13 @@ Disabled on opensuse need server:php:extensions repo
502502
Installs the php-memcached package.
503503
Disabled on opensuse need server:php:extensions repo
504504

505+
``php.ng.module``
506+
--------------------
507+
508+
Calls ``php.ng.<name>`` for each entry in ``php:ng:modules`` if available, or
509+
try to install the matching packages that can be set via from
510+
``php:ng:lookup:pkgs``
511+
505512
``php.ng.mongo``
506513
--------------------
507514

php/ng/modules.sls

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% from "php/ng/map.jinja" import php with context %}
2+
3+
{% set modules = salt['pillar.get']('php:ng:modules') or [] %}
4+
{% set base_name = 'php.ng.' %}
5+
{% set existing_states = salt['cp.list_states']() %}
6+
7+
{% set includes = [] %}
8+
{% set install = [] %}
9+
10+
{% for module in modules %}
11+
{% set state = base_name ~ module %}
12+
{% if state in existing_states %}
13+
{% do includes.append(state) %}
14+
{% else %}
15+
{% do install.append(module) %}
16+
{% endif %}
17+
{% endfor %}
18+
19+
include: {{ includes|json }}
20+
21+
{% for state in install %}
22+
{% include "php/ng/installed.jinja" %}
23+
{% endfor %}

pillar.example

+9
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ php:
178178
'CLI Server':
179179
cli_server_color: 'On'
180180

181+
# List of modules to install via php.ng.modules
182+
modules:
183+
# Calls `php.ng.<name>` if available, or try to install the matching
184+
# packages that can be set via from php:ng:lookup:pkgs
185+
- cli
186+
- fpm
187+
- curl
188+
- mysql
189+
181190
# When using php.ng.apache2 on FreeBSD:
182191
# Set this to False if you're not using apache-formula
183192
use_apache_formula: True

0 commit comments

Comments
 (0)