paulbsd-salt/states/repo/install.sls
Paul Lecuq 565047baa9
All checks were successful
continuous-integration/drone/push Build is passing
updated repo state
2024-02-24 15:23:11 +01:00

47 lines
1.2 KiB
Plaintext

---
{%- from "repo/map.jinja" import repo with context %}
{%- for name,repo in repo.items() %}
{%- if repo.enabled %}
{%- if repo.key_method is defined %}
{%- if repo.key_method == 'file' %}
repo-key-{{ name }}:
file.managed:
- name: /etc/apt/keyrings/{{ name }}
- source: {{ repo.key_url }}
- skip_verify: true
{% endif %}
{% endif %}
repo-{{ name }}:
pkgrepo.managed:
- humanname: {{ repo.humanname }}
{%- if repo.ppa|default(None) %}
- ppa: {{ repo.ppa.src }}
- dist: {{ repo.ppa.dist }}
{%- else %}
- name: deb [signed-by=/etc/apt/keyrings/{{ name }}] {{ repo.src }} {{ repo.suites }} {{ repo.components }}
- gpgcheck: {{ repo.gpgcheck|default(1) }}
- aptkey: false
- file: /etc/apt/sources.list.d/{{ name }}.list
- clean_file: true
{%- if repo.key_method is defined %}
{%- if repo.key_method == 'file' %}
- key_url: {{ repo.key_url }}
{%- elif repo.key_method == 'server' %}
- keyid: {{ repo.keyid }}
- keyserver: {{ repo.keyserver }}
{%- endif %}
{%- endif %}
{%- endif %}
{%- else %}
repo-{{ name }}:
file.absent:
{%- if not repo.ppa|default(None) %}
- name: /etc/apt/sources.list.d/{{ name }}.list
{%- endif %}
{%- endif %}
{%- endfor %}