Browse Source

FreeBSD support for apt-cacher.ng.server

tags/v0.5.0^2
Alexander Weidinger 6 years ago
parent
commit
4e61d20af9
4 changed files with 43 additions and 4 deletions
  1. +3
    -1
      README.rst
  2. +1
    -0
      apt-cacher/ng/defaults.yaml
  3. +13
    -0
      apt-cacher/ng/osfamilymap.yaml
  4. +26
    -3
      apt-cacher/ng/server.sls

+ 3
- 1
README.rst View File

``apt-cacher.ng.server`` ``apt-cacher.ng.server``
------- -------


Install and configure apt-cacher-ng
Install and configure apt-cacher-ng.

Supports Debian(ish) distributions and FreeBSD.


``apt-cacher.ng.client`` ``apt-cacher.ng.client``
------------ ------------

+ 1
- 0
apt-cacher/ng/defaults.yaml View File

server_log_dir: /var/log/apt-cacher-ng server_log_dir: /var/log/apt-cacher-ng
user: apt-cacher-ng user: apt-cacher-ng
group: apt-cacher-ng group: apt-cacher-ng
root_group: root
pkg: apt-cacher-ng pkg: apt-cacher-ng
service: apt-cacher-ng service: apt-cacher-ng
credentials: /etc/apt-cacher-ng/security.conf credentials: /etc/apt-cacher-ng/security.conf

+ 13
- 0
apt-cacher/ng/osfamilymap.yaml View File

Debian: {} Debian: {}
FreeBSD:
credentials: /usr/local/etc/apt-cacher-ng/security.conf
root_group: wheel
server_cache_dir: /var/cache/apt-cacher-ng
server_config: /usr/local/etc/apt-cacher-ng/zzz_acng.conf
server_log_dir: /var/log/apt-cacher-ng
service: apt_cacher_ng
##
# We stick to the Debian user name in order to
# further separate apt-cacher-ng from other potentially present
# services running as 'proxy'.
#user: proxy
#group: proxy

+ 26
- 3
apt-cacher/ng/server.sls View File

{% if grains['os_family'] == 'Debian' %}
{% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %} {% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %}


{%- if 'include' in apt_cacher_ng %} {%- if 'include' in apt_cacher_ng %}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}


apt-cacher-ng-group:
group.present:
- name: {{ apt_cacher_ng.group }}
- require:
- pkg: apt-cacher-ng
- watch_in:
- service: apt-cacher-ng

apt-cacher-ng-user:
user.present:
- name: {{ apt_cacher_ng.user }}
- require:
- group: apt-cacher-ng-group
- watch_in:
- service: apt-cacher-ng

{%- if grains['os_family'] == 'FreeBSD' %}
apt-cacher-ng-sysrc-user:
sysrc.managed:
- name: apt_cacher_ng_user
- value: "{{ apt_cacher_ng.user }}"
- watch_in:
- service: apt-cacher-ng
{%- endif %}

apt-cacher-ng: apt-cacher-ng:
pkg.installed: pkg.installed:
- name: {{ apt_cacher_ng.pkg }} - name: {{ apt_cacher_ng.pkg }}
{{ apt_cacher_ng.server_config }}: {{ apt_cacher_ng.server_config }}:
file.managed: file.managed:
- user: root - user: root
- group: root
- group: {{ apt_cacher_ng.root_group }}
- mode: '644' - mode: '644'
- source: salt://apt-cacher/ng/files/server.conf - source: salt://apt-cacher/ng/files/server.conf
- template: jinja - template: jinja
- mode: '600' - mode: '600'
- source: salt://apt-cacher/ng/files/security.conf - source: salt://apt-cacher/ng/files/security.conf
- template: jinja - template: jinja
{% endif %}

Loading…
Cancel
Save