@@ -1,14 +0,0 @@ | |||
{% if grains['os_family'] == 'Debian' %} | |||
{% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %} | |||
{%- if apt_cacher_ng.server_address %} | |||
{{ apt_cacher_ng.client_config }}: | |||
file: | |||
- managed | |||
- user: root | |||
- group: root | |||
- mode: '644' | |||
- source: salt://apt-cacher/ng/files/client.conf | |||
- template: jinja | |||
{%- endif %} | |||
{% endif %} |
@@ -0,0 +1,20 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
{#- Get the `tplroot` from `tpldir` #} | |||
{%- set tplroot = tpldir.split('/')[0] %} | |||
{%- from tplroot ~ "/ng/map.jinja" import apt_cacher_ng with context %} | |||
{%- if grains['os_family'] == 'Debian' %} | |||
{%- if apt_cacher_ng.server_address %} | |||
apt-cacher-ng/config/client_config: | |||
file.managed: | |||
- name: {{ apt_cacher_ng.client_config }} | |||
- user: root | |||
- group: root | |||
- mode: '644' | |||
- source: salt://apt-cacher/ng/files/client.conf | |||
- template: jinja | |||
{%- endif %} | |||
{%- endif %} |
@@ -0,0 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
include: | |||
- .file |
@@ -0,0 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
include: | |||
- .config |
@@ -1,88 +0,0 @@ | |||
{% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %} | |||
{%- if 'include' in apt_cacher_ng %} | |||
include: | |||
{%- for include_line in apt_cacher_ng.include %} | |||
- {{ include_line }} | |||
{%- endfor %} | |||
{%- 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: | |||
pkg.installed: | |||
- name: {{ apt_cacher_ng.pkg }} | |||
service.running: | |||
- name: {{ apt_cacher_ng.service }} | |||
- enable: True | |||
- watch: | |||
- pkg: {{ apt_cacher_ng.pkg }} | |||
- file: {{ apt_cacher_ng.credentials }} | |||
- file: {{ apt_cacher_ng.server_config }} | |||
- file: {{ apt_cacher_ng.server_cache_dir }} | |||
- file: {{ apt_cacher_ng.server_log_dir }} | |||
{%- if 'require' in apt_cacher_ng %} | |||
- require: | |||
{%- for require in apt_cacher_ng.require %} | |||
- {{ require }} | |||
{%- endfor %} | |||
{%- endif %} | |||
{%- if 'require_in' in apt_cacher_ng %} | |||
- require_in: | |||
{%- for require_in in apt_cacher_ng.require_in %} | |||
- {{ require_in }} | |||
{%- endfor %} | |||
{%- endif %} | |||
{{ apt_cacher_ng.server_config }}: | |||
file.managed: | |||
- user: root | |||
- group: {{ apt_cacher_ng.root_group }} | |||
- mode: '644' | |||
- source: salt://apt-cacher/ng/files/server.conf | |||
- template: jinja | |||
{{ apt_cacher_ng.server_cache_dir }}: | |||
file.directory: | |||
- makedirs: True | |||
- user: {{ apt_cacher_ng.user }} | |||
- group: {{ apt_cacher_ng.group }} | |||
- mode: '2755' | |||
{{ apt_cacher_ng.server_log_dir }}: | |||
file.directory: | |||
- makedirs: True | |||
- user: {{ apt_cacher_ng.user }} | |||
- group: {{ apt_cacher_ng.group }} | |||
- mode: '2755' | |||
{{ apt_cacher_ng.credentials }}: | |||
file.managed: | |||
- user: {{ apt_cacher_ng.user }} | |||
- group: {{ apt_cacher_ng.group }} | |||
- mode: '600' | |||
- source: salt://apt-cacher/ng/files/security.conf | |||
- template: jinja |
@@ -0,0 +1,61 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
{#- Get the `tplroot` from `tpldir` #} | |||
{%- set tplroot = tpldir.split('/')[0] %} | |||
{%- set sls_package_install = tplroot ~ '.ng.server.package.install' %} | |||
{%- from tplroot ~ "/ng/map.jinja" import apt_cacher_ng with context %} | |||
include: | |||
- {{ sls_package_install }} | |||
apt-cacher-ng/group/create: | |||
group.present: | |||
- name: {{ apt_cacher_ng.group }} | |||
apt-cacher-ng/user/create: | |||
user.present: | |||
- name: {{ apt_cacher_ng.user }} | |||
{%- if grains['os_family'] == 'FreeBSD' %} | |||
apt-cacher-ng/user/sysrc: | |||
sysrc.managed: | |||
- name: apt_cacher_ng_user | |||
- value: "{{ apt_cacher_ng.user }}" | |||
{%- endif %} | |||
apt-cacher-ng/config/server_config: | |||
file.managed: | |||
- name: {{ apt_cacher_ng.server_config }} | |||
- user: root | |||
- group: {{ apt_cacher_ng.root_group }} | |||
- mode: '644' | |||
- source: salt://apt-cacher/ng/files/server.conf | |||
- template: jinja | |||
- require: | |||
- sls: {{ sls_package_install }} | |||
apt-cacher-ng/config/server_cache_dir: | |||
file.directory: | |||
- name: {{ apt_cacher_ng.server_cache_dir }} | |||
- makedirs: true | |||
- user: {{ apt_cacher_ng.user }} | |||
- group: {{ apt_cacher_ng.group }} | |||
- mode: '2755' | |||
apt-cacher-ng/config/server_log_dir: | |||
file.directory: | |||
- name: {{ apt_cacher_ng.server_log_dir }} | |||
- makedirs: true | |||
- user: {{ apt_cacher_ng.user }} | |||
- group: {{ apt_cacher_ng.group }} | |||
- mode: '2755' | |||
apt-cacher-ng/config/credentials: | |||
file.managed: | |||
- name: {{ apt_cacher_ng.credentials }} | |||
- user: {{ apt_cacher_ng.user }} | |||
- group: {{ apt_cacher_ng.group }} | |||
- mode: '600' | |||
- source: salt://apt-cacher/ng/files/security.conf | |||
- template: jinja |
@@ -0,0 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
include: | |||
- .file |
@@ -0,0 +1,7 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
include: | |||
- .package | |||
- .config | |||
- .service |
@@ -0,0 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
include: | |||
- .install |
@@ -0,0 +1,10 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
{#- Get the `tplroot` from `tpldir` #} | |||
{%- set tplroot = tpldir.split('/')[0] %} | |||
{%- from tplroot ~ "/ng/map.jinja" import apt_cacher_ng with context %} | |||
apt-cacher-ng/package/install: | |||
pkg.installed: | |||
- name: {{ apt_cacher_ng.pkg }} |
@@ -0,0 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
include: | |||
- .running |
@@ -0,0 +1,33 @@ | |||
# -*- coding: utf-8 -*- | |||
# vim: ft=sls | |||
{#- Get the `tplroot` from `tpldir` #} | |||
{%- set tplroot = tpldir.split('/')[0] %} | |||
{%- set sls_config_file = tplroot ~ '.ng.server.config.file' %} | |||
{%- from tplroot ~ "/ng/map.jinja" import apt_cacher_ng with context %} | |||
include: | |||
- {{ sls_config_file }} | |||
{%- if 'include' in apt_cacher_ng %} | |||
{%- for include_line in apt_cacher_ng.include %} | |||
- {{ include_line }} | |||
{%- endfor %} | |||
{%- endif %} | |||
apt-cacher-ng/service/running: | |||
service.running: | |||
- name: {{ apt_cacher_ng.service }} | |||
- enable: true | |||
- require: | |||
- sls: {{ sls_config_file }} | |||
{%- if 'require' in apt_cacher_ng %} | |||
{%- for require in apt_cacher_ng.require %} | |||
- {{ require }} | |||
{%- endfor %} | |||
{%- endif %} | |||
{%- if 'require_in' in apt_cacher_ng %} | |||
- require_in: | |||
{%- for require_in in apt_cacher_ng.require_in %} | |||
- {{ require_in }} | |||
{%- endfor %} | |||
{%- endif %} |
@@ -63,6 +63,21 @@ Install and configure apt-cacher-ng. | |||
Supports Debian(ish) distributions and FreeBSD. | |||
``apt-cacher.ng.server.package`` | |||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
Installs the apt-cacher-ng package. | |||
``apt-cacher.ng.server.config`` | |||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
Installs the apt-cacher-ng config. | |||
``apt-cacher.ng.server.service`` | |||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
Manages the startup and running state of the apt-cacher-ng service. | |||
``apt-cacher.ng.client`` | |||
^^^^^^^^^^^^^^^^^^^^^^^^ | |||