From d6072430bd333bc192f6e6c1a9111c0d6d203eb9 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 3 Dec 2020 14:42:39 -0500 Subject: [PATCH] ansible: Disable daily apt transaction on Ephemeral slaves Signed-off-by: David Galloway --- ansible/examples/slave.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ansible/examples/slave.yml b/ansible/examples/slave.yml index 6f48f365..47b53a01 100644 --- a/ansible/examples/slave.yml +++ b/ansible/examples/slave.yml @@ -330,6 +330,24 @@ line: '127.0.1.1 ceph-builders' 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: + - systemctl stop apt-daily.timer + - systemctl disable apt-daily.timer + - systemctl disable apt-daily.service + - systemctl daemon-reload + when: ansible_os_family == "Debian" + # Just in case. This isn't a super important task and might not even be required. + ignore_errors: true when: not permanent|bool ## VAGRANT REPO TASKS (for libvirt slaves) -- 2.39.5