added salt-cal local states and pillars

This commit is contained in:
Jonas Forsberg 2020-05-09 11:17:42 +02:00
parent 99ff02451d
commit 6ba2a64393
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9
8 changed files with 56 additions and 0 deletions

View File

@ -58,3 +58,7 @@ function ip_to_hex(){
IFS=. read oct1 oct2 oct3 oct4 <<< "$1" IFS=. read oct1 oct2 oct3 oct4 <<< "$1"
printf '0x%02x%02x%02x%02x\n' $oct1 $oct2 $oct3 $oct4 printf '0x%02x%02x%02x%02x\n' $oct1 $oct2 $oct3 $oct4
} }
function salt-call(){
sudo salt-call --local "$@"
}

View File

@ -0,0 +1,10 @@
packages:
teams:
repositories:
msteams:
humanname: Microsoft Teams
baseurl: https://packages.microsoft.com/yumrepos/ms-teams
enabled: True
gpgautoimport: True
refresh: True

View File

@ -0,0 +1,6 @@
packages:
vim:
git:
curl:
htop:
terminator:

View File

@ -0,0 +1,9 @@
{% if grains['lsb_distrib_id'] == "openSUSE Leap" %}
repositories:
packman:
humanname: packman
baseurl: https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_{{ grains['lsb_distrib_release'] }}/
enabled: True
gpgautoimport: True
refresh: True
{% endif %}

7
salt/pillars/top.sls Normal file
View File

@ -0,0 +1,7 @@
base:
'*':
- packages
- repositories
'exsilio':
- hosts.exsilio

6
salt/states/packages.sls Normal file
View File

@ -0,0 +1,6 @@
{% for pkg in salt['pillar.get']('packages', []) %}
Install {{ pkg }}:
pkg.installed:
- name: {{ pkg }}
- refresh: false
{% endfor %}

View File

@ -0,0 +1,10 @@
{% for repo, args in salt['pillar.get']('repositories', {}).items() %}
Add {{ repo }} repository:
pkgrepo.managed:
- name: {{ repo }}
- humanname: {{ args['humanname'] }}
- baseurl: {{ args['baseurl'] }}
- enabled: {{ args['enabled'] }}
- gpgautoimport: {{ args['gpgautoimport'] }}
- refresh: {{ args['refresh'] }}
{% endfor %}

4
salt/states/top.sls Normal file
View File

@ -0,0 +1,4 @@
base:
'*':
- repositories
- packages