4. Run playbooks
MiaRec playbooks
MiaRec installation process is split on three playbooks:
- The
prepare-hosts.yml
Ansible foundation playbook installs the infrastructure services (PostgreSQL database, Redis, Apache web server, Python) and configures firewall (iptables). You need to run this playbook only once. - The
configure-firewall.yml
playbook configures iptables firewall on target host(s). It is optional playbook, but for security reasons, it is recommended to run it. Alternatively, the firewall can be configured manually. You need to run this playbook when firewall rules change. - The
setup-miarec.yml
playbook installs the MiaRec services, including web portal (miarecweb), recorder (miarec) and screen recording contoller (miarec_screen). Run this playbook for initial installation as well as for subsequent updates.
4.1. Run prepare-hosts.yml playbook to provision the server(s)
The playbook prepare-hosts.yml will install the required packages, like PostgreSQL database, Apache web server, Redis, Python, opens appropriate ports in firewall, etc. Normally you need to run this playbook only once when you prepare the system for MiaRec installation.
In case of remote installation, it is necessary to establish trust relationships between the controller and target machines. When speaking with remote machines, Ansible by default assumes you are using SSH keys. SSH keys are encouraged but password authentication can also be used where needed by supplying the option --ask-pass
. You need to supply also the option --ask-sudo-pass
if you are connecting to the remote server as non-root user.
When using password-less authentication (or when running Ansible locally on target host), you can simply run the following command:
cd /opt/ansible-miarec
ansible-playbook -i hosts prepare-hosts.yml
When using password authentication, you can run the following command and you will prompted to enter the password for SSH connection:
ansible-playbook -i hosts prepare-hosts.yml --ask-pass
Confirm satisfactory completion with zero items unreachable or failed:
PLAY RECAP ********************************************************************
...
miarec : ok=79 changed=42 unreachable=0 failed=0
4.2. Run configure-firewall.yml playbook to enable iptables on the server(s)
CAUTION! MiaRec installer uses iptables as a default firewall. It will be enabled automatically on the target system and the other firewall software, if any, will be disabled. For example, on Centos 7, firewalld will be disabled. On Unbuntu 16.04, ufw will be disabled.
Alternatively, you can skip this step and configure firewall for MiaRec manually.
Run playbook:
ansible-playbook -i hosts configure-firewall.yml
4.3. Run setup-miarec.yml playbook to install or update MiaRec software
The playbook setup-miarec.yml will install the MiaRec software components (recorder, web portal, etc.). You need to run this playbook during initial installation as well as during upgrade of MiaRec to the new version.
To install/update MiaRec, run the following command:
ansible-playbook -i hosts setup-miarec.yml
Confirm satisfactory completion with zero items unreachable or failed:
PLAY RECAP ********************************************************************
...
miarec : ok=38 changed=25 unreachable=0 failed=0
\