Cleanup empty lines at beginning of file

This commit is contained in:
Alexander Grothe 2017-06-20 16:19:08 +02:00
parent 5e5f9f346a
commit ddf59c34f1
46 changed files with 899 additions and 958 deletions

View File

@ -1,4 +1,3 @@
# file: group_vars/all # file: group_vars/all
# this is the standard text to put in templates # this is the standard text to put in templates

View File

@ -1,4 +1,3 @@
- name: Restart Samba - name: Restart Samba
systemd: systemd:
name: smbd.service name: smbd.service

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
if (( $EUID != 0 )); then if (( $EUID != 0 )); then
echo "This script must be run using sudo or as root" echo "This script must be run using sudo or as root"
exit exit

View File

@ -1,127 +1,126 @@
#!/usr/bin/env python
#!/usr/bin/env python # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
DOCUMENTATION = '''
---
module: hardware_facts
short_description: collects facts for kernel modules, usb and pci devices
description:
- This Module collects the vendor- and device ids for USB- and PCI(e)-devices and
currently loaded kernel modules.
options:
usb:
required: False
default: True
description:
- return a list of vendor- and device ids for usb devices in '04x:04x' notation
# This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules. pci:
DOCUMENTATION = ''' required: False
--- default: True
module: hardware_facts description:
short_description: collects facts for kernel modules, usb and pci devices - return a list of vendor- and device ids for pci devices in '04x:04x' notation
description:
- This Module collects the vendor- and device ids for USB- and PCI(e)-devices and
currently loaded kernel modules.
options:
usb:
required: False
default: True
description:
- return a list of vendor- and device ids for usb devices in '04x:04x' notation
pci: modules:
required: False required: False
default: True default: True
description: description:
- return a list of vendor- and device ids for pci devices in '04x:04x' notation - return a list of currently loaded kernel modules
modules: gpus:
required: False required: False
default: True default: True
description: description:
- return a list of currently loaded kernel modules - return a list of devices of the pci gpu class (0x030000)
notes:
- requres python-pyusb and python-kmodpy
requirements: [ ]
author: "Alexander Grothe <seahawk1986@gmx.de>"
'''
gpus: EXAMPLES = '''
required: False - name: get information about usb and pci hardware and loaded kernel modules
default: True hardware_facts:
description: usb: True
- return a list of devices of the pci gpu class (0x030000) pci: True
notes: modules: True
- requres python-pyusb and python-kmodpy - debug:
requirements: [ ] var: usb
author: "Alexander Grothe <seahawk1986@gmx.de>" - debug
''' var: pci
- debug
var: modules
- debug
var: gpus
'''
EXAMPLES = ''' import glob
- name: get information about usb and pci hardware and loaded kernel modules import json
hardware_facts: import os
usb: True import sys
pci: True import usb.core
modules: True from collections import namedtuple
- debug:
var: usb
- debug
var: pci
- debug
var: modules
- debug
var: gpus
'''
import glob import kmodpy
import json from ansible.module_utils.basic import *
import os
import sys
import usb.core
from collections import namedtuple
import kmodpy
from ansible.module_utils.basic import *
PCIDevice = namedtuple("PCIDevice", 'idVendor idProduct idClass pciPath') PCIDevice = namedtuple("PCIDevice", 'idVendor idProduct idClass pciPath')
def get_pci_devices(): def get_pci_devices():
for device in glob.glob('/sys/devices/pci*/*:*:*/'): for device in glob.glob('/sys/devices/pci*/*:*:*/'):
with open(os.path.join(device, 'device')) as d: with open(os.path.join(device, 'device')) as d:
product_id = int(d.read().strip(), 16) product_id = int(d.read().strip(), 16)
with open(os.path.join(device, 'vendor')) as d: with open(os.path.join(device, 'vendor')) as d:
vendor_id = int(d.read().strip(), 16) vendor_id = int(d.read().strip(), 16)
with open(os.path.join(device, 'class')) as d: with open(os.path.join(device, 'class')) as d:
class_id = int(d.read().strip(), 16) class_id = int(d.read().strip(), 16)
yield PCIDevice(idVendor=vendor_id, idProduct=product_id, idClass=class_id, pciPath=device) yield PCIDevice(idVendor=vendor_id, idProduct=product_id, idClass=class_id, pciPath=device)
def format_device_list(iterator): def format_device_list(iterator):
return ["{:04x}:{:04x}".format(d.idVendor, d.idProduct) for d in iterator] return ["{:04x}:{:04x}".format(d.idVendor, d.idProduct) for d in iterator]
def format_gpu_device_list(iterator): def format_gpu_device_list(iterator):
def get_entries(iterator): def get_entries(iterator):
for d in iterator: for d in iterator:
if d.idClass == 0x030000: if d.idClass == 0x030000:
yield ("{:04x}:{:04x}".format(d.idVendor, d.idProduct)) yield ("{:04x}:{:04x}".format(d.idVendor, d.idProduct))
return [entry for entry in get_entries(iterator)] return [entry for entry in get_entries(iterator)]
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),
} }
def main(): def main():
module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,) module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,)
collect_usb = module.params['usb'] collect_usb = module.params['usb']
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']
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: else:
usb_device = [] 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: else:
pci_devices = [] 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: else:
modules = [] modules = []
if collect_gpus: if collect_gpus:
gpus = format_gpu_device_list(get_pci_devices()) gpus = format_gpu_device_list(get_pci_devices())
else: else:
gpus = [] gpus = []
data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus} data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus}
module.exit_json(changed=False, ansible_facts=data, msg=data) module.exit_json(changed=False, ansible_facts=data, msg=data)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
DOCUMENTATION = ''' DOCUMENTATION = '''

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
from __future__ import print_function from __future__ import print_function
import ast import ast

