From c2500827e19ad831565040ba48db2c31d7e0dca7 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 21 Jun 2019 10:18:54 +0200 Subject: [PATCH] tags and whitespaces --- apt/tasks/backports.yml | 10 ++++++---- apt/tasks/basics.yml | 12 +++++++----- apt/tasks/config.yml | 22 ++++++++++++++++------ apt/tasks/evolix_public.yml | 6 ++++-- apt/tasks/hold_packages.yml | 14 ++++++++++++++ apt/tasks/main.yml | 14 +++++++------- 6 files changed, 54 insertions(+), 24 deletions(-) diff --git a/apt/tasks/backports.yml b/apt/tasks/backports.yml index 6acf8114..3f95300c 100644 --- a/apt/tasks/backports.yml +++ b/apt/tasks/backports.yml @@ -5,7 +5,7 @@ regexp: "backports" state: absent tags: - - apt + - apt - name: Backports sources list is installed template: @@ -15,7 +15,7 @@ mode: "0640" register: apt_backports_list tags: - - apt + - apt - name: Backports configuration copy: @@ -25,7 +25,7 @@ mode: "0640" register: apt_backports_config tags: - - apt + - apt - name: Archived backport are accepted (jessie) lineinfile: @@ -34,10 +34,12 @@ create: yes state: present when: ansible_distribution_release == "jessie" + tags: + - apt - name: Apt update apt: update_cache: yes when: apt_backports_list | changed or apt_backports_config | changed tags: - - apt + - apt diff --git a/apt/tasks/basics.yml b/apt/tasks/basics.yml index f615c030..2c736aa9 100644 --- a/apt/tasks/basics.yml +++ b/apt/tasks/basics.yml @@ -8,21 +8,23 @@ force: yes register: apt_basic_list tags: - - apt + - apt - name: Clean GANDI sources.list.d/debian-security.list file: path: '{{ item }}' state: absent with_items: - - /etc/apt/sources.list.d/debian-security.list - - /etc/apt/sources.list.d/debian-stretch.list - - /etc/apt/sources.list.d/debian-update.list + - /etc/apt/sources.list.d/debian-security.list + - /etc/apt/sources.list.d/debian-stretch.list + - /etc/apt/sources.list.d/debian-update.list when: apt_clean_gandi_sourceslist + tags: + - apt - name: Apt update apt: update_cache: yes when: apt_basic_list | changed tags: - - apt + - apt diff --git a/apt/tasks/config.yml b/apt/tasks/config.yml index 264e8dd7..988aac7a 100644 --- a/apt/tasks/config.yml +++ b/apt/tasks/config.yml @@ -9,9 +9,11 @@ state: present mode: "0640" with_items: - - { line: "APT::Install-Recommends \"false\";", regexp: 'APT::Install-Recommends' } - - { line: "APT::Install-Suggests \"false\";", regexp: 'APT::Install-Suggests' } + - { line: "APT::Install-Recommends \"false\";", regexp: 'APT::Install-Recommends' } + - { line: "APT::Install-Suggests \"false\";", regexp: 'APT::Install-Suggests' } when: apt_evolinux_config + tags: + - apt - name: DPkg invoke hooks lineinfile: @@ -21,24 +23,32 @@ state: present mode: "0640" with_items: - - "DPkg::Pre-Invoke { \"df /tmp | grep -q /tmp && mount -oremount,exec /tmp || true\"; };" - - "DPkg::Pre-Invoke { \"df /usr | grep -q /usr && mount -oremount,rw /usr || true\"; };" - - "DPkg::Post-Invoke { \"df /tmp | grep -q /tmp && mount -oremount /tmp || true\"; };" - - "DPkg::Post-Invoke { \"df /usr | grep -q /usr && mount -oremount /usr || true\"; };" + - "DPkg::Pre-Invoke { \"df /tmp | grep -q /tmp && mount -oremount,exec /tmp || true\"; };" + - "DPkg::Pre-Invoke { \"df /usr | grep -q /usr && mount -oremount,rw /usr || true\"; };" + - "DPkg::Post-Invoke { \"df /tmp | grep -q /tmp && mount -oremount /tmp || true\"; };" + - "DPkg::Post-Invoke { \"df /usr | grep -q /usr && mount -oremount /usr || true\"; };" when: apt_hooks + tags: + - apt - name: Remove Aptitude apt: name: aptitude state: absent when: apt_remove_aptitude + tags: + - apt - name: Updating APT cache apt: update_cache: yes changed_when: False + tags: + - apt - name: Upgrading system apt: upgrade: dist when: apt_upgrade + tags: + - apt diff --git a/apt/tasks/evolix_public.yml b/apt/tasks/evolix_public.yml index b1db38ab..3e00a602 100644 --- a/apt/tasks/evolix_public.yml +++ b/apt/tasks/evolix_public.yml @@ -12,6 +12,8 @@ apt_key: #url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x44975278B8612B5D data: "{{ lookup('file', 'reg.gpg') }}" + tags: + - apt - name: Evolix public list is installed template: @@ -21,11 +23,11 @@ mode: "0640" register: apt_evolix_public tags: - - apt + - apt - name: Apt update apt: update_cache: yes when: apt_evolix_public | changed tags: - - apt + - apt diff --git a/apt/tasks/hold_packages.yml b/apt/tasks/hold_packages.yml index 0939335b..b44a1581 100644 --- a/apt/tasks/hold_packages.yml +++ b/apt/tasks/hold_packages.yml @@ -5,6 +5,8 @@ register: apt_mark changed_when: "'{{ item }} set on hold.' in apt_mark.stdout" with_items: "{{ apt_hold_packages }}" + tags: + - apt - name: "hold packages (config)" lineinfile: @@ -13,12 +15,16 @@ create: True state: present with_items: "{{ apt_hold_packages }}" + tags: + - apt - name: "unhold packages (apt)" shell: "(apt-mark showhold | grep --quiet {{ item }}) && apt-mark unhold {{ item }}" register: apt_mark changed_when: "'Canceled hold on {{ item }}.' in apt_mark.stdout" with_items: "{{ apt_unhold_packages }}" + tags: + - apt - name: "unhold packages (config)" lineinfile: @@ -27,6 +33,8 @@ create: True state: absent with_items: "{{ apt_unhold_packages }}" + tags: + - apt - name: /usr/share/scripts exists file: @@ -35,6 +43,8 @@ owner: root group: root state: directory + tags: + - apt - name: Check scripts is installed copy: @@ -42,6 +52,8 @@ dest: /usr/share/scripts/check_held_packages.sh force: yes mode: "0755" + tags: + - apt - name: Check for held packages (script) cron: @@ -55,3 +67,5 @@ day: "{{ apt_check_hold_cron_day }}" month: "{{ apt_check_hold_cron_month }}" state: "present" + tags: + - apt diff --git a/apt/tasks/main.yml b/apt/tasks/main.yml index b02e779f..bb531d4e 100644 --- a/apt/tasks/main.yml +++ b/apt/tasks/main.yml @@ -4,36 +4,36 @@ fail: msg: only compatible with Debian >= 8 when: - - ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<') + - ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<') tags: - - apt + - apt - name: Custom configuration include: config.yml when: apt_config tags: - - apt + - apt - name: Install basics repositories include: basics.yml when: apt_install_basics tags: - - apt + - apt - name: Install APT Backports repository include: backports.yml when: apt_install_backports tags: - - apt + - apt - name: Install Evolix Public APT repository include: evolix_public.yml when: apt_install_evolix_public tags: - - apt + - apt - name: Install check for packages marked hold include: hold_packages.yml when: apt_install_hold_packages tags: - - apt + - apt