diff --git a/salt/pillars/hosts/exsilio.sls b/salt/pillars/hosts/exsilio.sls index f186fec..4a2720e 100644 --- a/salt/pillars/hosts/exsilio.sls +++ b/salt/pillars/hosts/exsilio.sls @@ -1,21 +1,10 @@ +includes: + - repos.msteams + packages: teams: { status: installed } rocketchat: { status: installed } -repositories: - msteams: - humanname: Microsoft Teams - baseurl: https://packages.microsoft.com/yumrepos/ms-teams - enabled: True - gpgautoimport: True - refresh: True - google-chrome: - humanname: Google Chrome - baseurl: https://dl.google.com/linux/chrome/rpm/stable/x86_64 - enabled: True - gpgautoimport: True - refresh: True - firefox: addons: Okta Browser Plugin: https://addons.mozilla.org/en-US/firefox/addon/okta-browser-plugin/ diff --git a/salt/pillars/repos/google_chrome.sls b/salt/pillars/repos/google_chrome.sls new file mode 100644 index 0000000..672cb82 --- /dev/null +++ b/salt/pillars/repos/google_chrome.sls @@ -0,0 +1,9 @@ +repositories: + google-chrome: + humanname: google-chrome + baseurl: https://dl.google.com/linux/chrome/rpm/stable/x86_64/ + enabled: True + gpgautoimport: True + gpgkey: /root/google_linux_signing_key.pub + refresh: True + signingkey: google_linux_signing_key.pub diff --git a/salt/pillars/repos/msteams.sls b/salt/pillars/repos/msteams.sls new file mode 100644 index 0000000..96e0909 --- /dev/null +++ b/salt/pillars/repos/msteams.sls @@ -0,0 +1,8 @@ +repositories: + msteams: + humanname: Microsoft Teams + baseurl: https://packages.microsoft.com/yumrepos/ms-teams + enabled: True + gpgautoimport: True + refresh: True + signingkey: microsoft.asc diff --git a/salt/pillars/repositories.sls b/salt/pillars/repositories.sls deleted file mode 100644 index 41a0c5a..0000000 --- a/salt/pillars/repositories.sls +++ /dev/null @@ -1,16 +0,0 @@ -repositories: - google-chrome: - humanname: google-chrome - baseurl: https://dl.google.com/linux/chrome/rpm/stable/x86_64/ - enabled: True - gpgautoimport: True - gpgkey: /root/google_linux_signing_key.pub - refresh: True -{% if grains['os'] == "SUSE" %} - packman: - humanname: packman - baseurl: https://ftp.gwdg.de/pub/linux/misc/packman/suse/{{ grains['oscodename'].replace(" ", "_") }}/ - enabled: True - gpgautoimport: True - refresh: True -{% endif %} diff --git a/salt/pillars/top.sls b/salt/pillars/top.sls index 8841329..c398f99 100644 --- a/salt/pillars/top.sls +++ b/salt/pillars/top.sls @@ -1,12 +1,10 @@ base: '*': - packages - - repositories - vim - firefox - hosts - -#{% if salt['file.file_exists']('hosts/{0}.sls'.format(grains.nodename)) %} -# '{{ grains.nodename }}': -# - hosts.{{ grains.nodename }} -#{% endif %} + - repos.google_chrome + {% if grains['os'] == "SUSE" -%} + - repos.packman + {% endif %} diff --git a/salt/states/repositories.sls b/salt/states/repositories.sls index 2fe9e2d..4b3a580 100644 --- a/salt/states/repositories.sls +++ b/salt/states/repositories.sls @@ -1,17 +1,19 @@ -add the google-chrome signing key: +{% for repo, args in salt['pillar.get']('repositories', {}).items() %} +{% if 'signingkey' in args %} +Add {{ repo }} signing key: file.managed: - - name: /root/google_linux_signing_key.pub - - source: salt://files/google_linux_signing_key.pub + - name: /root/{{ args['signingkey'] }} + - source: salt://files/{{ args['signingkey'] }} - user: root - group: root -import google signing key: +Import {{ repo }} signing key: cmd.run: - - name: rpm --import /root/google_linux_signing_key.pub + - name: rpm --import /root/{{ args['signingkey'] }} - onchanges: - - file: add the google-chrome signing key + - file: Add {{ repo }} signing key +{% endif %} -{% for repo, args in salt['pillar.get']('repositories', {}).items() %} Add {{ repo }} repository: pkgrepo.managed: - name: {{ repo }}