summaryrefslogtreecommitdiffstats
path: root/salt
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-01-22 20:44:39 +0100
committerGeorg Pfuetzenreuter2023-01-22 20:44:39 +0100
commit5bda75100a638405769764373be32a6115874d12 (patch)
treeadb3fb46a404f34410d45c800e7bfcad5026fe4d /salt
parent2e08c3cf360fe07f3dbe6c6f0951d56ee33c30a3 (diff)
downloadsalt-5bda75100a638405769764373be32a6115874d12.tar.gz
salt-5bda75100a638405769764373be32a6115874d12.tar.bz2
salt-5bda75100a638405769764373be32a6115874d12.zip
Manage LC repository + ca-certificates
manage - home:crameleon:LibertaCasa repository - ca-certificates-syscid in common SUSE state. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'salt')
-rw-r--r--salt/common/suse.sls34
1 files changed, 34 insertions, 0 deletions
diff --git a/salt/common/suse.sls b/salt/common/suse.sls
index 0cfce32..984c25a 100644
--- a/salt/common/suse.sls
+++ b/salt/common/suse.sls
@@ -2,3 +2,37 @@ include:
- profile.seccheck
- profile.zypp
- profile.node_exporter
+
+{#- to-do: move this to some formula or macro -#}
+{%- set osfullname = grains['osfullname'] -%}
+{#- this SLES clause likely only works in BCI -#}
+{%- if osfullname == 'Leap' or osfullname == 'SLES' -%}
+{%- set repoos = grains['osrelease'] -%}
+{%- elif osfullname == 'openSUSE Tumbleweed' -%}
+{%- set repoos = 'openSUSE_Tumbleweed' -%}
+{%- else -%}
+{%- do salt.log.error('Unsupported operating system.') -%}
+{%- endif -%}
+{%- set repobase = 'https://download.opensuse.org/repositories/home:/crameleon:/LibertaCasa/' ~ repoos -%}
+{%- set repokey = repobase ~ '/repodata/repomd.xml.key' %}
+
+libertacasa_rpm_key:
+ cmd.run:
+ - name: rpm --import {{ repokey }}
+ - unless: rpm -q --quiet gpg-pubkey-f8722274-5f7a4d7b
+
+libertacasa_rpm_repository:
+ pkgrepo.managed:
+ - name: 'LibertaCasa'
+ - baseurl: {{ repobase }}
+ - comments:
+ - 'Managed by Salt'
+ - gpgcheck: 1
+ - gpgkey: {{ repokey }}
+ - require:
+ - cmd: libertacasa_rpm_key
+
+ca-certificates-syscid:
+ pkg.installed:
+ - require:
+ - pkgrepo: libertacasa_rpm_repository