diff --git a/php/ng/modules.sls b/php/ng/modules.sls new file mode 100644 index 0000000..d7e4a04 --- /dev/null +++ b/php/ng/modules.sls @@ -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 %}