Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php.ng.modules #172

Merged
merged 3 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,13 @@ Disabled on opensuse need server:php:extensions repo
Installs the php-memcached package.
Disabled on opensuse need server:php:extensions repo

``php.ng.module``
--------------------

Calls ``php.ng.<name>`` for each entry in ``php:ng:modules`` if available, or
try to install the matching packages that can be set via from
``php:ng:lookup:pkgs``

``php.ng.mongo``
--------------------

Expand Down
23 changes: 23 additions & 0 deletions php/ng/modules.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% from "php/ng/map.jinja" import php with context %}

{% set modules = salt['pillar.get']('php:ng:modules') or [] %}
{% set base_name = 'php.ng.' %}
{% set existing_states = salt['cp.list_states']() %}

{% set includes = [] %}
{% set install = [] %}

{% for module in modules %}
{% set state = base_name ~ module %}
{% if state in existing_states %}
{% do includes.append(state) %}
{% else %}
{% do install.append(module) %}
{% endif %}
{% endfor %}

include: {{ includes|json }}

{% for state in install %}
{% include "php/ng/installed.jinja" %}
{% endfor %}
9 changes: 9 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ php:
'CLI Server':
cli_server_color: 'On'

# List of modules to install via php.ng.modules
modules:
# Calls `php.ng.<name>` if available, or try to install the matching
# packages that can be set via from php:ng:lookup:pkgs
- cli
- fpm
- curl
- mysql

# When using php.ng.apache2 on FreeBSD:
# Set this to False if you're not using apache-formula
use_apache_formula: True