homeserver/friedhof/mgrote_r8152_kernel_module_on_off/tasks/main.yml

17 lines
643 B
YAML
Raw Permalink Normal View History

---
- name: check if module is installed - folder
become: true
ansible.builtin.stat:
path: "/lib/modules/r8152/{{ r8152_filename }}"
register: folder_exists
- name: check if module is installed - lsmod
become: true
ansible.builtin.shell: lsmod
register: module_in_lsmod
changed_when: false # sorgt dafür das der Task nie als "changed" angezeigt wird
- name: include tasks (task get skipped if the folder or the module exists or r8152_module_needed == false)
ansible.builtin.include_tasks: doing.yml
when: ((folder_exists.stat.exists == False) or (module_in_lsmod.stdout.find('r8152') == -1)) and (r8152_module_needed)