Compare commits
28 Commits
irmp
...
autoinstal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fc4dee8fc | ||
|
|
9060429ba6 | ||
|
|
052b46ee34 | ||
|
|
3e8e077164 | ||
|
|
7682a3373d | ||
|
|
51226ff994 | ||
|
|
636ff5722a | ||
|
|
eb02b5e3a7 | ||
|
|
0616ac4982 | ||
|
|
446fb8d53f | ||
|
|
04bf735d28 | ||
|
|
beb27b8c66 | ||
|
|
5a0e076e26 | ||
|
|
cebb916477 | ||
|
|
757eb39366 | ||
|
|
3ffeb101aa | ||
|
|
fe985aa6d9 | ||
|
|
1f5b845a4f | ||
|
|
45376bea14 | ||
|
|
3dec24c10a | ||
|
|
21e5150981 | ||
|
|
7257d8845a | ||
|
|
98513bba11 | ||
|
|
c78f370aca | ||
|
|
55770c4eb6 | ||
|
|
5c5826db9a | ||
|
|
fc2a33da97 | ||
|
|
c05b98cdf1 |
5502
Manual.html
5502
Manual.html
File diff suppressed because it is too large
Load Diff
178
Manual.org
178
Manual.org
@@ -166,6 +166,7 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation:
|
|||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- yavdr-common # install and configure the basic system
|
- yavdr-common # install and configure the basic system
|
||||||
|
- 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)
|
||||||
# - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa
|
# - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa
|
||||||
@@ -184,9 +185,11 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation:
|
|||||||
- autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found
|
- autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found
|
||||||
- autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected
|
- autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected
|
||||||
- autoinstall-hardware-irmp # install yavdr-hardware-irmp if a matching usb device is detected
|
- autoinstall-hardware-irmp # install yavdr-hardware-irmp if a matching usb device is detected
|
||||||
|
- autoinstall-dvbsky-firmware # download an install required firmware files for dvbsky cards
|
||||||
- kodi
|
- kodi
|
||||||
- dvd # set up packages and a udev rule to allow kodi and other players
|
- dvd # set up packages and a udev rule to allow kodi and other players
|
||||||
# to play and eject optical media
|
# to play and eject optical media
|
||||||
|
- wakeup # set up wakeup methods for rtc etc.
|
||||||
- grub-config # configure grub
|
- grub-config # configure grub
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
@@ -206,6 +209,7 @@ For a headless server installation ~yavdr07-headless.yml~ is a good choice
|
|||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- yavdr-common
|
- yavdr-common
|
||||||
|
- collect-facts # query system facts
|
||||||
- vdr
|
- vdr
|
||||||
- yavdr-network
|
- yavdr-network
|
||||||
- samba-server
|
- samba-server
|
||||||
@@ -213,6 +217,7 @@ For a headless server installation ~yavdr07-headless.yml~ is a good choice
|
|||||||
- nfs-server
|
- nfs-server
|
||||||
- grub-config
|
- grub-config
|
||||||
- autoinstall-satip
|
- autoinstall-satip
|
||||||
|
- wakeup
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
handlers:
|
handlers:
|
||||||
@@ -300,7 +305,6 @@ extra_packages:
|
|||||||
- bpython3
|
- bpython3
|
||||||
- htop
|
- htop
|
||||||
- tree
|
- tree
|
||||||
- vdr-addon-acpiwakeup
|
|
||||||
- vim
|
- vim
|
||||||
- w-scan
|
- w-scan
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -309,6 +313,7 @@ extra_packages:
|
|||||||
frontend: vdr
|
frontend: vdr
|
||||||
#system:
|
#system:
|
||||||
# shutdown: poweroff
|
# shutdown: poweroff
|
||||||
|
wakeup_method: acpiwakeup
|
||||||
grub:
|
grub:
|
||||||
timeout: 0
|
timeout: 0
|
||||||
boot_options: quiet nosplash
|
boot_options: quiet nosplash
|
||||||
@@ -412,9 +417,20 @@ vdr:
|
|||||||
*** tasks
|
*** tasks
|
||||||
yavdr-common executes the following tasks:
|
yavdr-common executes the following tasks:
|
||||||
**** main.yml
|
**** main.yml
|
||||||
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes :padline no
|
||||||
|
---
|
||||||
|
# file: roles/yavdr-common/tasks/main.yml
|
||||||
|
|
||||||
|
- name: basic installation
|
||||||
|
block:
|
||||||
|
- import_tasks: configure_apt.yml
|
||||||
|
- import_tasks: configure_system.yml
|
||||||
|
- import_tasks: create_directories.yml
|
||||||
|
tags: [install]
|
||||||
|
#+END_SRC
|
||||||
***** Disable default installation of recommended packages
|
***** Disable default installation of recommended packages
|
||||||
This task prevents apt to automatically install all recommended dependencies for packages:
|
This task prevents apt to automatically install all recommended dependencies for packages:
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes :padline no
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_apt.yml :mkdirp yes :padline no
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: apt | prevent automatic installation of recommended packages
|
- name: apt | prevent automatic installation of recommended packages
|
||||||
@@ -423,8 +439,22 @@ yavdr-common executes the following tasks:
|
|||||||
dest: /etc/apt/apt.conf.d/90norecommends
|
dest: /etc/apt/apt.conf.d/90norecommends
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
***** Set up package repositories
|
||||||
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_apt.yml :mkdirp yes
|
||||||
|
- name: add PPAs
|
||||||
|
apt_repository:
|
||||||
|
repo: '{{ item }}'
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
with_items: '{{ repositories }}'
|
||||||
|
|
||||||
|
- name: run apt-get dist-upgrade
|
||||||
|
apt:
|
||||||
|
upgrade: dist
|
||||||
|
update_cache: yes
|
||||||
|
#+END_SRC
|
||||||
***** Use bash instead of dash
|
***** Use bash instead of dash
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes
|
||||||
- name: use bash instead of dash
|
- name: use bash instead of dash
|
||||||
shell: |
|
shell: |
|
||||||
echo "set dash/sh false" | debconf-communicate
|
echo "set dash/sh false" | debconf-communicate
|
||||||
@@ -432,7 +462,7 @@ yavdr-common executes the following tasks:
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
***** create user vdr
|
***** create user vdr
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none :mkdirp yes
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :exports none :mkdirp yes
|
||||||
- name: create vdr group
|
- name: create vdr group
|
||||||
group:
|
group:
|
||||||
gid: '{{ vdr.gid }}'
|
gid: '{{ vdr.gid }}'
|
||||||
@@ -451,7 +481,7 @@ yavdr-common executes the following tasks:
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
***** Disable release-upgrade notifications
|
***** Disable release-upgrade notifications
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.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:
|
||||||
dest: /etc/update-manager/release-upgrades
|
dest: /etc/update-manager/release-upgrades
|
||||||
@@ -460,22 +490,8 @@ yavdr-common executes the following tasks:
|
|||||||
regexp: '^(Prompt=).*$'
|
regexp: '^(Prompt=).*$'
|
||||||
line: '\1never'
|
line: '\1never'
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
***** Set up package repositories
|
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes
|
|
||||||
- name: add PPAs
|
|
||||||
apt_repository:
|
|
||||||
repo: '{{ item }}'
|
|
||||||
state: present
|
|
||||||
update_cache: yes
|
|
||||||
with_items: '{{ repositories }}'
|
|
||||||
|
|
||||||
- name: run apt-get dist-upgrade
|
|
||||||
apt:
|
|
||||||
upgrade: dist
|
|
||||||
update_cache: yes
|
|
||||||
#+END_SRC
|
|
||||||
***** Install essential packages
|
***** Install essential packages
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes
|
||||||
- name: apt | install basic packages
|
- name: apt | install basic packages
|
||||||
apt:
|
apt:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
@@ -503,7 +519,7 @@ yavdr-common executes the following tasks:
|
|||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
***** Install additional packages (user defined)
|
***** Install additional packages (user defined)
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml
|
||||||
- name: apt | install extra packages
|
- name: apt | install extra packages
|
||||||
apt:
|
apt:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
@@ -512,26 +528,8 @@ yavdr-common executes the following tasks:
|
|||||||
with_items:
|
with_items:
|
||||||
'{{ extra_packages }}'
|
'{{ extra_packages }}'
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
***** Gather facts with custom modules
|
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes
|
|
||||||
- name: get information about usb and pci hardware and loaded kernel modules
|
|
||||||
hardware_facts:
|
|
||||||
usb: True
|
|
||||||
pci: True
|
|
||||||
modules: True
|
|
||||||
gpus: True
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
var: '{{ item }}'
|
|
||||||
verbosity: 1
|
|
||||||
with_items:
|
|
||||||
- usb
|
|
||||||
- pci
|
|
||||||
- gpus
|
|
||||||
- modules
|
|
||||||
#+END_SRC
|
|
||||||
***** create media directories
|
***** create media directories
|
||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none :mkdirp yes
|
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/create_directories.yml :exports none :mkdirp yes
|
||||||
- name: create media directories
|
- name: create media directories
|
||||||
file:
|
file:
|
||||||
dest: '{{ item.value }}'
|
dest: '{{ item.value }}'
|
||||||
@@ -548,6 +546,28 @@ yavdr-common executes the following tasks:
|
|||||||
APT::Install-Recommends "0";
|
APT::Install-Recommends "0";
|
||||||
APT::Install-Suggests "0";
|
APT::Install-Suggests "0";
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** collect facts about the system with custom modules
|
||||||
|
*** tasks
|
||||||
|
***** main.yml
|
||||||
|
#+BEGIN_SRC yaml :tangle roles/collect-facts/tasks/main.yml :mkdirp yes
|
||||||
|
- name: get information about usb and pci hardware and loaded kernel modules
|
||||||
|
hardware_facts:
|
||||||
|
usb: True
|
||||||
|
pci: True
|
||||||
|
modules: True
|
||||||
|
gpus: True
|
||||||
|
acpi_power_modes: True
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: '{{ item }}'
|
||||||
|
verbosity: 1
|
||||||
|
with_items:
|
||||||
|
- usb
|
||||||
|
- pci
|
||||||
|
- gpus
|
||||||
|
- modules
|
||||||
|
- acpi_power_modes
|
||||||
|
#+END_SRC
|
||||||
** vdr
|
** vdr
|
||||||
*** tasks
|
*** tasks
|
||||||
**** install the basic vdr packages
|
**** install the basic vdr packages
|
||||||
@@ -3162,6 +3182,7 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
|
|||||||
- name: apt | install vdr-plugin-satip if a Sat>IP server has been detected
|
- name: apt | install vdr-plugin-satip if a Sat>IP server has been detected
|
||||||
apt:
|
apt:
|
||||||
name: vdr-plugin-satip
|
name: vdr-plugin-satip
|
||||||
|
state: present
|
||||||
when: satip_devices
|
when: satip_devices
|
||||||
notify: [ 'Restart VDR' ]
|
notify: [ 'Restart VDR' ]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -3225,6 +3246,11 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
|
|||||||
when: '"0070:4000" in pci or "4444:0016" in pci'
|
when: '"0070:4000" in pci or "4444:0016" in pci'
|
||||||
notify: [ 'Restart VDR' ]
|
notify: [ 'Restart VDR' ]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** autoinstall-dvbsky-firmware
|
||||||
|
*** defaults
|
||||||
|
#+INCLUDE: "roles/autoinstall-dvbsky-firmware/defaults/main.yml" src yaml
|
||||||
|
*** tasks
|
||||||
|
#+INCLUDE: "roles/autoinstall-dvbsky-firmware/tasks/main.yml" src yaml
|
||||||
** TODO autoinstall-dvbhddevice
|
** TODO autoinstall-dvbhddevice
|
||||||
Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware sollte in yavdr-firmware stecken
|
Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware sollte in yavdr-firmware stecken
|
||||||
*** tasks
|
*** tasks
|
||||||
@@ -3260,6 +3286,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
|
|||||||
- name: apt | install yavdr-hardware-irmp if connected
|
- name: apt | install yavdr-hardware-irmp if connected
|
||||||
apt:
|
apt:
|
||||||
name: yavdr-hardware-irmp
|
name: yavdr-hardware-irmp
|
||||||
|
state: present
|
||||||
when: '"1209:4444" in usb'
|
when: '"1209:4444" in usb'
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -3536,6 +3563,31 @@ system:
|
|||||||
mode:
|
mode:
|
||||||
- "1280x720_60"
|
- "1280x720_60"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** wakeup
|
||||||
|
*** defaults
|
||||||
|
#+BEGIN_SRC yaml :tangle roles/wakeup/defaults/main.yml :padline no
|
||||||
|
---
|
||||||
|
# file roles/wakeup/defaults/main.yml
|
||||||
|
wakeup_method: "acpiwakeup"
|
||||||
|
#+END_SRC
|
||||||
|
*** tasks
|
||||||
|
#+BEGIN_SRC yaml :tangle roles/wakeup/tasks/main.yml :padline no
|
||||||
|
---
|
||||||
|
# file roles/wakeup/tasks/main.yml
|
||||||
|
|
||||||
|
- name: install and configure vdr-addon-acpiwakeup
|
||||||
|
block:
|
||||||
|
- apt:
|
||||||
|
name: vdr-addon-acpiwakeup
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- lineinfile:
|
||||||
|
path: /etc/vdr/vdr-addon-acpiwakeup.conf
|
||||||
|
regexp: '^ACPI_ENABLED='
|
||||||
|
line: 'ACPI_ENABLED=true'
|
||||||
|
|
||||||
|
when: wakeup_method == "acpiwakeup"
|
||||||
|
#+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
|
||||||
@@ -3633,6 +3685,12 @@ DOCUMENTATION = '''
|
|||||||
default: True
|
default: True
|
||||||
description:
|
description:
|
||||||
- return a list of devices of the pci gpu class (0x030000)
|
- return a list of devices of the pci gpu class (0x030000)
|
||||||
|
|
||||||
|
acpi_power_modes:
|
||||||
|
required: False
|
||||||
|
default: True
|
||||||
|
description:
|
||||||
|
- return a list of supported acpi power saving modes
|
||||||
notes:
|
notes:
|
||||||
- requres python-pyusb and python-kmodpy
|
- requres python-pyusb and python-kmodpy
|
||||||
requirements: [ ]
|
requirements: [ ]
|
||||||
@@ -3645,6 +3703,7 @@ EXAMPLES = '''
|
|||||||
usb: True
|
usb: True
|
||||||
pci: True
|
pci: True
|
||||||
modules: True
|
modules: True
|
||||||
|
acpi_power_modes: True
|
||||||
- debug:
|
- debug:
|
||||||
var: usb
|
var: usb
|
||||||
- debug
|
- debug
|
||||||
@@ -3699,11 +3758,21 @@ def format_gpu_device_list(iterator):
|
|||||||
"VendorID": d.idVendor, "ProductID": d.idProduct}
|
"VendorID": d.idVendor, "ProductID": d.idProduct}
|
||||||
return [entry for entry in get_entries(iterator)]
|
return [entry for entry in get_entries(iterator)]
|
||||||
|
|
||||||
|
def list_acpi_power_modes():
|
||||||
|
acpi_power_modes = []
|
||||||
|
try:
|
||||||
|
with open('/sys/power/state') as f:
|
||||||
|
acpi_power_modes = [l for l in f.readline().split()]
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
return acpi_power_modes
|
||||||
|
|
||||||
arg_specs = {
|
arg_specs = {
|
||||||
'usb': dict(default=True, type='bool', required=False),
|
'usb': dict(default=True, type='bool', required=False),
|
||||||
'pci': dict(default=True, type='bool', required=False),
|
'pci': dict(default=True, type='bool', required=False),
|
||||||
'modules': dict(default=True, type='bool', required=False),
|
'modules': dict(default=True, type='bool', required=False),
|
||||||
'gpus': dict(default=True, type='bool', required=False),
|
'gpus': dict(default=True, type='bool', required=False),
|
||||||
|
'acpi_power_modes': dict(default=True, type='bool', required=False),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3713,24 +3782,32 @@ def main():
|
|||||||
collect_pci = module.params['pci']
|
collect_pci = module.params['pci']
|
||||||
collect_modules = module.params['modules']
|
collect_modules = module.params['modules']
|
||||||
collect_gpus = module.params['gpus']
|
collect_gpus = module.params['gpus']
|
||||||
|
collect_acpi_power_modes = module.params['acpi_power_modes']
|
||||||
|
|
||||||
|
usb_devices = []
|
||||||
|
pci_devices = []
|
||||||
|
modules = []
|
||||||
|
gpus = []
|
||||||
|
acpi_power_modes = []
|
||||||
|
|
||||||
if collect_usb:
|
if collect_usb:
|
||||||
usb_devices = format_device_list(usb.core.find(find_all=True))
|
usb_devices = format_device_list(usb.core.find(find_all=True))
|
||||||
else:
|
|
||||||
usb_device = []
|
|
||||||
if collect_pci:
|
if collect_pci:
|
||||||
pci_devices = format_device_list(get_pci_devices())
|
pci_devices = format_device_list(get_pci_devices())
|
||||||
else:
|
|
||||||
pci_devices = []
|
|
||||||
if collect_modules:
|
if collect_modules:
|
||||||
k = kmodpy.Kmod()
|
k = kmodpy.Kmod()
|
||||||
modules = [m[0] for m in k.loaded()]
|
modules = [m[0] for m in k.loaded()]
|
||||||
else:
|
|
||||||
modules = []
|
|
||||||
if collect_gpus:
|
if collect_gpus:
|
||||||
gpus = format_gpu_device_list(get_pci_devices())
|
gpus = format_gpu_device_list(get_pci_devices())
|
||||||
else:
|
|
||||||
gpus = []
|
if collect_acpi_power_modes:
|
||||||
data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus}
|
acpi_power_modes = list_acpi_power_modes()
|
||||||
|
|
||||||
|
data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus,
|
||||||
|
'acpi_power_modes': acpi_power_modes}
|
||||||
module.exit_json(changed=False, ansible_facts=data, msg=data)
|
module.exit_json(changed=False, ansible_facts=data, msg=data)
|
||||||
|
|
||||||
|
|
||||||
@@ -4133,6 +4210,9 @@ if __name__ == '__main__':
|
|||||||
#+BEGIN_SRC yaml :tangle handlers/main.yml :mkdirp yes
|
#+BEGIN_SRC yaml :tangle handlers/main.yml :mkdirp yes
|
||||||
- name: Reconfigure unattended upgrades with dpkg
|
- name: Reconfigure unattended upgrades with dpkg
|
||||||
command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
|
command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
|
||||||
|
|
||||||
|
- name: Trigger Udev
|
||||||
|
command: 'udevadm trigger '
|
||||||
|
|
||||||
- name: Restart Samba
|
- name: Restart Samba
|
||||||
systemd:
|
systemd:
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ extra_packages:
|
|||||||
- bpython3
|
- bpython3
|
||||||
- htop
|
- htop
|
||||||
- tree
|
- tree
|
||||||
- vdr-addon-acpiwakeup
|
|
||||||
- vim
|
- vim
|
||||||
- w-scan
|
- w-scan
|
||||||
frontend: vdr
|
frontend: vdr
|
||||||
#system:
|
#system:
|
||||||
# shutdown: poweroff
|
# shutdown: poweroff
|
||||||
|
wakeup_method: acpiwakeup
|
||||||
grub:
|
grub:
|
||||||
timeout: 0
|
timeout: 0
|
||||||
boot_options: quiet nosplash
|
boot_options: quiet nosplash
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
- name: Reconfigure unattended upgrades with dpkg
|
- name: Reconfigure unattended upgrades with dpkg
|
||||||
command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
|
command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
|
||||||
|
|
||||||
|
- name: Trigger Udev
|
||||||
|
command: 'udevadm trigger '
|
||||||
|
|
||||||
- name: Restart Samba
|
- name: Restart Samba
|
||||||
systemd:
|
systemd:
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ DOCUMENTATION = '''
|
|||||||
default: True
|
default: True
|
||||||
description:
|
description:
|
||||||
- return a list of devices of the pci gpu class (0x030000)
|
- return a list of devices of the pci gpu class (0x030000)
|
||||||
|
|
||||||
|
acpi_power_modes:
|
||||||
|
required: False
|
||||||
|
default: True
|
||||||
|
description:
|
||||||
|
- return a list of supported acpi power saving modes
|
||||||
notes:
|
notes:
|
||||||
- requres python-pyusb and python-kmodpy
|
- requres python-pyusb and python-kmodpy
|
||||||
requirements: [ ]
|
requirements: [ ]
|
||||||
@@ -43,6 +49,7 @@ EXAMPLES = '''
|
|||||||
usb: True
|
usb: True
|
||||||
pci: True
|
pci: True
|
||||||
modules: True
|
modules: True
|
||||||
|
acpi_power_modes: True
|
||||||
- debug:
|
- debug:
|
||||||
var: usb
|
var: usb
|
||||||
- debug
|
- debug
|
||||||
@@ -97,11 +104,21 @@ def format_gpu_device_list(iterator):
|
|||||||
"VendorID": d.idVendor, "ProductID": d.idProduct}
|
"VendorID": d.idVendor, "ProductID": d.idProduct}
|
||||||
return [entry for entry in get_entries(iterator)]
|
return [entry for entry in get_entries(iterator)]
|
||||||
|
|
||||||
|
def list_acpi_power_modes():
|
||||||
|
acpi_power_modes = []
|
||||||
|
try:
|
||||||
|
with open('/sys/power/state') as f:
|
||||||
|
acpi_power_modes = [l for l in f.readline().split()]
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
return acpi_power_modes
|
||||||
|
|
||||||
arg_specs = {
|
arg_specs = {
|
||||||
'usb': dict(default=True, type='bool', required=False),
|
'usb': dict(default=True, type='bool', required=False),
|
||||||
'pci': dict(default=True, type='bool', required=False),
|
'pci': dict(default=True, type='bool', required=False),
|
||||||
'modules': dict(default=True, type='bool', required=False),
|
'modules': dict(default=True, type='bool', required=False),
|
||||||
'gpus': dict(default=True, type='bool', required=False),
|
'gpus': dict(default=True, type='bool', required=False),
|
||||||
|
'acpi_power_modes': dict(default=True, type='bool', required=False),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,24 +128,32 @@ def main():
|
|||||||
collect_pci = module.params['pci']
|
collect_pci = module.params['pci']
|
||||||
collect_modules = module.params['modules']
|
collect_modules = module.params['modules']
|
||||||
collect_gpus = module.params['gpus']
|
collect_gpus = module.params['gpus']
|
||||||
|
collect_acpi_power_modes = module.params['acpi_power_modes']
|
||||||
|
|
||||||
|
usb_devices = []
|
||||||
|
pci_devices = []
|
||||||
|
modules = []
|
||||||
|
gpus = []
|
||||||
|
acpi_power_modes = []
|
||||||
|
|
||||||
if collect_usb:
|
if collect_usb:
|
||||||
usb_devices = format_device_list(usb.core.find(find_all=True))
|
usb_devices = format_device_list(usb.core.find(find_all=True))
|
||||||
else:
|
|
||||||
usb_device = []
|
|
||||||
if collect_pci:
|
if collect_pci:
|
||||||
pci_devices = format_device_list(get_pci_devices())
|
pci_devices = format_device_list(get_pci_devices())
|
||||||
else:
|
|
||||||
pci_devices = []
|
|
||||||
if collect_modules:
|
if collect_modules:
|
||||||
k = kmodpy.Kmod()
|
k = kmodpy.Kmod()
|
||||||
modules = [m[0] for m in k.loaded()]
|
modules = [m[0] for m in k.loaded()]
|
||||||
else:
|
|
||||||
modules = []
|
|
||||||
if collect_gpus:
|
if collect_gpus:
|
||||||
gpus = format_gpu_device_list(get_pci_devices())
|
gpus = format_gpu_device_list(get_pci_devices())
|
||||||
else:
|
|
||||||
gpus = []
|
if collect_acpi_power_modes:
|
||||||
data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus}
|
acpi_power_modes = list_acpi_power_modes()
|
||||||
|
|
||||||
|
data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus,
|
||||||
|
'acpi_power_modes': acpi_power_modes}
|
||||||
module.exit_json(changed=False, ansible_facts=data, msg=data)
|
module.exit_json(changed=False, ansible_facts=data, msg=data)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3
roles/autoinstall-dvbsky-firmware/defaults/main.yml
Normal file
3
roles/autoinstall-dvbsky-firmware/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
# file roles/autoinstall-dvbsky-firmware
|
||||||
|
dvbsky_firmware_files: []
|
||||||
43
roles/autoinstall-dvbsky-firmware/tasks/main.yml
Normal file
43
roles/autoinstall-dvbsky-firmware/tasks/main.yml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
# file roles/autoinstall-dvbsky-firmware/tasks/main.yml
|
||||||
|
|
||||||
|
- name: determine needed firmware files by device ids
|
||||||
|
block:
|
||||||
|
- 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
|
||||||
|
when:
|
||||||
|
- not dvbsky_firmware_files
|
||||||
|
|
||||||
|
- 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 }}'
|
||||||
|
notify: ['Trigger Udev']
|
||||||
|
|
||||||
|
# Remove temporary files
|
||||||
|
- file:
|
||||||
|
path: /tmp/dvbsky-firmware
|
||||||
|
state: absent
|
||||||
|
when:
|
||||||
|
- dvbsky_firmware_files is defined
|
||||||
|
- dvbsky_firmware_files
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
- autodetect
|
||||||
|
- dvbsky
|
||||||
3
roles/autoinstall-hardware-irmp/meta/main.yml
Normal file
3
roles/autoinstall-hardware-irmp/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- { role: collect-facts }
|
||||||
@@ -4,4 +4,5 @@
|
|||||||
- name: apt | install yavdr-hardware-irmp if connected
|
- name: apt | install yavdr-hardware-irmp if connected
|
||||||
apt:
|
apt:
|
||||||
name: yavdr-hardware-irmp
|
name: yavdr-hardware-irmp
|
||||||
|
state: present
|
||||||
when: '"1209:4444" in usb'
|
when: '"1209:4444" in usb'
|
||||||
|
|||||||
@@ -11,5 +11,6 @@
|
|||||||
- name: apt | install vdr-plugin-satip if a Sat>IP server has been detected
|
- name: apt | install vdr-plugin-satip if a Sat>IP server has been detected
|
||||||
apt:
|
apt:
|
||||||
name: vdr-plugin-satip
|
name: vdr-plugin-satip
|
||||||
|
state: present
|
||||||
when: satip_devices
|
when: satip_devices
|
||||||
notify: [ 'Restart VDR' ]
|
notify: [ 'Restart VDR' ]
|
||||||
|
|||||||
17
roles/collect-facts/tasks/main.yml
Normal file
17
roles/collect-facts/tasks/main.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
- name: get information about usb and pci hardware and loaded kernel modules
|
||||||
|
hardware_facts:
|
||||||
|
usb: True
|
||||||
|
pci: True
|
||||||
|
modules: True
|
||||||
|
gpus: True
|
||||||
|
acpi_power_modes: True
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: '{{ item }}'
|
||||||
|
verbosity: 1
|
||||||
|
with_items:
|
||||||
|
- usb
|
||||||
|
- pci
|
||||||
|
- gpus
|
||||||
|
- modules
|
||||||
|
- acpi_power_modes
|
||||||
3
roles/wakeup/defaults/main.yml
Normal file
3
roles/wakeup/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
# file roles/wakeup/defaults/main.yml
|
||||||
|
wakeup_method: "acpiwakeup"
|
||||||
15
roles/wakeup/tasks/main.yml
Normal file
15
roles/wakeup/tasks/main.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
# file roles/wakeup/tasks/main.yml
|
||||||
|
|
||||||
|
- name: install and configure vdr-addon-acpiwakeup
|
||||||
|
block:
|
||||||
|
- apt:
|
||||||
|
name: vdr-addon-acpiwakeup
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- lineinfile:
|
||||||
|
path: /etc/vdr/vdr-addon-acpiwakeup.conf
|
||||||
|
regexp: '^ACPI_ENABLED='
|
||||||
|
line: 'ACPI_ENABLED=true'
|
||||||
|
|
||||||
|
when: wakeup_method == "acpiwakeup"
|
||||||
17
roles/yavdr-common/tasks/configure_apt.yml
Normal file
17
roles/yavdr-common/tasks/configure_apt.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: apt | prevent automatic installation of recommended packages
|
||||||
|
template:
|
||||||
|
src: templates/90-norecommends.j2
|
||||||
|
dest: /etc/apt/apt.conf.d/90norecommends
|
||||||
|
- name: add PPAs
|
||||||
|
apt_repository:
|
||||||
|
repo: '{{ item }}'
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
with_items: '{{ repositories }}'
|
||||||
|
|
||||||
|
- name: run apt-get dist-upgrade
|
||||||
|
apt:
|
||||||
|
upgrade: dist
|
||||||
|
update_cache: yes
|
||||||
57
roles/yavdr-common/tasks/configure_system.yml
Normal file
57
roles/yavdr-common/tasks/configure_system.yml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
- name: use bash instead of dash
|
||||||
|
shell: |
|
||||||
|
echo "set dash/sh false" | debconf-communicate
|
||||||
|
dpkg-reconfigure -f noninteractive dash
|
||||||
|
- name: create vdr group
|
||||||
|
group:
|
||||||
|
gid: '{{ vdr.gid }}'
|
||||||
|
state: present
|
||||||
|
name: '{{ vdr.group }}'
|
||||||
|
|
||||||
|
- name: create vdr user
|
||||||
|
user:
|
||||||
|
name: '{{ vdr.user }}'
|
||||||
|
group: '{{ vdr.group }}'
|
||||||
|
uid: '{{ vdr.uid }}'
|
||||||
|
home: '{{ vdr.home }}'
|
||||||
|
shell: '/bin/bash'
|
||||||
|
state: present
|
||||||
|
append: true
|
||||||
|
- name: disable release-upgrade notifications
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/update-manager/release-upgrades
|
||||||
|
backrefs: yes
|
||||||
|
state: present
|
||||||
|
regexp: '^(Prompt=).*$'
|
||||||
|
line: '\1never'
|
||||||
|
- name: apt | install basic packages
|
||||||
|
apt:
|
||||||
|
name: '{{ item }}'
|
||||||
|
state: present
|
||||||
|
install_recommends: no
|
||||||
|
with_items:
|
||||||
|
- anacron
|
||||||
|
- acl
|
||||||
|
- at
|
||||||
|
- bash-completion
|
||||||
|
#- biosdevname # caution: may change device names after a minimal installation!
|
||||||
|
- debconf-utils
|
||||||
|
- linux-firmware
|
||||||
|
- psmisc
|
||||||
|
- python-kmodpy
|
||||||
|
- python-requests
|
||||||
|
- python-usb
|
||||||
|
- python3-usb
|
||||||
|
- software-properties-common
|
||||||
|
- ssh
|
||||||
|
- wget
|
||||||
|
- wpasupplicant
|
||||||
|
- usbutils
|
||||||
|
- xfsprogs
|
||||||
|
- name: apt | install extra packages
|
||||||
|
apt:
|
||||||
|
name: '{{ item }}'
|
||||||
|
state: present
|
||||||
|
install_recommends: no
|
||||||
|
with_items:
|
||||||
|
'{{ extra_packages }}'
|
||||||
8
roles/yavdr-common/tasks/create_directories.yml
Normal file
8
roles/yavdr-common/tasks/create_directories.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- name: create media directories
|
||||||
|
file:
|
||||||
|
dest: '{{ item.value }}'
|
||||||
|
owner: '{{ vdr.user }}'
|
||||||
|
group: '{{ vdr.group }}'
|
||||||
|
state: directory
|
||||||
|
mode: '0777'
|
||||||
|
with_dict: '{{ media_dirs }}'
|
||||||
@@ -1,97 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
# file: roles/yavdr-common/tasks/main.yml
|
||||||
|
|
||||||
- name: apt | prevent automatic installation of recommended packages
|
- name: basic installation
|
||||||
template:
|
block:
|
||||||
src: templates/90-norecommends.j2
|
- import_tasks: configure_apt.yml
|
||||||
dest: /etc/apt/apt.conf.d/90norecommends
|
- import_tasks: configure_system.yml
|
||||||
- name: use bash instead of dash
|
- import_tasks: create_directories.yml
|
||||||
shell: |
|
tags: [install]
|
||||||
echo "set dash/sh false" | debconf-communicate
|
|
||||||
dpkg-reconfigure -f noninteractive dash
|
|
||||||
- name: create vdr group
|
|
||||||
group:
|
|
||||||
gid: '{{ vdr.gid }}'
|
|
||||||
state: present
|
|
||||||
name: '{{ vdr.group }}'
|
|
||||||
|
|
||||||
- name: create vdr user
|
|
||||||
user:
|
|
||||||
name: '{{ vdr.user }}'
|
|
||||||
group: '{{ vdr.group }}'
|
|
||||||
uid: '{{ vdr.uid }}'
|
|
||||||
home: '{{ vdr.home }}'
|
|
||||||
shell: '/bin/bash'
|
|
||||||
state: present
|
|
||||||
append: true
|
|
||||||
- name: disable release-upgrade notifications
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/update-manager/release-upgrades
|
|
||||||
backrefs: yes
|
|
||||||
state: present
|
|
||||||
regexp: '^(Prompt=).*$'
|
|
||||||
line: '\1never'
|
|
||||||
- name: add PPAs
|
|
||||||
apt_repository:
|
|
||||||
repo: '{{ item }}'
|
|
||||||
state: present
|
|
||||||
update_cache: yes
|
|
||||||
with_items: '{{ repositories }}'
|
|
||||||
|
|
||||||
- name: run apt-get dist-upgrade
|
|
||||||
apt:
|
|
||||||
upgrade: dist
|
|
||||||
update_cache: yes
|
|
||||||
- name: apt | install basic packages
|
|
||||||
apt:
|
|
||||||
name: '{{ item }}'
|
|
||||||
state: present
|
|
||||||
install_recommends: no
|
|
||||||
with_items:
|
|
||||||
- anacron
|
|
||||||
- acl
|
|
||||||
- at
|
|
||||||
- bash-completion
|
|
||||||
#- biosdevname # caution: may change device names after a minimal installation!
|
|
||||||
- debconf-utils
|
|
||||||
- linux-firmware
|
|
||||||
- psmisc
|
|
||||||
- python-kmodpy
|
|
||||||
- python-requests
|
|
||||||
- python-usb
|
|
||||||
- python3-usb
|
|
||||||
- software-properties-common
|
|
||||||
- ssh
|
|
||||||
- wget
|
|
||||||
- wpasupplicant
|
|
||||||
- usbutils
|
|
||||||
- xfsprogs
|
|
||||||
- name: apt | install extra packages
|
|
||||||
apt:
|
|
||||||
name: '{{ item }}'
|
|
||||||
state: present
|
|
||||||
install_recommends: no
|
|
||||||
with_items:
|
|
||||||
'{{ extra_packages }}'
|
|
||||||
- name: get information about usb and pci hardware and loaded kernel modules
|
|
||||||
hardware_facts:
|
|
||||||
usb: True
|
|
||||||
pci: True
|
|
||||||
modules: True
|
|
||||||
gpus: True
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
var: '{{ item }}'
|
|
||||||
verbosity: 1
|
|
||||||
with_items:
|
|
||||||
- usb
|
|
||||||
- pci
|
|
||||||
- gpus
|
|
||||||
- modules
|
|
||||||
- name: create media directories
|
|
||||||
file:
|
|
||||||
dest: '{{ item.value }}'
|
|
||||||
owner: '{{ vdr.user }}'
|
|
||||||
group: '{{ vdr.group }}'
|
|
||||||
state: directory
|
|
||||||
mode: '0777'
|
|
||||||
with_dict: '{{ media_dirs }}'
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- yavdr-common
|
- yavdr-common
|
||||||
|
- collect-facts # query system facts
|
||||||
- vdr
|
- vdr
|
||||||
- yavdr-network
|
- yavdr-network
|
||||||
- samba-server
|
- samba-server
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
- nfs-server
|
- nfs-server
|
||||||
- grub-config
|
- grub-config
|
||||||
- autoinstall-satip
|
- autoinstall-satip
|
||||||
|
- wakeup
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
handlers:
|
handlers:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- yavdr-common # install and configure the basic system
|
- yavdr-common # install and configure the basic system
|
||||||
|
- 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)
|
||||||
# - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa
|
# - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa
|
||||||
@@ -25,9 +26,11 @@
|
|||||||
- autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found
|
- autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found
|
||||||
- autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected
|
- autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected
|
||||||
- autoinstall-hardware-irmp # install yavdr-hardware-irmp if a matching usb device is detected
|
- autoinstall-hardware-irmp # install yavdr-hardware-irmp if a matching usb device is detected
|
||||||
|
- autoinstall-dvbsky-firmware # download an install required firmware files for dvbsky cards
|
||||||
- kodi
|
- kodi
|
||||||
- dvd # set up packages and a udev rule to allow kodi and other players
|
- dvd # set up packages and a udev rule to allow kodi and other players
|
||||||
# to play and eject optical media
|
# to play and eject optical media
|
||||||
|
- wakeup # set up wakeup methods for rtc etc.
|
||||||
- grub-config # configure grub
|
- grub-config # configure grub
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|||||||
Reference in New Issue
Block a user