2021-05-10 14:26:39 +02:00
|
|
|
---
|
2021-06-20 10:56:18 +02:00
|
|
|
# - name: check if module is installed - folder
|
|
|
|
# become: yes
|
|
|
|
# stat:
|
|
|
|
# path: "/lib/modules/r8152/{{ r8152_filename }}"
|
|
|
|
# register: folder_exists
|
2021-05-10 14:26:39 +02:00
|
|
|
|
|
|
|
- name: check if module is installed - lsmod
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.shell: lsmod
|
|
|
|
register: module_in_lsmod
|
|
|
|
changed_when: False # sorgt dafür das der Task nie als "changed" angezeigt wird
|
|
|
|
|
2021-06-20 10:56:18 +02:00
|
|
|
- name: include install-tasks (task get skipped if the folder or the module exists or r8152_module_needed == false)
|
2021-05-10 14:26:39 +02:00
|
|
|
include_tasks: doing.yml
|
2021-06-20 10:56:18 +02:00
|
|
|
when: (module_in_lsmod.stdout.find('r8152') == -1) and (r8152_module_needed == true)
|
|
|
|
|
|
|
|
- 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)
|