From 17d132fd27ffc075fbd83490e000169819b2244d Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 9 Feb 2022 11:43:28 +0000 Subject: [PATCH] Check if packagekit is installed --- roles/fedora/tasks/packagekit.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/fedora/tasks/packagekit.yml b/roles/fedora/tasks/packagekit.yml index 87a0f74..3b976bf 100644 --- a/roles/fedora/tasks/packagekit.yml +++ b/roles/fedora/tasks/packagekit.yml @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Check for packagekit.service + ansible.builtin.stat: + path: /usr/lib/systemd/system/packagekit.service + register: packagekitservice - name: Disable PackageKit become: true ansible.builtin.systemd: @@ -20,6 +24,7 @@ enabled: no masked: yes state: stopped +- when: packagekitservice.stat.exists - name: Disable PackageKit offline updates become: true ansible.builtin.systemd: @@ -27,6 +32,7 @@ enabled: no masked: yes state: stopped +- when: packagekitservice.stat.exists - name: Enable automatic updates become: true ansible.builtin.systemd: