28 lines
642 B
Django/Jinja
28 lines
642 B
Django/Jinja
# Template for installing packages.
|
|
{% from "php/ng/map.jinja" import php with context %}
|
|
{% from "php/ng/macro.jinja" import sls_block %}
|
|
|
|
|
|
{% set pkginfo = php.lookup.pkgs.get(state) %}
|
|
|
|
{%- if pkginfo is mapping -%}
|
|
{%- for pkg, opts in pkginfo.items() -%}
|
|
|
|
php_install_{{ state }}_{{ pkg }}:
|
|
pkg.installed:
|
|
{{ sls_block(opts) }}
|
|
- name: {{ state }}
|
|
|
|
{%- endfor -%}
|
|
{%- else -%}
|
|
{%- if pkginfo is not sequence or is string -%}
|
|
{% set pkginfo = [pkginfo] %}
|
|
{%- endif -%}
|
|
|
|
php_install_{{ state }}:
|
|
pkg.installed:
|
|
- name: {{ state }}
|
|
- pkgs: {{ php.lookup.pkgs.get(state)|json() }}
|
|
|
|
{%- endif -%}
|