View File

@ -1,3 +1,2 @@
[localhost] [localhost]
localhost connection=local localhost connection=local

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-dvbhddevice/tasks/main.yml # file roles/autoinstall-dvbhddevice/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-dvbsddevice/tasks/main.yml # file roles/autoinstall-dvbsddevice/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-imonlcd/tasks/main.yml # file roles/autoinstall-imonlcd/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-libcec-daemon/tasks/main.yml # file roles/autoinstall-libcec-daemon/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-pvr350/tasks/main.yml # file roles/autoinstall-pvr350/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-satip/tasks/main.yml # file roles/autoinstall-satip/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file roles/autoinstall-targavfd/tasks/main.yml # file roles/autoinstall-targavfd/tasks/main.yml

View File

@ -1,17 +1,16 @@
---
# file roles/autoinstall-ubuntu-drivers/tasks/main.yml
--- - name: apt | install ubuntu-drivers-common
# file roles/autoinstall-ubuntu-drivers/tasks/main.yml apt:
name: ubuntu-drivers-common
state: present
- name: apt | install ubuntu-drivers-common - name: ensure /etc/yavdr exists
apt: file:
name: ubuntu-drivers-common path: /etc/yavdr
state: present state: directory
mode: 0755
- name: ensure /etc/yavdr exists - name: let ubuntu-drivers automatically install additional drivers
file: command: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall
path: /etc/yavdr
state: directory
mode: 0755
- name: let ubuntu-drivers automatically install additional drivers
command: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall

View File

@ -1,4 +1,3 @@
--- ---
# file: roles/dvd/tasks/main.yml # file: roles/dvd/tasks/main.yml

View File

@ -1,4 +1,3 @@
system: system:
shutdown: poweroff shutdown: poweroff
grub: grub:

View File

@ -1,4 +1,3 @@
- name: Update GRUB - name: Update GRUB
command: update-grub command: update-grub
failed_when: ('error' in grub_register_update.stderr) failed_when: ('error' in grub_register_update.stderr)

View File

@ -1,4 +1,3 @@
- name: custom grub configuration for timeout and reboot halt - name: custom grub configuration for timeout and reboot halt
template: template:
src: templates/50_custom.j2 src: templates/50_custom.j2

View File

@ -1,4 +1,3 @@
#!/bin/sh #!/bin/sh
exec tail -n +3 $0 exec tail -n +3 $0

View File

@ -1,4 +1,3 @@
--- ---
- name: change udev rule to allow KODI to eject optical disks - name: change udev rule to allow KODI to eject optical disks

View File

@ -1,4 +1,3 @@
[Unit] [Unit]
Description=Start kodi in user session Description=Start kodi in user session

View File

@ -1,4 +1,3 @@
- name: install nfs server packages - name: install nfs server packages
apt: apt:
name: '{{ item }}' name: '{{ item }}'

View File

