From 2c0a0ca63812d3b381aba700652822f01da3d640 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Thu, 14 May 2020 09:19:39 +0200 Subject: [PATCH] expanded packages state --- salt/pillars/hosts/bart.sls | 2 +- salt/pillars/hosts/exsilio.sls | 4 ++-- salt/pillars/packages.sls | 19 ++++++++++--------- salt/states/packages.sls | 10 +++++----- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/salt/pillars/hosts/bart.sls b/salt/pillars/hosts/bart.sls index c795511..d88a437 100644 --- a/salt/pillars/hosts/bart.sls +++ b/salt/pillars/hosts/bart.sls @@ -1,2 +1,2 @@ packages: - weechat: + weechat: { status: installed } diff --git a/salt/pillars/hosts/exsilio.sls b/salt/pillars/hosts/exsilio.sls index dfc34f0..12fef39 100644 --- a/salt/pillars/hosts/exsilio.sls +++ b/salt/pillars/hosts/exsilio.sls @@ -1,6 +1,6 @@ packages: - teams: - rocketchat: + teams: { status: installed } + rocketchat: { status: installed } repositories: msteams: diff --git a/salt/pillars/packages.sls b/salt/pillars/packages.sls index 50cb4c2..9f95f8b 100644 --- a/salt/pillars/packages.sls +++ b/salt/pillars/packages.sls @@ -1,10 +1,11 @@ packages: - vim: - git: - curl: - htop: - terminator: - borgbackup: - go: - nextcloud-client: - keepassxc: + vim: { status: installed } + git: { status: installed } + curl: { status: installed } + tmux: { status: installed } + htop: { status: installed } + terminator: { status: installed } + borgbackup: { status: installed } + go: { status: installed } + nextcloud-client: { status: installed } + keepassxc: { status: installed } diff --git a/salt/states/packages.sls b/salt/states/packages.sls index 143e942..e748573 100644 --- a/salt/states/packages.sls +++ b/salt/states/packages.sls @@ -1,6 +1,6 @@ -{% for pkg in salt['pillar.get']('packages', []) %} -Install {{ pkg }}: - pkg.installed: - - name: {{ pkg }} - - refresh: false +{% for package, args in pillar['packages'].items() %} +{% if args['status'] != 'ignore' %} +{{ package }}: + pkg.{{ args['status'] }} +{% endif %} {% endfor %}