From ada625676bec31a49674fd3d450da6fbf487d806 Mon Sep 17 00:00:00 2001 From: mg Date: Wed, 28 Jul 2021 07:54:06 +0200 Subject: [PATCH] filter DKMS fur tasks (#174) filter DKMS fur tasks Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/174 Co-Authored-By: mg Co-Committed-By: mg --- roles/mgrote.r8152_kernel_module/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/mgrote.r8152_kernel_module/tasks/main.yml b/roles/mgrote.r8152_kernel_module/tasks/main.yml index adf2d3a2..5c3121ef 100644 --- a/roles/mgrote.r8152_kernel_module/tasks/main.yml +++ b/roles/mgrote.r8152_kernel_module/tasks/main.yml @@ -1,9 +1,9 @@ --- -# - name: check if module is installed - folder -# become: yes -# stat: - # path: "/lib/modules/r8152/{{ r8152_filename }}" -# register: folder_exists + - name: check if module is installed - folder + become: yes + stat: + path: "/lib/modules/r8152" + register: folder_exists - name: check if module is installed - lsmod become: yes @@ -13,8 +13,8 @@ - name: include install-tasks (task get skipped if the folder or the module exists or r8152_module_needed == false) include_tasks: doing.yml - when: (module_in_lsmod.stdout.find('r8152') == -1) and (r8152_module_needed == true) + when: (module_in_lsmod.stdout.find('r8152') == -1) and (r8152_module_needed == true) and (folder_exists.stat.exists == false) - name: include dkms-tasks (task get skipped if the folder or the module exists or r8152_module_needed == false) include_tasks: dkms.yml - when: (module_in_lsmod.stdout.find('r8152') == -1) and (r8152_module_needed == true) + when: (module_in_lsmod.stdout.find('r8152') == -1) and (r8152_module_needed == true) and (folder_exists.stat.exists == false)