Compare commits
	
		
			44 Commits
		
	
	
		
			autoinstal
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 7dc7902180 | ||
|  | 2e759806e1 | ||
|  | f6b6e818de | ||
|  | 640d27dfa3 | ||
|  | 1f2a51dd37 | ||
|  | 6b130a3df3 | ||
|  | 9860f607a0 | ||
|  | f302e4e06c | ||
|  | f8553943ab | ||
|  | c5d0277610 | ||
|  | 19a1f98d74 | ||
|  | 748df6954e | ||
|  | 49bcecb027 | ||
|  | 68396b3797 | ||
|  | c70d6f97c6 | ||
|  | f6ec12448a | ||
|  | 4ed8729282 | ||
|  | 885b5bd893 | ||
|  | d08d060439 | ||
|  | 0cd621b6a6 | ||
|  | 6ae45c65ce | ||
|  | 11eb950977 | ||
|  | 23e09863dc | ||
|  | b93b0e7ec6 | ||
|  | cfb28e88cc | ||
|  | 440032137b | ||
|  | 3372fcec4c | ||
|  | 0d01ee282b | ||
|  | 75cd1eb560 | ||
|  | d9eb820ea0 | ||
|  | 115bfe66c9 | ||
|  | 74159df8ac | ||
|  | c6837bde93 | ||
|  | 69e6b90885 | ||
|  | fbad7b65aa | ||
|  | 7c2b1ce55d | ||
|  | c985a33229 | ||
|  | 0358403073 | ||
|  | 11a7f5478c | ||
|  | 9d1eb3a6e3 | ||
|  | ca0bc806ca | ||
|  | 9794d7b9ef | ||
|  | 36d189e31c | ||
|  | 896516242b | 
							
								
								
									
										851
									
								
								Manual.html
									
									
									
									
									
								
							
							
						
						
									
										851
									
								
								Manual.html
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										187
									
								
								Manual.org
									
									
									
									
									
								
							
							
						
						
									
										187
									
								
								Manual.org
									
									
									
									
									
								
							| @@ -148,7 +148,7 @@ add-apt-repository -y ppa:ansible/ansible | |||||||
