Commit 1e2c55a1 authored by Gardouille's avatar Gardouille

Add apt__*conf vars to manage additional conf files

parent f76fd269
......@@ -52,6 +52,23 @@ apt__nonfree: '{{ True if (ansible_virtualization_role is undefined or
# choices: ``deb``, ``deb-src``.
apt__source_types: [ 'deb' ]
# ]]]
# .. envvar:: apt__conf [[[
#
# List of additional APT configuration to add on all hosts in Ansible inventory.
apt__conf: []
# ]]]
# .. envvar:: apt__group_conf [[[
#
# List of additional APT configuration to add on hosts in specific Ansible
# inventory group.
apt__group_conf: []
# ]]]
# .. envvar:: apt__host_conf [[[
#
# List of additional APT configuration to add on specific hosts in Ansible
# inventory.
apt__host_conf: []
# ]]]
# .. envvar:: apt__remove_default_configuration [[[
#
......
......@@ -37,6 +37,7 @@
state: 'absent'
when: (apt__enabled|bool and apt__remove_default_configuration|bool)
# Manage configuration files [[[
- name: Generate APT configuration files
template:
src: '{{ item }}.j2'
......@@ -48,6 +49,25 @@
- 'etc/apt/apt.conf.d/25no-recommends.conf'
when: apt__enabled|bool
- name: Generate Additionnal APT configuration files
copy:
dest: '/etc/apt/apt.conf.d/{{ item.dest | d(item.path | d(item.name)) }}'
src: '{{ item.src | d(omit) }}'
content: '{{ item.content | d(omit) }}'
owner: 'root'
group: 'root'
mode: '0644'
with_flattened:
- '{{ apt__conf }}'
- '{{ apt__group_conf }}'
- '{{ apt__host_conf }}'
when: (apt__enabled|bool and
(item.src|d() or item.content|d()) and
(item.dest|d() or item.path|d() or item.name|d()) and
(item.state|d('present') != 'absent'))
# ]]]
- name: Check current APT diversions
environment:
LC_ALL: 'C'
......
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