Update role order, next try for a successfull local installation

This commit is contained in:
Alexander Grothe 2017-03-13 14:53:07 +01:00
parent 4b7ead99b2
commit ca33ff5ac4
6 changed files with 78 additions and 34 deletions

View File

@ -15,6 +15,24 @@ This is an experimental feature which allows to set up a yaVDR installation base
This Manual is written in org-mode for Emacs and can rewrite the complete ansible configuration if you call ~org-babel-tangle~ from within emacs.
** Install script for local usage
#+BEGIN_SRC shell :tangle install-yavdr.sh :shebang "#!/bin/bash"
if (( $EUID != 0 )); then
echo "This script must be run using sudo or as root"
exit
fi
apt-get -y install software-properties-common
# Add repository for ansible
add-apt-repository -y ppa:ansible/ansible
# update packages
apt-get update
# install required packages
apt-get -y install ansible python
# TODO: run ansible on local host
ansible-playbook yavdr07.yml -b -i 'localhost,'
#+END_SRC
* Playbooks
** yavdr07.yml
The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation:
@ -33,7 +51,6 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation:
- samba-install # install samba server
- samba-config # configure samba server
- nfs-server # install nfs server
#- nfs-config # configure nfs server
- yavdr-xorg # graphical session
- yavdr-remote # remote configuration files, services and scripts
- grub-config # configure grub
@ -252,6 +269,25 @@ yavdr-common executes the following tasks:
dpkg-reconfigure -f noninteractive dash
#+END_SRC
***** create user vdr
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none :mkdirp yes
- 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
#+END_SRC
***** Disable release-upgrade notifications
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes
- name: disable release-upgrade notifications
@ -312,17 +348,6 @@ yavdr-common executes the following tasks:
with_items:
'{{ extra_packages }}'
#+END_SRC
***** create media directories
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml
- name: create media directories
file:
dest: '{{ item.value }}'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
state: directory
mode: '0777'
with_dict: '{{ media_dirs }}'
#+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
@ -351,6 +376,17 @@ yavdr-common executes the following tasks:
var: satip_detected
verbosity: 1
#+END_SRC
***** create media directories
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none :mkdirp yes
- name: create media directories
file:
dest: '{{ item.value }}'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
state: directory
mode: '0777'
with_dict: '{{ media_dirs }}'
#+END_SRC
*** templates
#+BEGIN_SRC c :tangle roles/yavdr-common/templates/90-norecommends.j2 :mkdirp yes
{{ ansible_managed_file | comment('c') }}
@ -418,6 +454,8 @@ APT::Install-Suggests "0";
dest: '{{ vdr.recdir }}/local'
when:
vdr.hide_first_recording_level
# TODO: set recdir, user etc. in /etc/vdr/conf.d/
#+END_SRC
**** Install additional vdr plugins
The additional plugins to install can be set in the variable ~{{vdr_plugins}}~ in the group variables
@ -435,12 +473,6 @@ The additional plugins to install can be set in the variable ~{{vdr_plugins}}~ i
#+BEGIN_SRC yaml :tangle roles/yavdr-network/main.yml :mkdirp yes
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
#+END_SRC
*** tasks
#+BEGIN_SRC yaml :tangle roles/yavdr-network/tasks/main.yml :mkdirp yes

1
install-yavdr.sh Normal file → Executable file
View File

@ -13,3 +13,4 @@ apt-get update
apt-get -y install ansible python
# TODO: run ansible on local host
ansible-playbook yavdr07.yml -b -i 'localhost,'

View File

@ -51,6 +51,8 @@
when:
vdr.hide_first_recording_level
# TODO: set recdir, user etc. in /etc/vdr/conf.d/
- name: install additional vdr plugins
apt:
name: '{{ item }}'

View File

@ -13,6 +13,22 @@
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
@ -64,15 +80,6 @@
with_items:
'{{ extra_packages }}'
- name: create media directories
file:
dest: '{{ item.value }}'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
state: directory
mode: '0777'
with_dict: '{{ media_dirs }}'
- name: get information about usb and pci hardware and loaded kernel modules
hardware_facts:
usb: True
@ -98,3 +105,12 @@
- debug:
var: satip_detected
verbosity: 1
- name: create media directories
file:
dest: '{{ item.value }}'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
state: directory
mode: '0777'
with_dict: '{{ media_dirs }}'

View File

@ -1,7 +1 @@
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

View File

@ -12,7 +12,6 @@
- samba-install # install samba server
- samba-config # configure samba server
- nfs-server # install nfs server
#- nfs-config # configure nfs server
- yavdr-xorg # graphical session
- yavdr-remote # remote configuration files, services and scripts
- grub-config # configure grub