#
# Cookbook Name:: apt_utils
# Attributes:: default
#
# Copyright 2013-2016, whitestar
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# apt conf.
default['apt_utils']['conf']['proxy'] = {
  'sequence' => '80',
  'ftp' => nil,
  'http' => nil,
  'https' => nil,
}

default['apt_utils']['source']['apt_lines'] = [
  'deb http://cdn.debian.net/debian wheezy main contrib non-free',
  'deb http://cdn.debian.net/debian wheezy-updates main contrib',
  'deb http://cdn.debian.net/debian wheezy-backports  main contrib non-free',
  'deb http://security.debian.org/ wheezy/updates main contrib non-free'
  # mirror example.
  #'deb http://ftp.grid.example.com/debian wheezy main contrib non-free',
  #'deb http://ftp.grid.example.com/debian wheezy-updates main contrib',
  #'deb http://ftp.grid.example.com/debian wheezy-backports  main contrib non-free',
  # proxy example.
  #'deb http://ftp.grid.example.com:3142/security.debian.org/ wheezy/updates main contrib non-free'
]

default['apt_utils']['apt-cacher-ng']['CacheDir'] = '/var/cache/apt-cacher-ng'
default['apt_utils']['apt-cacher-ng']['LogDir'] = '/var/log/apt-cacher-ng'
default['apt_utils']['apt-cacher-ng']['SupportDir'] = '/usr/lib/apt-cacher-ng'
default['apt_utils']['apt-cacher-ng']['Port'] = '3142'
# Default: not set, will listen on all interfaces and protocols
default['apt_utils']['apt-cacher-ng']['BindAddress'] = ''
default['apt_utils']['apt-cacher-ng']['UseWrap'] = nil  # '0'(default) or '1' (on)

default['apt_utils']['mirror']['user'] = 'apt-mirror'
default['apt_utils']['mirror']['cron_period'] = '#0 4	* * *'  # default: inactive
default['apt_utils']['mirror']['base_path'] = '/var/spool/apt-mirror'
default['apt_utils']['mirror']['nthreads'] = '20'
default['apt_utils']['mirror']['_tilde'] = '0'
default['apt_utils']['mirror']['country'] = 'us'  # or jp,...
# http://www.debian.org/mirror/official
# https://launchpad.net/ubuntu/+archivemirrors
default['apt_utils']['mirror']['distributions']['debian'] = {
  # default: empty (inactive)
  'code_names' => [
    #'wheezy',
    #'wheezy-updates',
    #'wheezy-backports',
    #'squeeze'
  ],
  'architectures' => [
    'amd64',
    'i386'
    #'src',
  ],
  'components' => [
    'main',
    'contrib',
    'non-free'
  ]
}
default['apt_utils']['mirror']['distribution']['ubuntu'] = {
  # default: empty (inactive)
  'code_names' => [
    #'raring',
    #'raring-updates',
    #'raring-security',
  ],
  'architectures' => [
    'amd64',
    'i386'
    #'src',
  ],
  'components' => [
    'main',
    'universe',
    'multiverse',
    'restricted',
  ]
}


