diff --git a/roles/autoinstall-dvbsky-S952/tasks/main.yml b/roles/autoinstall-dvbsky-S952/tasks/main.yml deleted file mode 100644 index 833f1b0..0000000 --- a/roles/autoinstall-dvbsky-S952/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -# file roles/autoinstall-DVBSky-S952/tasks/main.yml - -- name: Download firmware of DVBSky-S952 if detected to /lib/firmware and extract them - unarchive: - src: http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz - dest: /tmp/ - remote_src: yes - when: - - '"1ade:3038" in pci' - - ansible_distribution_version >= '15.04' #driver only included since Kernel 3.19 - -- name: Copy the required firmware to right folder - copy: - src: /tmp/dvbsky-firmware/dvb-demod-m88rs6000.fw - dest: /lib/firmware/ - owner: root - group: root - mode: 0644 - -- name: Remove unnecessary files from download - file: path=/tmp/dvbsky-firmware state=absent \ No newline at end of file diff --git a/roles/autoinstall-dvbsky-firmware/tasks/main.yml b/roles/autoinstall-dvbsky-firmware/tasks/main.yml new file mode 100644 index 0000000..928de28 --- /dev/null +++ b/roles/autoinstall-dvbsky-firmware/tasks/main.yml @@ -0,0 +1,42 @@ +--- +# file roles/autoinstall-dvbsky-firmware/tasks/main.yml + +- name: create empty list for dvbsky device firmware files + set_fact: + dvbsky_firmware_files: [] + +- name: add firmware for DVBSky S952 V3 to variable dvbsky_firmware_files if a card has been detected + set_fact: + dvbsky_firmware_files: dvbsky_firmware_files + [ 'dvb-demod-m88rs6000.fw'] + when: + - '"1ade:3038" in pci' + - ansible_distribution_version >= '15.04' #driver only included since Kernel 3.19 + +- name: Download firmware for DVBSky cards and copy required files to /lib/firmware + block: + # download and extract firmware + - unarchive: + src: http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz + dest: /tmp/ + remote_src: yes + + # copy firmware file + - copy: + src: "/tmp/dvbsky-firmware/{{ item }}" + dest: /lib/firmware/ + owner: root + group: root + mode: 0644 + with_items: '{{ dvbsky_firmware_files }}' + + # Remove temporary files + file: + path=/tmp/dvbsky-firmware state=absent + when: + - dvbsky_firmware_files is defined + - "{{ dvbsky_firmware_files }}" + notify: ['Trigger Udev'] + tags: + - install + - autodetect + - dvbsky