Quellcode durchsuchen

Merge pull request #4 from fessoga5/master

Add support pillar attr for apt-cacher
tags/v0.5.0
Nitin Madhok vor 10 Jahren
Ursprung
Commit
b4ce9009c1
3 geänderte Dateien mit 18 neuen und 3 gelöschten Zeilen
  1. +7
    -3
      apt-cacher/files/apt-cacher.conf
  2. +7
    -0
      apt-cacher/map.jinja
  3. +4
    -0
      pillar.example

+ 7
- 3
apt-cacher/files/apt-cacher.conf Datei anzeigen

@@ -1,5 +1,6 @@
# vim:sts=2 ts=2 sw=2 et ai
{% from "apt-cacher/map.jinja" import apt_cacher with context %}
# This file is managed by Salt, do not edit by hand!!
{% set apt_cacher = pillar.get('apt-cacher', {}) -%}
#################################################################################
# This is the config file for apt-cacher. On most Debian systems you can safely #
# leave the defaults alone. #
@@ -42,8 +43,8 @@ admin_email = {{ apt_cacher.get('admin_email', 'root@localhost') }}
# sufficient permissions within the cache and log directories. Comment the
# settings to run apt-cacher as the invoking user.
#
group = www-data
user = www-data
group = {{ apt_cacher.get('group', 'www-data') }}
user = {{ apt_cacher.get('user', 'www-data') }}

# optional setting, binds the listening daemon to specified IP(s).
#
@@ -112,6 +113,9 @@ user = www-data
# Specify an interface name, an IP address or a host name.
# If unset, the default route is used.
#
{%- if apt_cacher.get('interface', 'False') != 'False' %}
interface = {{ apt_cacher.get('interface', 'False') }}
{%- endif %}
#interface = eth0

# Rate limiting sets the maximum bandwidth in bytes per second to use for

+ 7
- 0
apt-cacher/map.jinja Datei anzeigen

@@ -0,0 +1,7 @@
{% set apt_cacher = salt['grains.filter_by']({
'Debian': {
'group': 'www-data',
'user': 'www-data',
'interface': 'False'
},
}, merge=salt['pillar.get']('apt_cacher')) %}

+ 4
- 0
pillar.example Datei anzeigen

@@ -1,6 +1,10 @@
apt_cacher:
host: cacher.mycompany.com
admin_email: admin@mycompany.com
group: www-data
user: www-data
#ip for upstream connection
interface: 10.10.0.1

apt_cacher_ng:
# Setting up server_address is the minimal configuration requirement.

Laden…
Abbrechen
Speichern