@ -1,5 +1,4 @@
/srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
/srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }}) {% for name, path in media_dirs.iteritems() %}
{% for name, path in media_dirs.iteritems() %} {{ path }} *(rw,fsid={{ loop.index }},sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }}{{ ',insecure' if nfs.insecure else '' }})
{{ path }} *(rw,fsid={{ loop.index }},sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }}{{ ',insecure' if nfs.insecure else '' }}) {% endfor %}
{% endfor %}

View File

@ -1,4 +1,3 @@
# file: roles/samba-config/tasks/main.yml # file: roles/samba-config/tasks/main.yml
# TODO: # TODO:

View File

@ -1,4 +1,3 @@
{{ ansible_managed_file | comment }} {{ ansible_managed_file | comment }}
#======================= Global Settings ======================= #======================= Global Settings =======================

View File

@ -1,4 +1,3 @@
# file: roles/samba-install/tasks/main.yml # file: roles/samba-install/tasks/main.yml
- name: install samba server - name: install samba server

View File

@ -1,4 +1,3 @@
foo: foo:
- bar - bar
- baz - baz

View File

@ -1,4 +1,3 @@
--- ---
- name: show vars - name: show vars
debug: debug:

View File

@ -1,5 +0,0 @@
vars:
foo:
- bar
- baz
- spam

View File

@ -1,4 +1,3 @@
--- ---
# file: roles/vdr/tasks/main.yml # file: roles/vdr/tasks/main.yml

View File

@ -1,4 +1,3 @@
--- ---
# file: roles/yavdr-common/defaults/main.yml # file: roles/yavdr-common/defaults/main.yml
@ -14,10 +13,10 @@ drivers:
sundtek: auto sundtek: auto
ddvb-dkms: auto ddvb-dkms: auto
extra_packages: extra_packages:
- vim - vim
- tree - tree
- w-scan - w-scan
vdr: vdr:
user: vdr user: vdr

View File

@ -1,4 +0,0 @@
// {{ ansible_managed_file }}
// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";

View File

@ -1,4 +1,3 @@
- name: apt | prevent automatic installation of recommended packages - name: apt | prevent automatic installation of recommended packages
template: template:
src: templates/90-norecommends.j2 src: templates/90-norecommends.j2

View File

@ -1,4 +1,3 @@
{{ ansible_managed_file | comment('c') }} {{ ansible_managed_file | comment('c') }}
// Recommends are as of now still abused in many packages // Recommends are as of now still abused in many packages
APT::Install-Recommends "0"; APT::Install-Recommends "0";

View File

@ -1,2 +1 @@
install_avahi: true install_avahi: true

View File

@ -1,4 +1,3 @@
--- ---
# this playbook sets up network services for a yaVDR installation # this playbook sets up network services for a yaVDR installation

View File

@ -1,4 +1,3 @@
--- ---
# file: roles/yavdr-xorg/tasks/main.yml # file: roles/yavdr-xorg/tasks/main.yml

View File

@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
# {{ ansible_managed_file }} # {{ ansible_managed_file }}
exec openbox-session exec openbox-session

View File

@ -1,4 +1,3 @@
env | grep "DISPLAY\|DBUS_SESSION_BUS_ADDRESS\|XDG_RUNTIME_DIR" > ~/.session-env env | grep "DISPLAY\|DBUS_SESSION_BUS_ADDRESS\|XDG_RUNTIME_DIR" > ~/.session-env
systemctl --user import-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS systemctl --user import-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
# file: roles/yavdr-xorg/templates/vdr-xorg.conf # file: roles/yavdr-xorg/templates/vdr-xorg.conf
# {{ ansible_managed_file }} # {{ ansible_managed_file }}

View File

@ -1,8 +0,0 @@
[Unit]
Description=X with verbose logging on %I
Wants=graphical.target
Before=graphical.target
[Service]
Type=forking
ExecStart=/usr/bin/x-daemon -logverbose 6 -noreset %I

View File

@ -1,4 +1,3 @@
[Unit] [Unit]
Description=X with verbose logging on %I Description=X with verbose logging on %I
Wants=graphical.target Wants=graphical.target

View File

@ -1,4 +1,3 @@
[Unit] [Unit]
Description=yaVDR Desktop Description=yaVDR Desktop
Requires=default.target Requires=default.target

View File

@ -1,4 +1,3 @@
--- ---
# file: yavdr07.yml # file: yavdr07.yml
# this playbook sets up a complete yaVDR 0.7 installation # this playbook sets up a complete yaVDR 0.7 installation