ansible: Remove unattended-upgrades after package install 1796/head
authorDavid Galloway <dgallowa@redhat.com>
Wed, 7 Apr 2021 15:35:22 +0000 (11:35 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 7 Apr 2021 15:35:22 +0000 (11:35 -0400)
One of the packages we *do* want to install (software-properties-common maybe) pulls in unattended upgrades.  It's not a strict dependency so we can remove it after package install.  It's the only package that gets removed.

Signed-off-by: David Galloway <dgallowa@redhat.com>
ansible/examples/slave.yml

index 2277740842103054a3ba377549457cf8e85a16d0..7337af04be194b5c8b2643396e6ba9860f7193c9 100644 (file)
           failed_when: false
           when: ansible_os_family == "Suse"
 
-        # Sometimes, slaves would connect to Jenkins and try to run an apt transaction right away.  Except apt-daily/unattended-upgrades has the dpkg lock so the Jenkins job would fail.
-        - name: Uninstall unattended-upgrades
-          package:
-            name: unattended-upgrades
-            state: absent
-          when: ansible_os_family == "Debian"
-
         - name: Stop and disable daily apt activities
           command: "{{ item }}"
           with_items:
         update_cache: yes
       when: ansible_os_family == "Debian"
 
+    # Sometimes, slaves would connect to Jenkins and try to run an apt transaction right away.  Except apt-daily/unattended-upgrades has the dpkg lock so the Jenkins job would fail.
+    - name: Uninstall unattended-upgrades
+      package:
+        name: unattended-upgrades
+        state: absent
+      when: ansible_os_family == "Debian"
+
     - name: Install EPEL repo
       yum:
         name: epel-release