paulbsd-salt/states/repos/init.sls

36 lines
877 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- for repo in pillar.get('repos') %}
{%- if repo['enabled'] %}
2020-08-30 16:52:10 +02:00
repo-{{ repo['name'] }}:
2020-07-10 00:58:55 +02:00
pkgrepo.managed:
- humanname: {{ repo['humanname'] }}
{%- if repo['ppa'] %}
- ppa: {{ repo['ppasrc'] }}
- dist: {{ repo['dist'] }}
{%- elif not repo['ppa'] %}
- name: {{ repo['src'] }}
2020-08-30 16:52:10 +02:00
- gpgcheck: {{ repo['gpgcheck']|default(1) }}
2020-07-10 00:58:55 +02:00
- file: {{ repo['file'] }}
- clean_file: True
2020-08-30 16:52:10 +02:00
{%- if repo['key_method'] is defined %}
2020-07-10 00:58:55 +02:00
{%- if repo['key_method'] == 'file' %}
- key_url: {{ repo['key_url'] }}
{%- elif repo['key_method'] == 'server' %}
- keyid: {{ repo['keyid'] }}
- keyserver: {{ repo['keyserver'] }}
{%- endif %}
{%- endif %}
2020-08-30 16:52:10 +02:00
{%- endif %}
2020-07-10 00:58:55 +02:00
- refresh: True
{%- else %}
2020-08-30 16:52:10 +02:00
repo-{{ repo['name'] }}:
2020-07-10 00:58:55 +02:00
file.absent:
{%- if not repo['ppa'] %}
- name: {{ repo['file'] }}
{%- endif %}
{%- endif %}
2020-08-30 16:52:10 +02:00
{%- endfor %}