Commit 385952fd authored by Thomas Danielsson's avatar Thomas Danielsson

[debops.apt] Added documentation and other fixes after review.

Also, don't conditionally override defaults.
parent 9e6b2de2
This diff is collapsed.
......@@ -15,8 +15,8 @@ import os
{% set apt__tpl_default_sources = [] %}
{% set apt__tpl_default_sources_map = {} %}
{% set apt__tpl_source_distributions = {} %}
{% for repo in ( apt__host_security_sources,
apt__group_security_sources,
{% for repo in ( apt__host_security_sources +
apt__group_security_sources +
apt__security_sources ) %}
{% set _ = apt__tpl_security_sources.extend(
debops__tpl_macros.flattened(
......
......@@ -11,7 +11,9 @@ Default configuration
Role tries to detect the original APT repositories configured on the system and
use them in the generated :file:`/etc/apt/sources.list` configuration file. They
will be placed before the default repositories, with assumption that the
original repositories pointed to the closest mirror.
original repositories pointed to the closest mirror. The original APT
repositories can be completely disabled by setting ``apt__original_sources: []``
in your inventory.
The ``non-free`` repositories will be enabled automatically on hardware-based
hosts in case any non-free firmware is required. Otherwise, only the ``main``
......@@ -33,6 +35,34 @@ following setting in your inventory:
apt__enabled: False
If you have a local APT mirror that you want a group of hosts to use
exclusively, you could compose your inventory like this:
.. code-block:: yaml
# Don't use the default mirrors
apt__default_sources_state: 'absent'
# Don't use the default security mirrors
apt__security_sources_state: 'absent'
# Replace the original APT mirror
apt__original_sources: []
# Define local APT mirror
apt__group_sources:
- uri: 'http://mirrors.domain.fqdn/debian'
comment: '{{ "Local " + apt__distribution + " repositories" }}'
distribution: 'Debian'
# Define local APT security mirrors
apt__group_security_sources:
- uri: 'http://mirrors.domain.fqdn/debian-security'
comment: '{{ "Local " + apt__distribution + " Security repository" }}'
suite: '{{ apt__distribution_release + "/updates" }}'
distribution: 'Debian'
Example playbook
----------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment