--- - name: Include private abbey variables. include_vars: ../private/vars-abbey.yml - name: Install MythTV runtime requisites. become: yes apt: pkg: [ mariadb-server, xmltv ] - name: Install MythTV build requisites. include_tasks: "{{ item }}" loop: - ../mythtv-ansible/roles/mythtv-deb/tasks/main.yml - ../mythtv-ansible/roles/qt5/tasks/qt5-deb.yml - name: Test for MythTV binary packages. stat: path: /usr/local/bin/mythtv-setup register: mythtv - debug: msg: "/usr/local/bin/mythtv-setup does not yet exist" when: not mythtv.stat.exists - name: Create mythtv. become: yes user: name: mythtv system: yes - name: Create mythtv-backend service. become: yes copy: content: | [Unit] Description=MythTV Backend Documentation=https://www.mythtv.org/wiki/Mythbackend After=mysql.service network.target [Service] User=mythtv ExecStartPre=/bin/sleep 30 #TimeoutStartSec=infinity ExecStart=/usr/local/bin/mythbackend --quiet --syslog local7 StartLimitBurst=10 StartLimitInterval=10m Restart=on-failure RestartSec=1 [Install] WantedBy=multi-user.target dest: /etc/systemd/system/mythtv-backend.service when: mythtv.stat.exists notify: Reload Systemd. - name: Configure PHP date.timezone. become: yes lineinfile: regexp: date.timezone ?= line: date.timezone = {{ lookup('file', '/etc/timezone') }} path: "{{ item }}" loop: - /etc/php/8.2/cli/php.ini - /etc/php/8.2/apache2/php.ini when: mythtv.stat.exists notify: Restart Apache2. - name: Create MythTV storage area. become: yes file: state: directory dest: /home/mythtv/Recordings owner: mythtv group: mythtv mode: u=rwx,g+rwx,o=rx - name: Install =/etc/rsyslog.d/40-mythtv.conf. become: yes copy: content: | :msg,startswith," myth" -/var/log/mythtv.log & stop dest: /etc/rsyslog.d/40-mythtv.conf - name: Install =/etc/logrotate.d/mythtv=. become: yes copy: content: | /var/log/mythtv.log { daily size=10M rotate 7 notifempty copytruncate missingok postrotate reload rsyslog >/dev/null 2>&1 || true endscript } dest: /etc/logrotate.d/mythtv - name: Install MythWeb requisites. become: yes apt: pkg: [ apache2, php, php-mysql ] - name: Install MythWeb in web server DocumentRoot. file: state: link src: /usr/local/share/mythtv/mythweb dest: /var/www/html/mythweb - name: Configure MythWeb data directory. file: state: directory dest: /var/www/html/mythweb/data group: www-data mode: u=rwx,g+rwx,o=rx - name: Install MythWeb configuration. become: yes template: src: mythweb.conf.j2 dest: /etc/apache2/sites-available/mythweb.conf notify: Restart Apache2. - name: Enable MythWeb configuration. become: yes command: cmd: a2ensite -q mythweb creates: /etc/apache2/sites-enabled/mythweb.conf notify: Restart Apache2.