paulbsd-salt/states/repos/install.sls

47 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-10-01 20:12:26 +02:00
---
{%- from "repos/map.jinja" import repos with context %}
2023-03-10 00:08:54 +01:00
{%- for name,repo in repos.items() %}
2022-10-01 20:12:26 +02:00
{%- if repo.enabled %}
{%- if repo.key_method is defined %}
{%- if repo.key_method == 'file' %}
2023-03-10 00:08:54 +01:00
repo-key-{{ name }}:
2022-10-01 20:12:26 +02:00
file.managed:
2023-03-10 00:08:54 +01:00
- name: /etc/apt/keyrings/{{ name }}
2022-10-01 20:12:26 +02:00
- source: {{ repo.key_url }}
- skip_verify: true
{% endif %}
{% endif %}
2023-03-10 00:08:54 +01:00
repo-{{ name }}:
2022-10-01 20:12:26 +02:00
pkgrepo.managed:
- humanname: {{ repo.humanname }}
2024-02-19 21:24:49 +01:00
{%- if repo.ppa|default(None) %}
- ppa: {{ repo.ppa.src }}
- dist: {{ repo.ppa.dist }}
2022-10-01 20:12:26 +02:00
{%- else %}
2023-03-10 00:08:54 +01:00
- name: deb [signed-by=/etc/apt/keyrings/{{ name }}] {{ repo.src }} {{ repo.suites }} {{ repo.components }}
2022-10-01 20:12:26 +02:00
- gpgcheck: {{ repo.gpgcheck|default(1) }}
- aptkey: false
2023-03-10 00:08:54 +01:00
- file: /etc/apt/sources.list.d/{{ name }}.list
2022-10-01 20:12:26 +02:00
- 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 %}
2023-03-10 00:08:54 +01:00
repo-{{ name }}:
2022-10-01 20:12:26 +02:00
file.absent:
2024-02-20 20:13:54 +01:00
{%- if not repo.ppa|default(None) %}
2023-03-10 00:08:54 +01:00
- name: /etc/apt/sources.list.d/{{ name }}.list
2022-10-01 20:12:26 +02:00
{%- endif %}
{%- endif %}
{%- endfor %}