paulbsd-salt/states/repos/init.sls

33 lines
812 B
Plaintext
Raw Normal View History

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