homeserver/roles/mgrote.r8152_kernel_module/tasks/assert.yml
mg a6a4c48494 r8152: assert (#188)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#188
Co-authored-by: mg <mg@noreply.git.mgrote.net>
Co-committed-by: mg <mg@noreply.git.mgrote.net>
2021-08-16 21:57:16 +02:00

20 lines
663 B
YAML

---
- 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)