Browse Source

Add support pillar attr for apt-cacher

tags/v0.5.0
root 10 years ago
parent
commit
3de3ac23bb
3 changed files with 18 additions and 3 deletions
  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 View File

# 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!! # 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 # # This is the config file for apt-cacher. On most Debian systems you can safely #
# leave the defaults alone. # # leave the defaults alone. #
# sufficient permissions within the cache and log directories. Comment the # sufficient permissions within the cache and log directories. Comment the
# settings to run apt-cacher as the invoking user. # 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). # optional setting, binds the listening daemon to specified IP(s).
# #
# Specify an interface name, an IP address or a host name. # Specify an interface name, an IP address or a host name.
# If unset, the default route is used. # If unset, the default route is used.
# #
{%- if apt_cacher.get('interface', 'False') != 'False' %}
interface = {{ apt_cacher.get('interface', 'False') }}
{%- endif %}
#interface = eth0 #interface = eth0


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

+ 7
- 0
apt-cacher/map.jinja View File

{% 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 View File

apt_cacher: apt_cacher:
host: cacher.mycompany.com host: cacher.mycompany.com
admin_email: admin@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: apt_cacher_ng:
# Setting up server_address is the minimal configuration requirement. # Setting up server_address is the minimal configuration requirement.

Loading…
Cancel
Save