| # update packages | # update packages | ||||||
| apt-get update | apt-get update | ||||||
| # install required packages | # install required packages | ||||||
| apt-get -y install ansible | apt-get -y install --no-install-recommends ansible | ||||||
|  |  | ||||||
| # TODO: run ansible on local host | # TODO: run ansible on local host | ||||||
| ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags=install | ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags=install | ||||||
| @@ -169,6 +169,7 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation: | |||||||
|      - collect-facts              # query system facts |      - collect-facts              # query system facts | ||||||
|      - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers |      - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers | ||||||
|                                   # (e.g. nvidia, virtualbox) |                                   # (e.g. nvidia, virtualbox) | ||||||
|  |      - autoinstall-virtualbox-guest | ||||||
|      # - nvidia-387                # install very recent nvidia-387 from ppa:graphics-drivers/ppa |      # - nvidia-387                # install very recent nvidia-387 from ppa:graphics-drivers/ppa | ||||||
|      - vdr                        # install vdr and related packages |      - vdr                        # install vdr and related packages | ||||||
|      - yavdr-network              # enable network client capabilities |      - yavdr-network              # enable network client capabilities | ||||||
| @@ -280,7 +281,7 @@ vdr_plugins: | |||||||
| # dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled | # dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled | ||||||
| media_dirs: | media_dirs: | ||||||
|   audio: /srv/audio |   audio: /srv/audio | ||||||
|   video: /srv/audio |   video: /srv/video | ||||||
|   pictures: /srv/picture |   pictures: /srv/picture | ||||||
|   files: /srv/files |   files: /srv/files | ||||||
|   backups: /srv/backups |   backups: /srv/backups | ||||||
| @@ -481,6 +482,10 @@ yavdr-common executes the following tasks: | |||||||
| #+END_SRC | #+END_SRC | ||||||
|  |  | ||||||
| ***** Disable release-upgrade notifications | ***** Disable release-upgrade notifications | ||||||
|  | ****** SOMEDAY move from lineinfile to template | ||||||
|  | :LOGBOOK: | ||||||
|  | - State "SOMEDAY"    from "TODO"       [2017-11-22 Mi 10:59] | ||||||
|  | :END: | ||||||
| #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes | #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes | ||||||
| - name: disable release-upgrade notifications | - name: disable release-upgrade notifications | ||||||
|   lineinfile: |   lineinfile: | ||||||
| @@ -489,6 +494,12 @@ yavdr-common executes the following tasks: | |||||||
|     state: present |     state: present | ||||||
|     regexp: '^(Prompt=).*$' |     regexp: '^(Prompt=).*$' | ||||||
|     line: '\1never' |     line: '\1never' | ||||||
|  |   ignore_errors: yes | ||||||
|  |   with_first_found: | ||||||
|  |     - files: | ||||||
|  |       - /etc/update-manager/release-upgrades | ||||||
|  |       skip: true | ||||||
|  |  | ||||||
| #+END_SRC | #+END_SRC | ||||||
| ***** Install essential packages | ***** Install essential packages | ||||||
|  #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes |  #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes | ||||||
| @@ -528,8 +539,14 @@ yavdr-common executes the following tasks: | |||||||
|   with_items: |   with_items: | ||||||
|       '{{ extra_packages }}' |       '{{ extra_packages }}' | ||||||
| #+END_SRC | #+END_SRC | ||||||
| ***** create media directories | ***** create directories | ||||||
| #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/create_directories.yml :exports none :mkdirp yes | #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/create_directories.yml :exports none :mkdirp yes | ||||||
|  | - name: ensure /etc/yavdr exists | ||||||
|  |   file: | ||||||
|  |     path: /etc/yavdr | ||||||
|  |     state: directory | ||||||
|  |     mode: 0755 | ||||||
|  |  | ||||||
| - name: create media directories | - name: create media directories | ||||||
|   file: |   file: | ||||||
|     dest: '{{ item.value }}' |     dest: '{{ item.value }}' | ||||||
| @@ -567,6 +584,10 @@ APT::Install-Suggests "0"; | |||||||
|     - gpus |     - gpus | ||||||
|     - modules |     - modules | ||||||
|     - acpi_power_modes |     - acpi_power_modes | ||||||
|  |     - nvidia_detected | ||||||
|  |     - intel_detected | ||||||
|  |     - amd_detected | ||||||
|  |     - virtualbox_detected | ||||||
| #+END_SRC | #+END_SRC | ||||||
| ** vdr | ** vdr | ||||||
| *** tasks | *** tasks | ||||||
| @@ -1051,7 +1072,10 @@ In order to achive a clean shutdown of the session, ~x@t7.service~ is set as a d | |||||||
| *** TODO automatic X-server configuration                        :noexport: | *** TODO automatic X-server configuration                        :noexport: | ||||||
| - [X] detect connected display | - [X] detect connected display | ||||||
| - [X] read EDID from displays | - [X] read EDID from displays | ||||||
| - [ ] create a xorg.conf for nvidia/intel/amd gpus | create a xorg.conf for | ||||||
|  | - [X] nvidia | ||||||
|  | - [ ] intel | ||||||
|  | - [ ] amd gpus | ||||||
|  |  | ||||||
| **** HOLD Nvidia-GPUs:read  EDID: | **** HOLD Nvidia-GPUs:read  EDID: | ||||||
|  |  | ||||||
| @@ -1448,39 +1472,39 @@ b'\xde\xad\xbe\xef' | |||||||
|     dest: '{{ item }}' |     dest: '{{ item }}' | ||||||
|     state: directory |     state: directory | ||||||
|   with_items: |   with_items: | ||||||
|     - /etc/systemd/system/x@.service.d/ |     - "/etc/systemd/system/x@.service.d/" | ||||||
|     - /etc/systemd/system/vdr.service.d/ |     - "/etc/systemd/system/vdr.service.d/" | ||||||
|     - '/etc/systemd/system/user@{{ vdr.uid }}.service.d/' |     - "/etc/systemd/system/user@{{ vdr.uid }}.service.d/" | ||||||
|  |  | ||||||
| - name: add dependency to X-server for vdr.service using a drop-in | - name: systemd-drop-in | add dependency to X-server for vdr.service | ||||||
|   template: |   template: | ||||||
|     src: templates/vdr-xorg.conf |     src: templates/vdr-xorg.conf | ||||||
|     dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf |     dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf | ||||||
|  |  | ||||||
| - name: start x@.service before xlogin@.service | - name: systemd-drop-in | start x@.service before xlogin@.service | ||||||
|   template: |   template: | ||||||
|     src: templates/x@service.d/xlogin.conf.j2 |     src: templates/x@service.d/xlogin.conf.j2 | ||||||
|     dest: /etc/systemd/system/x@.service.d/xlogin.conf |     dest: /etc/systemd/system/x@.service.d/xlogin.conf | ||||||
|  |  | ||||||
| - name: load environment file for vdr.service | - name: systemd-drop-in | load environment file for vdr.service | ||||||
|   template: |   template: | ||||||
|     src: templates/systemd/vdr-environ.j2 |     src: templates/systemd/vdr-environ.j2 | ||||||
|     dest: /etc/systemd/system/vdr.service.d/load-environ.conf |     dest: /etc/systemd/system/vdr.service.d/load-environ.conf | ||||||
|  |  | ||||||
| - name: user@{{ vdr.uid }}.service depends on x@vt7.service | - name: systemd-drop-in | user@{{ vdr.uid }}.service depends on x@vt7.service | ||||||
|   template: |   template: | ||||||
|     src: templates/user@666.service.d/x-dependency.conf.j2 |     src: templates/user@666.service.d/x-dependency.conf.j2 | ||||||
|     dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf' |     dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf' | ||||||
|  |  | ||||||
| - name: start softhddevice detached and set audio to pulseaudio | - name: vdr-config | start softhddevice detached and set audio to pulseaudio | ||||||
|   lineinfile: |   lineinfile: | ||||||
|     path: /etc/vdr/conf.avail/softhddevice.conf |     path: /etc/vdr/conf.avail/softhddevice.conf | ||||||
|     line: '{{ item }}' |     line: '{{ item }}ys | ||||||
|   with_items: |   with_items: | ||||||
|       - '-D' |       - '-D' | ||||||
|       # - '-a pulse' # do we need this with our existing asound.conf? |       # - '-a pulse' # do we need this with our existing asound.conf? | ||||||
|  |  | ||||||
| - name: set a login shell for the user vdr | - name: add a login shell for the user vdr | ||||||
|   user: |   user: | ||||||
|       name: '{{ vdr.user }}' |       name: '{{ vdr.user }}' | ||||||
|       shell: '/bin/bash' |       shell: '/bin/bash' | ||||||
| @@ -1547,6 +1571,10 @@ b'\xde\xad\xbe\xef' | |||||||
|     name: x@vt7.service |     name: x@vt7.service | ||||||
|     state: stopped |     state: stopped | ||||||
|  |  | ||||||
|  | - name: "wait a little bit before starting x-verbose@vt7.service (needed?)" | ||||||
|  |   wait_for: | ||||||
|  |     timeout: 3 | ||||||
|  |  | ||||||
| - name: "start x-verbose@.service" | - name: "start x-verbose@.service" | ||||||
|   systemd: |   systemd: | ||||||
|     name: "x-verbose@vt7.service" |     name: "x-verbose@vt7.service" | ||||||
| @@ -1576,14 +1604,24 @@ b'\xde\xad\xbe\xef' | |||||||
|     enabled: false |     enabled: false | ||||||
|     masked: true |     masked: true | ||||||
|  |  | ||||||
|  | - name: "wait a little bit, so X has some time to shut down (needed?)" | ||||||
|  |   wait_for: | ||||||
|  |     timeout: 3 | ||||||
|  |  | ||||||
| # TODO: expand template for xorg.conf (or snippets) | # TODO: expand template for xorg.conf (or snippets) | ||||||
| #       with respect for the available graphics card driver | #       with respect for the available graphics card driver | ||||||
| #       nvidia, noveau, intel, radeon | #       nvidia, noveau, intel, radeon | ||||||
| - name: create xorg.conf (for nvidia driver) |  | ||||||
|   template: | - name: nvidia related config | ||||||
|     src: templates/xorg.conf.j2 |   block: | ||||||
|     dest: /etc/X11/xorg.conf |   - name: create xorg.conf (for nvidia driver) | ||||||
|     backup: yes |     template: | ||||||
|  |         src: templates/xorg.conf.j2 | ||||||
|  |         dest: /etc/X11/xorg.conf | ||||||
|  |         backup: yes | ||||||
|  |   when: | ||||||
|  |     - nvidia_detected | ||||||
|  |  | ||||||
| #+END_SRC | #+END_SRC | ||||||
|  |  | ||||||
| #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no | #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no | ||||||
| @@ -3151,19 +3189,45 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi | |||||||
| #+BEGIN_SRC yaml :tangle roles/autoinstall-ubuntu-drivers/tasks/main.yml :padline no | #+BEGIN_SRC yaml :tangle roles/autoinstall-ubuntu-drivers/tasks/main.yml :padline no | ||||||
| --- | --- | ||||||
| # file roles/autoinstall-ubuntu-drivers/tasks/main.yml | # file roles/autoinstall-ubuntu-drivers/tasks/main.yml | ||||||
| - name: apt | install ubuntu-drivers-common |  | ||||||
|   apt: |  | ||||||
|     name: ubuntu-drivers-common |  | ||||||
|     state: present |  | ||||||
|  |  | ||||||
| - name: ensure /etc/yavdr exists | - name: autoinstall ubuntu-drivers-common | ||||||
|   file: |   block: | ||||||
|     path: /etc/yavdr |     - name: apt | install ubuntu-drivers-common | ||||||
|     state: directory |       apt: | ||||||
|     mode: 0755 |         name: ubuntu-drivers-common | ||||||
|  |         state: present | ||||||
|  |  | ||||||
| - name: let ubuntu-drivers automatically install additional drivers |     - name: use ubuntu-drivers to install additional drivers automatically | ||||||
|   command: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall |       command: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall | ||||||
|  |   when: (ansible_virtualization_type != "virtualbox" and ansible_virtualization_role != "guest") or | ||||||
|  |         ansible_distribution_version != "16.04" | ||||||
|  |         # ubuntu-drivers-common tries to autoinstall | ||||||
|  |         # conflicting packages for virtualbox in Ubuntu 16.04 :( | ||||||
|  | #+END_SRC | ||||||
|  | ** autoinstall-virtualbox-guest | ||||||
|  | This role installs the guest additions for virtualbox guests on Ubuntu 16.04 | ||||||
|  |  | ||||||
|  | #+BEGIN_SRC yaml :tangle roles/autoinstall-virtualbox-guest/tasks/main.yml :padline no | ||||||
|  | --- | ||||||
|  | # file roles/autoinstall-virtualbox-guest/tasks/main.yml | ||||||
|  |  | ||||||
|  | - name: install virtualbox guest additions | ||||||
|  |   block: | ||||||
|  |     - name: install packages | ||||||
|  |       apt: | ||||||
|  |         state: present | ||||||
|  |         name: '{{ item }}' | ||||||
|  |       with_items: | ||||||
|  |         - virtualbox-guest-dkms | ||||||
|  |         - virtualbox-guest-x11 | ||||||
|  |         - dkms | ||||||
|  |  | ||||||
|  |     # TODO: set xineliboutput as frontend | ||||||
|  |   when: | ||||||
|  |     - ansible_virtualization_type == "virtualbox" | ||||||
|  |     - ansible_virtualization_role == "guest" | ||||||
|  |     - ansible_distribution == "Ubuntu" | ||||||
|  |     - ansible_distribution_version == "16.04" | ||||||
| #+END_SRC | #+END_SRC | ||||||
| ** autoinstall-satip | ** autoinstall-satip | ||||||
| If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed. | If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed. | ||||||
| @@ -3271,6 +3335,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll | |||||||
| --- | --- | ||||||
| # file roles/autoinstall-dvbsddevice/tasks/main.yml | # file roles/autoinstall-dvbsddevice/tasks/main.yml | ||||||
|  |  | ||||||
|  | # TODO: install firmware | ||||||
|  |  | ||||||
| - name: apt | install vdr-plugin-dvbsddevice if module is loaded | - name: apt | install vdr-plugin-dvbsddevice if module is loaded | ||||||
|   apt: |   apt: | ||||||
|     name: vdr-plugin-dvbsddevice |     name: vdr-plugin-dvbsddevice | ||||||
| @@ -3576,18 +3642,38 @@ wakeup_method: "acpiwakeup" | |||||||
| # file roles/wakeup/tasks/main.yml | # file roles/wakeup/tasks/main.yml | ||||||
|  |  | ||||||
| - name: install and configure vdr-addon-acpiwakeup | - name: install and configure vdr-addon-acpiwakeup | ||||||
|   block: |   apt: | ||||||
|     - apt: |     name: vdr-addon-acpiwakeup | ||||||
|       name: vdr-addon-acpiwakeup |     state: present | ||||||
|       state: present |  | ||||||
|        |  | ||||||
|     - lineinfile: |  | ||||||
|         path: /etc/vdr/vdr-addon-acpiwakeup.conf |  | ||||||
|         regexp: '^ACPI_ENABLED=' |  | ||||||
|         line: 'ACPI_ENABLED=true' |  | ||||||
|  |  | ||||||
|   when: wakeup_method == "acpiwakeup" |   when: wakeup_method == "acpiwakeup" | ||||||
|  |        | ||||||
|  | - name: expand template for /etc/vdr/vdr-addon-acpiwakeup.conf | ||||||
|  |   template: | ||||||
|  |     src: templates/vdr-addon-acpiwakeup.conf.j2 | ||||||
|  |     dest: /etc/vdr/vdr-addon-acpiwakeup.conf | ||||||
|  |  | ||||||
| #+END_SRC | #+END_SRC | ||||||
|  | *** templates | ||||||
|  | #+BEGIN_SRC jinja2 :tangle roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2 :padline no | ||||||
|  | {{ ansible_managed_file | comment }} | ||||||
|  |  | ||||||
|  | # Activate/deactivate ACPIWakeup with yes/no: | ||||||
|  | ACPI_ENABLED="{% if wakeup_method == 'acpiwakeup' %}yes{% else %}no{% endif %}" | ||||||
|  |  | ||||||
|  | # How many minutes should the machine wake up before the timer starts: | ||||||
|  | ACPI_START_AHEAD=5 | ||||||
|  |  | ||||||
|  | # If you want your VDR machine to wakeup in regular intervals (i.e. for | ||||||
|  | # updating EPG data), specify the days of the week and the wakeup time. | ||||||
|  | # | ||||||
|  | # Days of the week for regular wakeup (not set=Disabled, 1=Monday...7=Sunday) | ||||||
|  | # ACPI_REGULAR_DAYS="1 2 3 4 5 6 7" | ||||||
|  |  | ||||||
|  | # Wakeup time | ||||||
|  | #ACPI_REGULAR_TIME=01:00  # HH:MM | ||||||
|  |  | ||||||
|  | #+END_SRC | ||||||
|  |  | ||||||
| ** grub-config | ** grub-config | ||||||
| *** default variables | *** default variables | ||||||
| #+BEGIN_SRC yaml :tangle roles/grub-config/defaults/main.yml :mkdirp yes :padline no | #+BEGIN_SRC yaml :tangle roles/grub-config/defaults/main.yml :mkdirp yes :padline no | ||||||
| @@ -3706,11 +3792,11 @@ EXAMPLES = ''' | |||||||
|     acpi_power_modes: True |     acpi_power_modes: True | ||||||
| - debug: | - debug: | ||||||
|     var: usb |     var: usb | ||||||
| - debug | - debug: | ||||||
|     var: pci |     var: pci | ||||||
| - debug | - debug: | ||||||
|     var: modules |     var: modules | ||||||
| - debug | - debug: | ||||||
|     var: gpus |     var: gpus | ||||||
| ''' | ''' | ||||||
|  |  | ||||||
| @@ -3788,6 +3874,10 @@ def main(): | |||||||
|     pci_devices = [] |     pci_devices = [] | ||||||
|     modules = [] |     modules = [] | ||||||
|     gpus = [] |     gpus = [] | ||||||
|  |     nvidia_detected = False | ||||||
|  |     intel_detected = False | ||||||
|  |     amd_detected = False | ||||||
|  |     virtualbox_detected = False | ||||||
|     acpi_power_modes = [] |     acpi_power_modes = [] | ||||||
|  |  | ||||||
|     if collect_usb: |     if collect_usb: | ||||||
| @@ -3802,12 +3892,18 @@ def main(): | |||||||
|  |  | ||||||
|     if collect_gpus: |     if collect_gpus: | ||||||
|         gpus = format_gpu_device_list(get_pci_devices()) |         gpus = format_gpu_device_list(get_pci_devices()) | ||||||
|  |         nvidia_detected = any((True for gpu in gpus if gpu['VendorName'] == 'nvidia')) | ||||||
|  |         intel_detected = any((True for gpu in gpus if gpu['VendorName'] == 'intel')) | ||||||
|  |         amd_detected = any((True for gpu in gpus if gpu['VendorName'] == 'amd')) | ||||||
|  |         virtualbox_detected = any((True for gpu in gpus if gpu['VendorName'] == 'virtualbox')) | ||||||
|  |  | ||||||
|     if collect_acpi_power_modes: |     if collect_acpi_power_modes: | ||||||
|         acpi_power_modes = list_acpi_power_modes() |         acpi_power_modes = list_acpi_power_modes() | ||||||
|  |  | ||||||
|     data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus, |     data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus, | ||||||
|             'acpi_power_modes': acpi_power_modes} |             'acpi_power_modes': acpi_power_modes, 'nvidia_detected': nvidia_detected, | ||||||
|  |             'intel_detected': intel_detected, 'amd_detected': amd_detected, | ||||||
|  |             'virtualbox_detected': virtualbox_detected} | ||||||
|     module.exit_json(changed=False, ansible_facts=data, msg=data) |     module.exit_json(changed=False, ansible_facts=data, msg=data) | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -4136,6 +4232,9 @@ def collect_nvidia_data(): | |||||||
|                                 universal_newlines=True) |                                 universal_newlines=True) | ||||||
|     except subprocess.CalledProcessError: |     except subprocess.CalledProcessError: | ||||||
|         pass |         pass | ||||||
|  |     except OSError: | ||||||
|  |         # nvidia-smi is not installed | ||||||
|  |         pass | ||||||
|     else: |     else: | ||||||
|         for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True): |         for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True): | ||||||
|             name = row['name'] |             name = row['name'] | ||||||
|   | |||||||
| @@ -34,7 +34,7 @@ vdr_plugins: | |||||||
| # dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled | # dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled | ||||||
| media_dirs: | media_dirs: | ||||||
|   audio: /srv/audio |   audio: /srv/audio | ||||||
|   video: /srv/audio |   video: /srv/video | ||||||
|   pictures: /srv/picture |   pictures: /srv/picture | ||||||
|   files: /srv/files |   files: /srv/files | ||||||
|   backups: /srv/backups |   backups: /srv/backups | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ add-apt-repository -y ppa:ansible/ansible | |||||||
| # update packages | # update packages | ||||||
| apt-get update | apt-get update | ||||||
| # install required packages | # install required packages | ||||||
| apt-get -y install ansible | apt-get -y install --no-install-recommends ansible | ||||||
|  |  | ||||||
| # TODO: run ansible on local host | # TODO: run ansible on local host | ||||||
| ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags=install | ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags=install | ||||||
|   | |||||||
| @@ -52,11 +52,11 @@ EXAMPLES = ''' | |||||||
|     acpi_power_modes: True |     acpi_power_modes: True | ||||||
| - debug: | - debug: | ||||||
|     var: usb |     var: usb | ||||||
| - debug | - debug: | ||||||
|     var: pci |     var: pci | ||||||
| - debug | - debug: | ||||||
|     var: modules |     var: modules | ||||||
| - debug | - debug: | ||||||
|     var: gpus |     var: gpus | ||||||
| ''' | ''' | ||||||
|  |  | ||||||
| @@ -134,6 +134,10 @@ def main(): | |||||||
|     pci_devices = [] |     pci_devices = [] | ||||||
|     modules = [] |     modules = [] | ||||||
|     gpus = [] |     gpus = [] | ||||||
|  |     nvidia_detected = False | ||||||
|  |     intel_detected = False | ||||||
|  |     amd_detected = False | ||||||
|  |     virtualbox_detected = False | ||||||
|     acpi_power_modes = [] |     acpi_power_modes = [] | ||||||
|  |  | ||||||
|     if collect_usb: |     if collect_usb: | ||||||
| @@ -148,12 +152,18 @@ def main(): | |||||||
|  |  | ||||||
|     if collect_gpus: |     if collect_gpus: | ||||||
|         gpus = format_gpu_device_list(get_pci_devices()) |         gpus = format_gpu_device_list(get_pci_devices()) | ||||||
|  |         nvidia_detected = any((True for gpu in gpus if gpu['VendorName'] == 'nvidia')) | ||||||
|  |         intel_detected = any((True for gpu in gpus if gpu['VendorName'] == 'intel')) | ||||||
|  |         amd_detected = any((True for gpu in gpus if gpu['VendorName'] == 'amd')) | ||||||
|  |         virtualbox_detected = any((True for gpu in gpus if gpu['VendorName'] == 'virtualbox')) | ||||||
|  |  | ||||||
|     if collect_acpi_power_modes: |     if collect_acpi_power_modes: | ||||||
|         acpi_power_modes = list_acpi_power_modes() |         acpi_power_modes = list_acpi_power_modes() | ||||||
|  |  | ||||||
|     data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus, |     data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus, | ||||||
|             'acpi_power_modes': acpi_power_modes} |             'acpi_power_modes': acpi_power_modes, 'nvidia_detected': nvidia_detected, | ||||||
|  |             'intel_detected': intel_detected, 'amd_detected': amd_detected, | ||||||
|  |             'virtualbox_detected': virtualbox_detected} | ||||||
|     module.exit_json(changed=False, ansible_facts=data, msg=data) |     module.exit_json(changed=False, ansible_facts=data, msg=data) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -197,6 +197,9 @@ def collect_nvidia_data(): | |||||||
|                                 universal_newlines=True) |                                 universal_newlines=True) | ||||||
|     except subprocess.CalledProcessError: |     except subprocess.CalledProcessError: | ||||||
|         pass |         pass | ||||||
|  |     except OSError: | ||||||
|  |         # nvidia-smi is not installed | ||||||
|  |         pass | ||||||
|     else: |     else: | ||||||
|         for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True): |         for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True): | ||||||
|             name = row['name'] |             name = row['name'] | ||||||
|   | |||||||
| @@ -1,6 +1,8 @@ | |||||||
| --- | --- | ||||||
| # file roles/autoinstall-dvbsddevice/tasks/main.yml | # file roles/autoinstall-dvbsddevice/tasks/main.yml | ||||||
|  |  | ||||||
|  | # TODO: install firmware | ||||||
|  |  | ||||||
| - name: apt | install vdr-plugin-dvbsddevice if module is loaded | - name: apt | install vdr-plugin-dvbsddevice if module is loaded | ||||||
|   apt: |   apt: | ||||||
|     name: vdr-plugin-dvbsddevice |     name: vdr-plugin-dvbsddevice | ||||||
|   | |||||||
| @@ -3,12 +3,19 @@ | |||||||
|  |  | ||||||
| - name: determine needed firmware files by device ids | - name: determine needed firmware files by device ids | ||||||
|   block: |   block: | ||||||
|     - name: add firmware for DVBSky S952 V3 to variable dvbsky_firmware_files if a card has been detected |     - name: add firmware files for DVBSky if a card has been detected | ||||||
|       set_fact: |       set_fact: | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-m88ds3103.fw']" | ||||||
|         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-m88rs6000.fw']" |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-m88rs6000.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-si2168-a20-01.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-si2168-a30-01.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-si2168-b40-01.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-fe-ds300x.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-fe-ds3103.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-fe-rs6000.fw']" | ||||||
|  |         dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-tuner-si2158-a20-01.fw']" | ||||||
|       when: |       when: | ||||||
|         - '"1ade:3038" in pci' |         - '"1ade:3038" in pci' | ||||||
|         - ansible_distribution_version >= '15.04'  #driver only included since Kernel 3.19 |  | ||||||
|   when: |   when: | ||||||
|     - not dvbsky_firmware_files |     - not dvbsky_firmware_files | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,15 +1,16 @@ | |||||||
| --- | --- | ||||||
| # file roles/autoinstall-ubuntu-drivers/tasks/main.yml | # file roles/autoinstall-ubuntu-drivers/tasks/main.yml | ||||||
| - name: apt | install ubuntu-drivers-common |  | ||||||
|   apt: |  | ||||||
|     name: ubuntu-drivers-common |  | ||||||
|     state: present |  | ||||||
|  |  | ||||||
| - name: ensure /etc/yavdr exists | - name: autoinstall ubuntu-drivers-common | ||||||
|   file: |   block: | ||||||
|     path: /etc/yavdr |     - name: apt | install ubuntu-drivers-common | ||||||
|     state: directory |       apt: | ||||||
|     mode: 0755 |         name: ubuntu-drivers-common | ||||||
|  |         state: present | ||||||
|  |  | ||||||
| - name: let ubuntu-drivers automatically install additional drivers |     - name: use ubuntu-drivers to install additional drivers automatically | ||||||
|   command: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall |       command: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall | ||||||
|  |   when: (ansible_virtualization_type != "virtualbox" and ansible_virtualization_role != "guest") or | ||||||
|  |         ansible_distribution_version != "16.04" | ||||||
|  |         # ubuntu-drivers-common tries to autoinstall | ||||||
|  |         # conflicting packages for virtualbox in Ubuntu 16.04 :( | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								roles/autoinstall-virtualbox-guest/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								roles/autoinstall-virtualbox-guest/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | |||||||
|  | --- | ||||||
|  | # file roles/autoinstall-virtualbox-guest/tasks/main.yml | ||||||
|  |  | ||||||
|  | - name: install virtualbox guest additions | ||||||
|  |   block: | ||||||
|  |     - name: install packages | ||||||
|  |       apt: | ||||||
|  |         state: present | ||||||
|  |         name: '{{ item }}' | ||||||
|  |       with_items: | ||||||
|  |         - virtualbox-guest-dkms | ||||||
|  |         - virtualbox-guest-x11 | ||||||
|  |         - dkms | ||||||
|  |  | ||||||
|  |     # TODO: set xineliboutput as frontend | ||||||
|  |   when: | ||||||
|  |     - ansible_virtualization_type == "virtualbox" | ||||||
|  |     - ansible_virtualization_role == "guest" | ||||||
|  |     - ansible_distribution == "Ubuntu" | ||||||
|  |     - ansible_distribution_version == "16.04" | ||||||
| @@ -15,3 +15,7 @@ | |||||||
|     - gpus |     - gpus | ||||||
|     - modules |     - modules | ||||||
|     - acpi_power_modes |     - acpi_power_modes | ||||||
|  |     - nvidia_detected | ||||||
|  |     - intel_detected | ||||||
|  |     - amd_detected | ||||||
|  |     - virtualbox_detected | ||||||
|   | |||||||
| @@ -2,14 +2,12 @@ | |||||||
| # file roles/wakeup/tasks/main.yml | # file roles/wakeup/tasks/main.yml | ||||||
|  |  | ||||||
| - name: install and configure vdr-addon-acpiwakeup | - name: install and configure vdr-addon-acpiwakeup | ||||||
|   block: |   apt: | ||||||
|     - apt: |     name: vdr-addon-acpiwakeup | ||||||
|       name: vdr-addon-acpiwakeup |     state: present | ||||||
|       state: present |  | ||||||
|        |  | ||||||
|     - lineinfile: |  | ||||||
|         path: /etc/vdr/vdr-addon-acpiwakeup.conf |  | ||||||
|         regexp: '^ACPI_ENABLED=' |  | ||||||
|         line: 'ACPI_ENABLED=true' |  | ||||||
|  |  | ||||||
|   when: wakeup_method == "acpiwakeup" |   when: wakeup_method == "acpiwakeup" | ||||||
|  |        | ||||||
|  | - name: expand template for /etc/vdr/vdr-addon-acpiwakeup.conf | ||||||
|  |   template: | ||||||
|  |     src: templates/vdr-addon-acpiwakeup.conf.j2 | ||||||
|  |     dest: /etc/vdr/vdr-addon-acpiwakeup.conf | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | {{ ansible_managed_file | comment }} | ||||||
|  |  | ||||||
|  | # Activate/deactivate ACPIWakeup with yes/no: | ||||||
|  | ACPI_ENABLED="{% if wakeup_method == 'acpiwakeup' %}yes{% else %}no{% endif %}" | ||||||
|  |  | ||||||
|  | # How many minutes should the machine wake up before the timer starts: | ||||||
|  | ACPI_START_AHEAD=5 | ||||||
|  |  | ||||||
|  | # If you want your VDR machine to wakeup in regular intervals (i.e. for | ||||||
|  | # updating EPG data), specify the days of the week and the wakeup time. | ||||||
|  | # | ||||||
|  | # Days of the week for regular wakeup (not set=Disabled, 1=Monday...7=Sunday) | ||||||
|  | # ACPI_REGULAR_DAYS="1 2 3 4 5 6 7" | ||||||
|  |  | ||||||
|  | # Wakeup time | ||||||
|  | #ACPI_REGULAR_TIME=01:00  # HH:MM | ||||||
| @@ -24,6 +24,11 @@ | |||||||
|     state: present |     state: present | ||||||
|     regexp: '^(Prompt=).*$' |     regexp: '^(Prompt=).*$' | ||||||
|     line: '\1never' |     line: '\1never' | ||||||
|  |   ignore_errors: yes | ||||||
|  |   with_first_found: | ||||||
|  |     - files: | ||||||
|  |       - /etc/update-manager/release-upgrades | ||||||
|  |       skip: true | ||||||
| - name: apt | install basic packages | - name: apt | install basic packages | ||||||
|   apt: |   apt: | ||||||
|     name: '{{ item }}' |     name: '{{ item }}' | ||||||
|   | |||||||
| @@ -1,3 +1,9 @@ | |||||||
|  | - name: ensure /etc/yavdr exists | ||||||
|  |   file: | ||||||
|  |     path: /etc/yavdr | ||||||
|  |     state: directory | ||||||
|  |     mode: 0755 | ||||||
|  |  | ||||||
| - name: create media directories | - name: create media directories | ||||||
|   file: |   file: | ||||||
|     dest: '{{ item.value }}' |     dest: '{{ item.value }}' | ||||||
|   | |||||||
| @@ -28,6 +28,10 @@ | |||||||
|     name: x@vt7.service |     name: x@vt7.service | ||||||
|     state: stopped |     state: stopped | ||||||
|  |  | ||||||
|  | - name: "wait a little bit before starting x-verbose@vt7.service (needed?)" | ||||||
|  |   wait_for: | ||||||
|  |     timeout: 3 | ||||||
|  |  | ||||||
| - name: "start x-verbose@.service" | - name: "start x-verbose@.service" | ||||||
|   systemd: |   systemd: | ||||||
|     name: "x-verbose@vt7.service" |     name: "x-verbose@vt7.service" | ||||||
| @@ -57,11 +61,20 @@ | |||||||
|     enabled: false |     enabled: false | ||||||
|     masked: true |     masked: true | ||||||
|  |  | ||||||
|  | - name: "wait a little bit, so X has some time to shut down (needed?)" | ||||||
|  |   wait_for: | ||||||
|  |     timeout: 3 | ||||||
|  |  | ||||||
| # TODO: expand template for xorg.conf (or snippets) | # TODO: expand template for xorg.conf (or snippets) | ||||||
| #       with respect for the available graphics card driver | #       with respect for the available graphics card driver | ||||||
| #       nvidia, noveau, intel, radeon | #       nvidia, noveau, intel, radeon | ||||||
| - name: create xorg.conf (for nvidia driver) |  | ||||||
|   template: | - name: nvidia related config | ||||||
|     src: templates/xorg.conf.j2 |   block: | ||||||
|     dest: /etc/X11/xorg.conf |   - name: create xorg.conf (for nvidia driver) | ||||||
|     backup: yes |     template: | ||||||
|  |         src: templates/xorg.conf.j2 | ||||||
|  |         dest: /etc/X11/xorg.conf | ||||||
|  |         backup: yes | ||||||
|  |   when: | ||||||
|  |     - nvidia_detected | ||||||
|   | |||||||
| @@ -5,31 +5,31 @@ | |||||||
|     dest: '{{ item }}' |     dest: '{{ item }}' | ||||||
|     state: directory |     state: directory | ||||||
|   with_items: |   with_items: | ||||||
|     - /etc/systemd/system/x@.service.d/ |     - "/etc/systemd/system/x@.service.d/" | ||||||
|     - /etc/systemd/system/vdr.service.d/ |     - "/etc/systemd/system/vdr.service.d/" | ||||||
|     - '/etc/systemd/system/user@{{ vdr.uid }}.service.d/' |     - "/etc/systemd/system/user@{{ vdr.uid }}.service.d/" | ||||||
|  |  | ||||||
| - name: add dependency to X-server for vdr.service using a drop-in | - name: systemd-drop-in | add dependency to X-server for vdr.service | ||||||
|   template: |   template: | ||||||
|     src: templates/vdr-xorg.conf |     src: templates/vdr-xorg.conf | ||||||
|     dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf |     dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf | ||||||
|  |  | ||||||
| - name: start x@.service before xlogin@.service | - name: systemd-drop-in | start x@.service before xlogin@.service | ||||||
|   template: |   template: | ||||||
|     src: templates/x@service.d/xlogin.conf.j2 |     src: templates/x@service.d/xlogin.conf.j2 | ||||||
|     dest: /etc/systemd/system/x@.service.d/xlogin.conf |     dest: /etc/systemd/system/x@.service.d/xlogin.conf | ||||||
|  |  | ||||||
| - name: load environment file for vdr.service | - name: systemd-drop-in | load environment file for vdr.service | ||||||
|   template: |   template: | ||||||
|     src: templates/systemd/vdr-environ.j2 |     src: templates/systemd/vdr-environ.j2 | ||||||
|     dest: /etc/systemd/system/vdr.service.d/load-environ.conf |     dest: /etc/systemd/system/vdr.service.d/load-environ.conf | ||||||
|  |  | ||||||
| - name: user@{{ vdr.uid }}.service depends on x@vt7.service | - name: systemd-drop-in | user@{{ vdr.uid }}.service depends on x@vt7.service | ||||||
|   template: |   template: | ||||||
|     src: templates/user@666.service.d/x-dependency.conf.j2 |     src: templates/user@666.service.d/x-dependency.conf.j2 | ||||||
|     dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf' |     dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf' | ||||||
|  |  | ||||||
| - name: start softhddevice detached and set audio to pulseaudio | - name: vdr-config | start softhddevice detached and set audio to pulseaudio | ||||||
|   lineinfile: |   lineinfile: | ||||||
|     path: /etc/vdr/conf.avail/softhddevice.conf |     path: /etc/vdr/conf.avail/softhddevice.conf | ||||||
|     line: '{{ item }}' |     line: '{{ item }}' | ||||||
| @@ -37,7 +37,7 @@ | |||||||
|       - '-D' |       - '-D' | ||||||
|       # - '-a pulse' # do we need this with our existing asound.conf? |       # - '-a pulse' # do we need this with our existing asound.conf? | ||||||
|  |  | ||||||
| - name: set a login shell for the user vdr | - name: add a login shell for the user vdr | ||||||
|   user: |   user: | ||||||
|       name: '{{ vdr.user }}' |       name: '{{ vdr.user }}' | ||||||
|       shell: '/bin/bash' |       shell: '/bin/bash' | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ | |||||||
|     - collect-facts              # query system facts |     - collect-facts              # query system facts | ||||||
|     - vdr |     - vdr | ||||||
|     - yavdr-network |     - yavdr-network | ||||||
|     - samba-server |     - samba-install | ||||||
|     - samba-config |     - samba-config | ||||||
|     - nfs-server |     - nfs-server | ||||||
|     - grub-config |     - grub-config | ||||||
|   | |||||||
| @@ -10,6 +10,7 @@ | |||||||
|      - collect-facts              # query system facts |      - collect-facts              # query system facts | ||||||
|      - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers |      - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers | ||||||
|                                   # (e.g. nvidia, virtualbox) |                                   # (e.g. nvidia, virtualbox) | ||||||
|  |      - autoinstall-virtualbox-guest | ||||||
|      # - nvidia-387                # install very recent nvidia-387 from ppa:graphics-drivers/ppa |      # - nvidia-387                # install very recent nvidia-387 from ppa:graphics-drivers/ppa | ||||||
|      - vdr                        # install vdr and related packages |      - vdr                        # install vdr and related packages | ||||||
|      - yavdr-network              # enable network client capabilities |      - yavdr-network              # enable network client capabilities | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user