From c5f274356f0812bf5ed18bf92ad493e0a271a514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 18 Aug 2017 10:12:38 +0200 Subject: [PATCH] Manage dpkg default values. --- CHANGELOG.md | 2 +- README.md | 1 + tasks/config.yml | 10 ++++++++++ templates/etc/apt/apt.conf.d/20dpkg.j2 | 12 ++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 templates/etc/apt/apt.conf.d/20dpkg.j2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ee3fbd..67bc360 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,5 +8,5 @@ * Manage default preferences file. * Ensure to install some additionnals tools (aptitude,…). * Ensure to remove really useless packages (laptop-detect, tasksel,…). -* Manage periodic config file. +* Manage periodic, dpkg config files. * Purge default configuration files sets by others apps. diff --git a/README.md b/README.md index c0eca35..895dbeb 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ Manage APT repos, preferences and configuration for IPR's servers. ### APT Configuration - Set periodic actions. +- Set dpkg default values. - Purge default configuration files sets by others apps. ### Sources List diff --git a/tasks/config.yml b/tasks/config.yml index de08787..583140e 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -11,6 +11,16 @@ with_items: - "etc/apt/apt.conf.d/10periodic" +- name: CONFIG dpkg + template: + src: "{{ item }}.j2" + dest: "/{{ item }}" + owner: root + group: root + mode: 0644 + with_items: + - "etc/apt/apt.conf.d/20dpkg" + - name: CONFIG purge default config file: path: "/etc/apt/apt.conf.d/{{ item }}" diff --git a/templates/etc/apt/apt.conf.d/20dpkg.j2 b/templates/etc/apt/apt.conf.d/20dpkg.j2 new file mode 100644 index 0000000..1f2082c --- /dev/null +++ b/templates/etc/apt/apt.conf.d/20dpkg.j2 @@ -0,0 +1,12 @@ +# {{ ansible_managed }} + +Dpkg +{ + Options + { + # keep the old version of configuration files without prompting + "--force-confold"; + # let dpkg decide by itself when multiple choice + "--force-confdef"; + } +};