From 064b5ad58b15241986965a31cc35df15d556ab91 Mon Sep 17 00:00:00 2001 From: Samuel Mutel Date: Wed, 1 Jun 2022 15:32:25 +0200 Subject: [PATCH] feat: Add option to create apt.conf.d files --- README.md | 11 +++++++++++ defaults/main.yml | 11 +++++++++++ tasks/preferences.yml | 9 +++++++++ 3 files changed, 31 insertions(+) diff --git a/README.md b/README.md index c44a72b..fb8d23c 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,17 @@ apt_aptitude_solution_cost: [] # priority: 1001 apt_preferences: [] +# List of apt configuration. +# apt_conf_d: +# - file: 10options +# content: | +# # Managed by Ansible +# Dpkg::Options { +# "--force-confdef"; +# "--force-confold"; +# } +apt_conf_d: [] + ``` ## Handlers diff --git a/defaults/main.yml b/defaults/main.yml index 561bab7..ddb1731 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -151,3 +151,14 @@ apt_aptitude_solution_cost: [] # pin: "version 5.20*" # priority: 1001 apt_preferences: [] + +# List of apt configuration. +# apt_conf_d: +# - file: 10options +# content: | +# # Managed by Ansible +# Dpkg::Options { +# "--force-confdef"; +# "--force-confold"; +# } +apt_conf_d: [] diff --git a/tasks/preferences.yml b/tasks/preferences.yml index 4ad12b5..c52bddc 100644 --- a/tasks/preferences.yml +++ b/tasks/preferences.yml @@ -8,3 +8,12 @@ group: root mode: 0644 with_items: "{{ apt_preferences }}" + +- name: Configuring APT + copy: + content: "{{ item.content }}" + dest: "/etc/apt/apt.conf.d/{{ item.file }}" + owner: root + group: root + mode: 0644 + with_items: "{{ apt_conf_d }}"