formula-apt-cacher/apt-cacher/ng/server.sls

47 lines
1.2 KiB
Text
Raw Normal View History

2014-07-06 19:27:51 -04:00
{% if grains['os_family'] == 'Debian' %}
{% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %}
apt-cacher-ng:
2014-12-13 02:19:58 -05:00
pkg.installed:
2014-07-06 19:27:51 -04:00
- name: {{ apt_cacher_ng.pkg }}
2014-12-13 02:19:58 -05:00
service.running:
2014-07-06 19:27:51 -04:00
- 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 }}
{{ apt_cacher_ng.server_config }}:
2014-12-13 02:19:58 -05:00
file.managed:
2014-07-06 19:27:51 -04:00
- user: root
- group: root
- mode: '644'
- source: salt://apt-cacher/ng/files/server.conf
- template: jinja
{{ apt_cacher_ng.server_cache_dir }}:
2014-12-13 02:19:58 -05:00
file.directory:
- makedirs: True
2014-07-06 19:27:51 -04:00
- user: {{ apt_cacher_ng.user }}
- group: {{ apt_cacher_ng.group }}
- mode: '2755'
{{ apt_cacher_ng.server_log_dir }}:
2014-12-13 02:19:58 -05:00
file.directory:
- makedirs: True
2014-07-06 19:27:51 -04:00
- user: {{ apt_cacher_ng.user }}
- group: {{ apt_cacher_ng.group }}
- mode: '2755'
{{ apt_cacher_ng.credentials }}:
2014-12-13 02:19:58 -05:00
file.managed:
2014-07-06 19:27:51 -04:00
- user: {{ apt_cacher_ng.user }}
- group: {{ apt_cacher_ng.group }}
- mode: '600'
- source: salt://apt-cacher/ng/files/security.conf
- template: jinja
{% endif %}