# -*- coding: utf-8 -*-
# vim: ft=yaml
---
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.
  # Others options has default sane values (see map.jinja).
  # server_address is the address access by apt-cacher-ng clients.
  # It could be an IPv4 or a FQDN; This address MUST be resolvable by clients.
  server_address: pkgproxy.example.com

  # Server binds to this address.
  # It could be the same value as server_address (in most cases).
  server_bind_address: 192.168.33.10

  server_port: 3142
  server_cache_dir: /var/cache/apt-cacher-ng
  server_log_dir: /var/log/apt-cacher-ng
  server_extra_config: |
    # Workaround apt-cacher-ng 500 Invalid header
    # https://lists.alioth.debian.org/pipermail/apt-cacher-ng-users/2013-September/000082.html
    ReuseConnections: 0

  # Credentials for apt-cacher-ng Web management interface.
  # http://<server_adress>:<server_port>/acng-report.html
  admin_account: root
  admin_passwd: admin

  # HTTPS proxy
  # "special keyword DIRECT meaning to use no proxies"
  #   - https://linux.die.net/man/5/apt.conf
  # Default value ignores proxy for HTTPS connections
  https_proxy: DIRECT

  # Local mirrors don't need a proxy
  # See https://linux.die.net/man/5/apt.conf
  local_mirrors:
    - 192.168.0.1
    - host.example.test

  # Example for require/require_in/include
  # See: https://github.com/saltstack-formulas/apt-cacher-formula/pull/12 for details
  # apt_cacher_ng:
  #   ...
  #   include:
  #     # custom states which must run before apt-cacher.ng.server
  #     - repositories.sources
  #     - apt-cacher-ng-fixes.server
  #   require:
  #     # custom states: i.e. a file which depends on the apt-cacher-ng package,
  #     # but is required by the apt-cacher-ng server.
  #     - 'file: /etc/apt-cacher-ng/backends_debian'
  #   require_in:
  #     # custom states: i.e. Debian package repos
  #     - 'pkgrepo: deb jessie-backports'
  #     - 'pkgrepo: deb-src jessie-backports'

  tofs:
    # The files_switch key serves as a selector for alternative
    # directories under the formula files directory. See TOFS pattern
    # doc for more info.
    # Note: Any value not evaluated by `config.get` will be used literally.
    # This can be used to set custom paths, as many levels deep as required.
    # files_switch:
    #   - any/path/can/be/used/here
    #   - id
    #   - roles
    #   - osfinger
    #   - os
    #   - os_family
    # All aspects of path/file resolution are customisable using the options below.
    # This is unnecessary in most cases; there are sensible defaults.
    # Default path: salt://< path_prefix >/< dirs.files >/< dirs.default >
    #         I.e.: salt://template/files/default
    # path_prefix: template_alt
    # dirs:
    #   files: files_alt
    #   default: default_alt
    # The entries under `source_files` are prepended to the default source files
    # given for the state
    source_files:
      apt-cacher/ng/client/config/file:
        - 'alt_client.conf'
      apt-cacher/ng/server/config/file:
        - 'alt_server.conf'
      apt-cacher/ng/server/config/credentials:
        - 'alt_security.conf'