Browse Source

Merge pull request #31 from arthurlogilab/master

add opts to repo name
tags/v0.7.0
Javier Bértoli 7 years ago
parent
commit
47adb619d5
No account linked to committer's email address
3 changed files with 37 additions and 2 deletions
  1. +3
    -0
      README.rst
  2. +24
    -2
      apt/repositories.sls
  3. +10
    -0
      pillar.example

+ 3
- 0
README.rst View File

@@ -54,6 +54,9 @@ and ``man 5 apt_preferences`` for an explanation about the resulting files struc
Installs ``python-software-properties``
(``$ /usr/bin/apt-add-repository ppa:user/repository``).

``apt.unattended``
------------------
Installs and configures ``unattended-upgrades``

``apt.transports.debtorrent``
-------------------------------

+ 24
- 2
apt/repositories.sls View File

@@ -26,8 +26,30 @@ debian-archive-keyring:
- group: root
- clean: {{ clean_sources_list_d }}



{% for repo, args in repositories.iteritems() %}
{%- set r_arch = '[arch=' ~ args.arch|join(',') ~ ']' if args.arch is defined else '' %}

{% set r_opts = '' %}
{%- set r_arch = 'arch=' ~ args.arch|join(',') if args.arch is defined else '' %}
{% if args.opts is defined %}
{% if args.opts is string %}
{% set r_opts = args.opts %}
{% else %}
{% set r_opts_list = [] %}
{%- for k, v in args.opts.items() %}
{% do r_opts_list.append(k ~ '=' ~ v) %}
{%- endfor %}
{% set r_opts = r_opts_list|join(' ') %}
{% endif %}
{% endif %}

{% if r_arch != '' or r_opts != '' %}
{% set r_options = '[' ~ r_arch ~ ' ' ~ r_opts ~ ' ]' %}
{% else %}
{% set r_options = '' %}
{% endif %}

{%- set r_url = args.url or default_url %}
{%- set r_distro = args.distro or 'stable' %}
{%- set r_comps = args.comps|default(['main'])|join(' ') %}
@@ -38,7 +60,7 @@ debian-archive-keyring:

{{ r_type }} {{ repo }}:
pkgrepo.managed:
- name: {{ r_type }} {{ r_arch }} {{ r_url }} {{ r_distro }} {{ r_comps }}
- name: {{ r_type }} {{ r_options }} {{ r_url }} {{ r_distro }} {{ r_comps }}
- file: {{ sources_list_dir }}/{{ repo }}-{{ type }}.list
{# You can use either keyid+keyserver or key_url. If both are provided
the latter will be used. #}

+ 10
- 0
pillar.example View File

@@ -70,6 +70,16 @@ apt:
arch: [i386, amd64]
keyid: 1C61A2656FB57B7E4DE0F4C1FC918B335044912E
keyserver: hkp://pgp.mit.edu:80
intranet:
distro: stretch
url: http://intranet.example.org
opts: "trusted=yes"
extranet:
distro: stretch
url: https://extranet.example.org
opts:
trusted: 'yes'
another: whatever

preferences:
00-rspamd:

Loading…
Cancel
Save