diff --git a/playbooks/base.yml b/playbooks/base.yml index 4b8559e..0ff21e7 100755 --- a/playbooks/base.yml +++ b/playbooks/base.yml @@ -8,6 +8,7 @@ - fr_FR.UTF-8 roles: - debian_common + - apt_common - locales - basesecurity - logrotate diff --git a/roles/debian_common/tasks/apt-unattended.yml b/roles/apt_common/tasks/main.yml similarity index 60% rename from roles/debian_common/tasks/apt-unattended.yml rename to roles/apt_common/tasks/main.yml index 9251e17..2cefc2a 100644 --- a/roles/debian_common/tasks/apt-unattended.yml +++ b/roles/apt_common/tasks/main.yml @@ -1,21 +1,15 @@ --- - name: Install unattended-upgrades - when: ansible_os_family == "Debian" apt: name: unattended-upgrades - state: present - update_cache: true - register: apt_result - retries: 3 - until: apt_result is succeeded - name: Configure unattended-upgrades template: - src: "apt/{{ item }}.j2" + src: "{{ item }}.j2" dest: "/etc/apt/apt.conf.d/{{ item }}" owner: root mode: u=rw,g=r,o=r loop: - - 50unattended-upgrades - 20auto-upgrades + - 50unattended-upgrades ... diff --git a/roles/debian_common/templates/apt/20auto-upgrades.j2 b/roles/apt_common/templates/20auto-upgrades.j2 similarity index 100% rename from roles/debian_common/templates/apt/20auto-upgrades.j2 rename to roles/apt_common/templates/20auto-upgrades.j2 diff --git a/roles/debian_common/templates/apt/50unattended-upgrades.j2 b/roles/apt_common/templates/50unattended-upgrades.j2 similarity index 100% rename from roles/debian_common/templates/apt/50unattended-upgrades.j2 rename to roles/apt_common/templates/50unattended-upgrades.j2 diff --git a/roles/debian_common/tasks/apt-listchanges.yml b/roles/debian_common/tasks/apt-listchanges.yml deleted file mode 100644 index b4d6214..0000000 --- a/roles/debian_common/tasks/apt-listchanges.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# Install apt-listchanges -- name: Install apt-listchanges - when: ansible_os_family == "Debian" - apt: - name: apt-listchanges - state: present - update_cache: true - register: apt_result - retries: 3 - until: apt_result is succeeded - -# Send email when there is something new -- name: Configure apt-listchanges - ini_file: - path: /etc/apt/listchanges.conf - no_extra_spaces: true - section: apt - option: "{{ item.option }}" - value: "{{ item.value }}" - state: present - mode: 0644 - loop: - - option: confirm - value: "true" - - - option: email_address - value: "{{ monitoring_mail }}" - - - option: which - value: both -... diff --git a/roles/debian_common/tasks/main.yml b/roles/debian_common/tasks/main.yml index 31fcd25..96a44b6 100644 --- a/roles/debian_common/tasks/main.yml +++ b/roles/debian_common/tasks/main.yml @@ -39,12 +39,6 @@ dest: /etc/apt/sources.list mode: 0644 -# APT-List Changes : send email with changelog -- include_tasks: apt-listchanges.yml - -# APT Unattended upgrades -- include_tasks: apt-unattended.yml - - name: Configure resolvconf template: src: resolv.conf @@ -65,3 +59,4 @@ - name: Remove dependencies that are no longer required apt: autoremove: true +...