dotfiles/salt/states/repositories.sls

29 lines
810 B
Plaintext
Raw Permalink Normal View History

2020-08-07 08:34:04 +00:00
{% for repo, args in salt['pillar.get']('repositories', {}).items() %}
{% if 'signingkey' in args %}
Add {{ repo }} signing key:
2020-08-04 09:00:19 +00:00
file.managed:
2020-08-07 08:34:04 +00:00
- name: /root/{{ args['signingkey'] }}
- source: salt://files/{{ args['signingkey'] }}
2020-08-04 09:00:19 +00:00
- user: root
- group: root
2020-08-07 08:34:04 +00:00
Import {{ repo }} signing key:
2020-08-04 09:00:19 +00:00
cmd.run:
2020-08-07 08:34:04 +00:00
- name: rpm --import /root/{{ args['signingkey'] }}
2020-08-04 09:00:19 +00:00
- onchanges:
2020-08-07 08:34:04 +00:00
- file: Add {{ repo }} signing key
{% endif %}
2020-08-04 09:00:19 +00:00
Add {{ repo }} repository:
pkgrepo.managed:
- name: {{ repo }}
- humanname: {{ args['humanname'] }}
- baseurl: {{ args['baseurl'] }}
- enabled: {{ args['enabled'] }}
- gpgautoimport: {{ args['gpgautoimport'] }}
- refresh: {{ args['refresh'] }}
2020-08-04 09:00:19 +00:00
{% if 'gpgkey' in args -%}
- gpgkey: {{ args['gpgkey'] }}
{% endif %}
{% endfor %}