From a126bf658b7c5e29dc37b519b5f4e0cef6ef7858 Mon Sep 17 00:00:00 2001 From: "Adrien \"ze\" Urban" Date: Tue, 2 Apr 2019 14:33:22 +0200 Subject: [PATCH] php.ng.modules: install modules... --- php/ng/modules.sls | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 php/ng/modules.sls 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 %}