From b2c07443cafab297cac7ed20db4316a71168ef60 Mon Sep 17 00:00:00 2001 From: Alexandre Anriot Date: Fri, 19 Oct 2018 14:20:22 +0200 Subject: [PATCH] Allow installation of multiple packages --- nginx/ng/pkg.sls | 7 +++++++ pillar.example | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nginx/ng/pkg.sls b/nginx/ng/pkg.sls index 6407ef7..b68cd1b 100644 --- a/nginx/ng/pkg.sls +++ b/nginx/ng/pkg.sls @@ -24,7 +24,14 @@ nginx_install: pkg.installed: {{ sls_block(nginx.package.opts) }} + {% if nginx.lookup.package is iterable and nginx.lookup.package is not string %} + - pkgs: + {% for pkg in nginx.lookup.package %} + - {{ pkg }} + {% endfor %} + {% else %} - name: {{ nginx.lookup.package }} + {% endif %} {% if salt['grains.get']('os_family') == 'Debian' %} nginx_official_repo: diff --git a/pillar.example b/pillar.example index 310daec..c326d9c 100644 --- a/pillar.example +++ b/pillar.example @@ -44,7 +44,7 @@ nginx: # These are usually set by grains in map.jinja # Typically you can comment these out. lookup: - package: nginx-custom + package: nginx-custom (can be a list) service: nginx webuser: www-data conf_file: /etc/nginx/nginx.conf