homeserver/roles/mgrote.r8152_kernel_module/tasks/assert.yml

21 lines
663 B
YAML
Raw Normal View History

---
- 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
ansible.builtin.shell: lsmod
register: module_in_lsmod
changed_when: False # sorgt dafür das der Task nie als "changed" angezeigt wird
- name: include install-tasks
include_tasks: doing.yml
when: (module_in_lsmod.stdout.find('r8152') == -1) and (folder_exists.stat.exists == false)
- name: include dkms-tasks
include_tasks: dkms.yml
when: (module_in_lsmod.stdout.find('r8152') == -1) and (folder_exists.stat.exists == false)