- Rivendell installation with ansible
CentOS 7.2
ex:
[master]
rivendell-01 ansible_host='192.168.1.133' ansible_user=root
[slave]
rivendell-02 ansible_host='192.168.1.134' ansible_user=root
[rd:children]
master
slave
ansible-playbook site.yml --ask-pass
Set the default rd-user in group_vars/all.yml
This user will be used for:
- Default gdm login desktop user
- Sudo access
- Running rivendell
- Will be added to all groups used by rivendell (audio, etc)
group_vars/all.yml
---
user:
name: rd-user
uid: 1000
group: rd-user
shell: /usr/bin/bash
groups: [rivendell, wheel, audio, jackuser]
password: changeme
After making changes to user variables you can run this role again to update the machines.
ansible-playbook site.yml --ask-pass --tags user
ansible-playbook -l master site.yml --ask-pass --tags user
ansible-playbook -l slave site.yml --ask-pass --tags user
Currently set to have passwordless sudo
Disabled at this time.
Configurable in the inventory.ini file
Will also "echo 'hostname' > /etc/hostname" for each machine
All hosts that are defined with "ansible_host" in the inventory.ini file
will be dynamically added to every machines /etc/hosts file.
ex. /etc/hosts created for defined vagrant machines above.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.33.133 rivendell-01
192.168.33.134 rivendell-02
Install, configure, and enable ntp.
ntp servers can be configured in:
group_vars/all.yml
ntp_server: [0.pool.ntp.org, 1.pool.ntp.org]
Required for:
- rpmfusion
- soundtouch{-devel}
- et al.
Required for:
- libmad
- libmad-devel
- twolame
- twolame-devel
- lame
- lame-devel
Required for:
- c++
- etc
- tools for installing rivendell from source
xfce is a lightweight desktop environment for UNIX-like operating systems.
It aims to be fast and low on system resources, while still being visually appealing and user friendly.
This role is essentially running the following command.
yum groups install X Window system
yum groups install Xfce
Configured in vars/RedHat.yml
---
desktop:
pkgs:
- '@X Window system'
- '@Xfce'
session: xfce4-session
dm: gdm.service
A symlink is created:
- from "/usr/lib/systemd/system/graphical.target"
- to "/etc/systemd/system/default.target"
Enabling graphical login on a CentOS box.
An .xinitrc file is placed in the default rd-user's home directory containing the startup-session
This variable is also configurable at desktop.dm in vars/RedHat.yml
A custom.conf file is templated to /etc/gdm/custom.conf allowing automatic login.
This can be edited at templates/custom.conf.j2
[daemon]
AutomaticLogin=rd-user
AutomaticLoginEnable=True
...
...
gdm.service is enabled at startup
Rivendell requirements can be configured at vars/RedHat.yml
rivendell:
pkgs:
- libogg-devel
- vorbis-tools
- libvorbis-devel
- flac-devel
- libmad
- libmad-devel
- twolame
- twolame-devel
- lame
- lame-devel
- alsa-lib-devel
- jack-audio-connection-kit
- jack-audio-connection-kit-devel
- qt
- qt-devel
- qt-mysql
- qt3
- qt3-devel
- qt3-MySQL
- libsamplerate
- libsamplerate-devel
- libsndfile
- libsndfile-devel
- cdparanoia
- libXmu-devel
- cdparanoia-devel
- cdparanoia-libs
- id3lib
- id3lib-devel
- libcurl
- libcurl-devel
- pam-devel
- soundtouch
- soundtouch-devel
Version can be specified at vars/RedHat.yml
rivendell:
version: 2.15.1
All this will be handled.
- Unarchive
- Configure
- Make package
- daemon reload
Create rivendell directories
- /var/run/rivendell
- /home/rd-user/rdlogs
Configure Rivendell
More groups can be added in:
group_vars/all.yml
user:
groups:
- rivendell
- audio
- jackuser
configure in group_vars/all.yml
time_zone: US/Mountain
configure in group_vars/all.yml
locale: en_US.UTF-8
For now firewalld is simply being disabled.
Might come back to this and add functionality to allow mysql ports, etc...
vagrant up rivendell-01
ansible-playbook -l vagrant site.yml
rm /var/lib/mysql/ib_logfile*
rm: remove regular file ‘/var/lib/mysql/ib_logfile0’? y
rm: remove regular file ‘/var/lib/mysql/ib_logfile1’? y
systemctl start mariadb.service
Reset slave server
mysql> RESET SLAVE;
[ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236) - See more at: https://mariadb.com/resources/blog/client-requested-master-start-replication-impossible-position#sthash.mPu5mFE9.dpuf
https://mariadb.com/resources/blog/client-requested-master-start-replication-impossible-position
On Master:
MariaDB [(none)]> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000008 | 128046 | | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
Check for last bin log on Slave:
tail /var/log/mariadb/mariadb.log
...
170120 10:26:26 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'mysql-bin.000005' at 576960, the last event read from 'mysql-bin.000005' at 4, the last byte read from 'mysql-bin.000005' at 4.', Error_code: 1236
...
Restart from next bin log file on Slave:
mysql> STOP SLAVE;
mysql> CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000006',MASTER_LOG_POS=4;