Merge branch 'master' of https://github.com/yavdr/yavdr-ansible
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
system:
|
||||
shutdown: reboot
|
||||
shutdown: poweroff
|
||||
grub:
|
||||
timeout: 0
|
||||
@@ -5,11 +5,12 @@
|
||||
mode: '0775'
|
||||
notify: [ 'Update GRUB' ]
|
||||
|
||||
# TODO: add special case if plymouth is used
|
||||
- name: let the system boot quietly
|
||||
lineinfile:
|
||||
dest: /etc/default/grub
|
||||
state: present
|
||||
regexp: '^(GRUB_CMDLINE_LINUX_DEFAULT=")'
|
||||
line: '\1quiet nosplash"'
|
||||
line: '\1{{ system.grub.boot_options}}"'
|
||||
backrefs: yes
|
||||
notify: [ 'Update GRUB' ]
|
||||
@@ -14,4 +14,3 @@ if [ "${recordfail}" = 1 ]; then
|
||||
else
|
||||
set timeout={{ system.grub.timeout if system.grub.timeout is defined else 0 }}
|
||||
fi
|
||||
|
||||
17
roles/samba-config/tasks/main.yml
Normal file
17
roles/samba-config/tasks/main.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
# file: roles/samba-config/tasks/main.yml
|
||||
|
||||
# TODO:
|
||||
#- name: divert original smbd.conf
|
||||
|
||||
- name: create smb.conf.custom
|
||||
file:
|
||||
state: touch
|
||||
dest: '/etc/samba/smb.conf.custom'
|
||||
notify: [ 'Restart Samba' ]
|
||||
|
||||
- name: expand template for smb.conf
|
||||
template:
|
||||
src: 'templates/smb.conf.j2'
|
||||
dest: '/etc/samba/smb.conf'
|
||||
#validate: 'testparm -s %s'
|
||||
notify: [ 'Restart Samba' ]
|
||||
91
roles/samba-config/templates/smb.conf.j2
Normal file
91
roles/samba-config/templates/smb.conf.j2
Normal file
@@ -0,0 +1,91 @@
|
||||
# {{ ansible_managed_file }}
|
||||
|
||||
#======================= Global Settings =======================
|
||||
|
||||
[global]
|
||||
|
||||
## Browsing/Identification ###
|
||||
|
||||
# Change this to the workgroup/NT-domain name your Samba server will part of
|
||||
workgroup = {{ samba.workgroup }}
|
||||
|
||||
# server string is the equivalent of the NT Description field
|
||||
server string = %h server (Samba, Ubuntu)
|
||||
|
||||
# This will prevent nmbd to search for NetBIOS names through DNS.
|
||||
dns proxy = no
|
||||
|
||||
#### Debugging/Accounting ####
|
||||
|
||||
# This tells Samba to use a separate log file for each machine
|
||||
# that connects
|
||||
log file = /var/log/samba/log.%m
|
||||
|
||||
# Cap the size of the individual log files (in KiB).
|
||||
max log size = 1000
|
||||
|
||||
# We want Samba to log a minimum amount of information to syslog. Everything
|
||||
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
|
||||
# through syslog you should set the following parameter to something higher.
|
||||
syslog = 0
|
||||
|
||||
# Do something sensible when Samba crashes: mail the admin a backtrace
|
||||
panic action = /usr/share/samba/panic-action %d
|
||||
|
||||
|
||||
####### Authentication #######
|
||||
|
||||
# "security = user" is always a good idea. This will require a Unix account
|
||||
# in this server for every user accessing the server. See
|
||||
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
|
||||
# in the samba-doc package for details.
|
||||
# security = user
|
||||
|
||||
# You may wish to use password encryption. See the section on
|
||||
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
|
||||
encrypt passwords = true
|
||||
|
||||
# If you are using encrypted passwords, Samba will need to know what
|
||||
# password database type you are using.
|
||||
passdb backend = tdbsam
|
||||
|
||||
obey pam restrictions = yes
|
||||
|
||||
# This boolean parameter controls whether Samba attempts to sync the Unix
|
||||
# password with the SMB password when the encrypted SMB password in the
|
||||
# passdb is changed.
|
||||
unix password sync = yes
|
||||
|
||||
# For Unix password sync to work on a Debian GNU/Linux system, the following
|
||||
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
|
||||
# sending the correct chat script for the passwd program in Debian Sarge).
|
||||
passwd program = /usr/bin/passwd %u
|
||||
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
|
||||
|
||||
# This boolean controls whether PAM will be used for password changes
|
||||
# when requested by an SMB client instead of the program listed in
|
||||
# 'passwd program'. The default is 'no'.
|
||||
pam password change = yes
|
||||
|
||||
# This option controls how unsuccessful authentication attempts are mapped
|
||||
# to anonymous connections
|
||||
map to guest = bad user
|
||||
|
||||
{% for name, path in media_dirs.iteritems() %}
|
||||
[{{ name }}]
|
||||
path = {{ path }}
|
||||
comment = {{ name }} on %h
|
||||
browseable = yes
|
||||
guest ok = yes
|
||||
writeable = yes
|
||||
browseable = yes
|
||||
create mode = 0664
|
||||
directory mode = 0775
|
||||
force user = {{ vdr.user }}
|
||||
force group = {{ vdr.group }}
|
||||
follow symlinks = yes
|
||||
wide links = yes
|
||||
|
||||
{% endfor %}
|
||||
|
||||
include = /etc/samba/smb.conf.custom
|
||||
12
roles/samba-install/tasks/main.yml
Normal file
12
roles/samba-install/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
# file: roles/samba-install/tasks/main.yml
|
||||
|
||||
- name: install samba server
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
install_recommends: no
|
||||
with_items:
|
||||
- samba
|
||||
- samba-common
|
||||
- samba-common-bin
|
||||
- tdb-tools
|
||||
61
roles/vdr/tasks/main.yml
Normal file
61
roles/vdr/tasks/main.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
# file: roles/vdr/tasks/main.yml
|
||||
|
||||
- name: apt | install basic vdr packages
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
install_recommends: no
|
||||
with_items:
|
||||
- vdr
|
||||
- vdrctl
|
||||
- vdr-plugin-dbus2vdr
|
||||
|
||||
- name: create vdr recdir
|
||||
file:
|
||||
state: directory
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
mode: 0775
|
||||
dest: '{{ vdr.recdir }}'
|
||||
|
||||
- name: set option to use hide-first-recording-level patch
|
||||
blockinfile:
|
||||
dest: /etc/vdr/conf.d/04-vdr-hide-first-recordinglevel.conf
|
||||
create: true
|
||||
block: |
|
||||
[vdr]
|
||||
--hide-first-recording-level
|
||||
when:
|
||||
vdr.hide_first_recording_level
|
||||
|
||||
- name: create local dir in recdir
|
||||
file:
|
||||
state: directory
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
mode: '0775'
|
||||
dest: '{{ vdr.recdir }}/local'
|
||||
when:
|
||||
vdr.hide_first_recording_level
|
||||
|
||||
- name: install additional vdr plugins
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
install_recommends: no
|
||||
with_items:
|
||||
'{{ vdr_plugins }}'
|
||||
|
||||
- name: create directories for media files
|
||||
file:
|
||||
state: directory
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
mode: 0777
|
||||
dest: '{{ item }}'
|
||||
with_items:
|
||||
- /srv/videos
|
||||
- /srv/music
|
||||
- /srv/picture
|
||||
- /srv/backups
|
||||
@@ -1,20 +1,22 @@
|
||||
---
|
||||
# file: roles/yavdr-common/defaults/main.yml
|
||||
|
||||
branch: unstable
|
||||
repositories:
|
||||
- 'ppa:yavdr/main'
|
||||
- 'ppa:yavdr/unstable-main'
|
||||
- 'ppa:yavdr/{{branch}}-vdr'
|
||||
- 'ppa:yavdr/{{branch}}-kodi'
|
||||
- 'ppa:yavdr/{{branch}}-yavdr'
|
||||
- 'ppa:yavdr/main'
|
||||
- 'ppa:yavdr/unstable-main'
|
||||
- 'ppa:yavdr/{{branch}}-vdr'
|
||||
- 'ppa:yavdr/{{branch}}-kodi'
|
||||
- 'ppa:yavdr/{{branch}}-yavdr'
|
||||
|
||||
drivers:
|
||||
sundtek: auto
|
||||
ddvb-dkms: auto
|
||||
sundtek: auto
|
||||
ddvb-dkms: auto
|
||||
|
||||
extra_packages:
|
||||
- vim
|
||||
- tree
|
||||
- w-scan
|
||||
extra_packages:
|
||||
- vim
|
||||
- tree
|
||||
- w-scan
|
||||
|
||||
vdr:
|
||||
user: vdr
|
||||
@@ -23,6 +25,6 @@ vdr:
|
||||
gid: 666
|
||||
home: /var/lib/vdr
|
||||
recdir: /srv/vdr/video
|
||||
hide_first_recording_level: true
|
||||
hide_first_recording_level: false
|
||||
safe_dirnames: true
|
||||
override_vdr_charset: false
|
||||
|
||||
4
roles/yavdr-common/files/90-norecommends.j2
Normal file
4
roles/yavdr-common/files/90-norecommends.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
// {{ ansible_managed_file }}
|
||||
// Recommends are as of now still abused in many packages
|
||||
APT::Install-Recommends "0";
|
||||
APT::Install-Suggests "0";
|
||||
@@ -1,17 +1,11 @@
|
||||
|
||||
---
|
||||
# This playbook sets up the basic packages an directories for a yaVDR installation
|
||||
# file: roles/yavdr-common/tasks/main.yml
|
||||
|
||||
- name: apt| prevent installation of recommended packages
|
||||
blockinfile:
|
||||
- name: apt | prevent automatic installation of recommended packages
|
||||
template:
|
||||
src: templates/90-norecommends.j2
|
||||
dest: /etc/apt/apt.conf.d/90norecommends
|
||||
create: yes
|
||||
state: present
|
||||
marker: "// *** {mark} ANSIBLE MANAGED BLOCK ***"
|
||||
block: |
|
||||
// Recommends are as of now still abused in many packages
|
||||
APT::Install-Recommends "0";
|
||||
APT::Install-Suggests "0";
|
||||
|
||||
- name: add yaVDR PPAs
|
||||
apt_repository:
|
||||
@@ -25,66 +19,22 @@
|
||||
upgrade: dist
|
||||
update_cache: yes
|
||||
|
||||
- name: install basic packages
|
||||
- name: apt | install basic packages
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
install_recommends: no
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
install_recommends: no
|
||||
with_items:
|
||||
- anacron
|
||||
- at
|
||||
- bash-completion
|
||||
- biosdevname
|
||||
- linux-firmware
|
||||
- psmisc
|
||||
- software-properties-common
|
||||
- ssh
|
||||
- ubuntu-drivers-common
|
||||
- vdr
|
||||
- vdr-plugin-dbus2vdr
|
||||
- vdrctl
|
||||
- wget
|
||||
- wpasupplicant
|
||||
- usbutils
|
||||
- xfsprogs
|
||||
|
||||
- name: create vdr recdir
|
||||
file:
|
||||
state: directory
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
mode: 0775
|
||||
dest: '{{ vdr.recdir }}'
|
||||
|
||||
- name: set option to use hide-first-recording-level patch
|
||||
blockinfile:
|
||||
dest: /etc/vdr/conf.d/04-vdr-hide-first-recordinglevel.conf
|
||||
create: true
|
||||
block: |
|
||||
[vdr]
|
||||
--hide-first-recording-level
|
||||
when:
|
||||
vdr.hide_first_recording_level
|
||||
|
||||
- name: create local dir in recdir
|
||||
file:
|
||||
state: directory
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
mode: 0775
|
||||
dest: '{{ vdr.recdir }}/local'
|
||||
when:
|
||||
vdr.hide_first_recording_level
|
||||
|
||||
- name: create directories for media files
|
||||
file:
|
||||
state: directory
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
mode: 0775
|
||||
dest: '{{ item }}'
|
||||
with_items:
|
||||
- /srv/videos
|
||||
- /srv/music
|
||||
- /srv/picture
|
||||
- /srv/backups
|
||||
- anacron
|
||||
- at
|
||||
- bash-completion
|
||||
- biosdevname
|
||||
- linux-firmware
|
||||
- psmisc
|
||||
- software-properties-common
|
||||
- ssh
|
||||
- ubuntu-drivers-common
|
||||
- wget
|
||||
- wpasupplicant
|
||||
- usbutils
|
||||
- xfsprogs
|
||||
|
||||
4
roles/yavdr-common/templates/90-norecommends.j2
Normal file
4
roles/yavdr-common/templates/90-norecommends.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
// {{ ansible_managed_file }}
|
||||
// Recommends are as of now still abused in many packages
|
||||
APT::Install-Recommends "0";
|
||||
APT::Install-Suggests "0";
|
||||
7
roles/yavdr-network/main.yml
Normal file
7
roles/yavdr-network/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
install_avahi: true
|
||||
install_epgd: true
|
||||
install_mariadb: true
|
||||
install_nfs_client: true
|
||||
install_nfs_server: true
|
||||
install_samba_client: true
|
||||
install_samba_server: true
|
||||
@@ -15,50 +15,8 @@
|
||||
- vdr-addon-avahi-linker
|
||||
- wakeonlan
|
||||
|
||||
- name: install and configure nfs-kernel-server
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
install_recommends: no
|
||||
with_items:
|
||||
- nfs-kernel-server
|
||||
when:
|
||||
- install_nfs_server
|
||||
|
||||
#- name: install and configure mariadb-server
|
||||
# apt:
|
||||
# name: "{{ item }}"
|
||||
# state: present
|
||||
# install_recommends: no
|
||||
# with_items:
|
||||
# - mariadb-server
|
||||
# - mariadb-client
|
||||
# - python-mysqldb
|
||||
# when:
|
||||
# - install_mariadb
|
||||
#
|
||||
#- name: create a new database with name epg2vdr
|
||||
# mysql_db:
|
||||
# name: epg2vdr
|
||||
# state: present
|
||||
# encoding: utf-8
|
||||
# when:
|
||||
# - install_mariadb
|
||||
#
|
||||
# mysql_user:
|
||||
# name: epg2vdr
|
||||
# password: epg
|
||||
# priv: 'epg2vdr.*:ALL,GRANT'
|
||||
# host_all: yes
|
||||
# state: present
|
||||
# when:
|
||||
# - install_mariadb
|
||||
#
|
||||
#- name: Install and configure vdr-epg-daemon
|
||||
# apt:
|
||||
# name: "{{ item }}"
|
||||
# state: present
|
||||
# with_items:
|
||||
# - vdr-epg-daemon
|
||||
# when:
|
||||
# - install_epgd
|
||||
# Does this really work? We need a way to check if an interface supports WOL - Python Skript?
|
||||
# - name: check WOL capabilities of network interfaces
|
||||
# shell: 'ethtool {{ item }} | grep -Po "(?<=Supports\sWake-on:\s).*$"'
|
||||
# register: wol
|
||||
# with_items: '{% for interface in ansible_interfaces if interface != 'lo' and interface != 'bond0' %}'
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
---
|
||||
|
||||
# This role is used to set up the yaVDR remote control configuration.
|
||||
|
||||
- name: install yavdr-remote
|
||||
tag: install
|
||||
apt:
|
||||
name: yavdr-remote
|
||||
state: present
|
||||
name: yavdr-remote
|
||||
state: present
|
||||
|
||||
- name: install lirc
|
||||
tag: install
|
||||
apt:
|
||||
name: lircd
|
||||
state: present
|
||||
name: lircd
|
||||
state: present
|
||||
when:
|
||||
- install_lircd is defined and install_lircd
|
||||
- install_lircd is defined and install_lircd
|
||||
|
||||
- name: install eventlircd
|
||||
tag: install
|
||||
apt:
|
||||
name: eventlircd
|
||||
state: present
|
||||
name: eventlircd
|
||||
state: present
|
||||
when:
|
||||
install_eventlircd is defined and install_eventlircd
|
||||
|
||||
|
||||
@@ -1,61 +1,72 @@
|
||||
---
|
||||
# this playbook sets up a graphical user session for a yaVDR installation
|
||||
# file: roles/yavdr-xorg/tasks/main.yml
|
||||
|
||||
- name: install xorg packages
|
||||
- name: install packages for xorg
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
install_recommends: no
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
with_items:
|
||||
- openbox
|
||||
- xlogin
|
||||
- xorg
|
||||
- xserver-xorg-input-all
|
||||
- xserver-xorg-video-all
|
||||
- xterm
|
||||
- xorg
|
||||
- xserver-xorg-video-all
|
||||
- xserver-xorg-input-all
|
||||
- xlogin
|
||||
- xterm
|
||||
#- yavdr-xorg
|
||||
- openbox
|
||||
|
||||
- name: create /etc/yavdr
|
||||
# TODO: move to yavdr-xorg package?
|
||||
- name: create folders for user session
|
||||
file:
|
||||
path: /etc/yavdr
|
||||
state: directory
|
||||
mode: 0755
|
||||
state: directory
|
||||
dest: '{{ item }}'
|
||||
mode: '0775'
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
with_items:
|
||||
- '{{ vdr.home }}/.config/systemd/user'
|
||||
- '{{ vdr.home }}/.config/openbox/autostart'
|
||||
|
||||
- name: check if /etc/yavdr/autoinstalled exists
|
||||
stat: path=/etc/yavdr/autoinstalled
|
||||
register: ubuntu_drivers_autoinstalled
|
||||
### TODO: move to yavdr-xorg package? ###
|
||||
- name: create folder for customizations of vdr.service
|
||||
file:
|
||||
state: directory
|
||||
dest: /etc/systemd/system/vdr.service.d
|
||||
mode: '0775'
|
||||
|
||||
- name: install drivers using ubuntu-drivers autodetection
|
||||
shell: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall
|
||||
when: not ubuntu_drivers_autoinstalled.stat.exists
|
||||
- name: add dependency to X-server for vdr.service using a drop-in
|
||||
template:
|
||||
src: templates/vdr-xorg.conf
|
||||
dest: /etc/systemd/system/vdr.service.d/
|
||||
### END TODO ###
|
||||
|
||||
- name: set up .xinitrc for user vdr
|
||||
- name: set up .xinitrc for vdr user
|
||||
template:
|
||||
src: 'templates/.xinitrc.j2'
|
||||
dest: '/var/lib/vdr/.xinitrc'
|
||||
mode: 0755
|
||||
owner: vdr
|
||||
group: vdr
|
||||
|
||||
- name: create directories for desktop session
|
||||
file:
|
||||
state: directory
|
||||
owner: vdr
|
||||
group: vdr
|
||||
mode: 0644
|
||||
path: '{{ item }}'
|
||||
with_items:
|
||||
- /var/lib/vdr/.config/openbox/
|
||||
- /var/lib/vdr/.config/systemd/user/
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
|
||||
- name: set up autostart for openbox
|
||||
template:
|
||||
src: 'templates/autostart.j2'
|
||||
dest: '/var/lib/vdr/.config/openbox/autostart'
|
||||
mode: 0755
|
||||
owner: vdr
|
||||
group: vdr
|
||||
owner: '{{ vdr.user }}'
|
||||
group: '{{ vdr.group }}'
|
||||
|
||||
- name: enable xlogin@vt7.service
|
||||
service:
|
||||
name: xlogin@vdr.service
|
||||
enabled: yes
|
||||
- name: set a login shell for the vdr user
|
||||
user:
|
||||
name: '{{ vdr.user }}'
|
||||
shell: '/bin/bash'
|
||||
state: present
|
||||
uid: '{{ vdr.uid }}'
|
||||
groups: '{{ vdr.group }}'
|
||||
append: yes
|
||||
|
||||
- name: enable and start xlogin for vdr user
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: 'xlogin@{{ vdr.user }}'
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#!/bin/bash
|
||||
# {{ ansible_managed_file }}
|
||||
exec openbox-session
|
||||
|
||||
7
roles/yavdr-xorg/templates/vdr-xorg.conf
Normal file
7
roles/yavdr-xorg/templates/vdr-xorg.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# file: roles/yavdr-xorg/templates/vdr-xorg.conf
|
||||
# {{ ansible_managed_file }}
|
||||
|
||||
[Unit]
|
||||
After=x@vt7.service
|
||||
Wants=x@vt7.service
|
||||
BindsTo=x@vt7.service
|
||||
Reference in New Issue
Block a user