Initial version of MythTV module.
This commit is contained in:
parent
dcb83d6900
commit
e1a4c4d99c
5 changed files with 172 additions and 0 deletions
3
mythtv/files/mythfilldatabase
Executable file
3
mythtv/files/mythfilldatabase
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
mythfilldatabase > /dev/null
|
4
mythtv/files/mythoptimize
Executable file
4
mythtv/files/mythoptimize
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
MYTHVERSION="`rpm -q --queryformat='%{VERSION}\n' mythtv-docs`"
|
||||
perl /usr/share/doc/mythtv-docs-${MYTHVERSION}/contrib/optimize_mythdb.pl > /dev/null
|
114
mythtv/manifests/init.pp
Normal file
114
mythtv/manifests/init.pp
Normal file
|
@ -0,0 +1,114 @@
|
|||
|
||||
# Install MythTV backend service.
|
||||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $mythtv_dbhost:
|
||||
# Database server name (defaults to localhost).
|
||||
#
|
||||
# $mythtv_dbname:
|
||||
# Database name (defaults to mythconverg).
|
||||
#
|
||||
# $mythtv_dbuser:
|
||||
# Database user name (defaults to mythtv).
|
||||
#
|
||||
# $mythtv_dbpass:
|
||||
# Database password.
|
||||
#
|
||||
class mythtv::backend {
|
||||
|
||||
if ! $mythtv_dbhost {
|
||||
$mythtv_dbhost = "localhost"
|
||||
}
|
||||
if ! $mythtv_dbuser {
|
||||
$mythtv_dbuser = "mythtv"
|
||||
}
|
||||
if ! $mythtv_dbname {
|
||||
$mythtv_dbname = "mythconverg"
|
||||
}
|
||||
|
||||
package { ["mythtv-backend", "mythtv-setup", "mythtv-docs"]:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/etc/mythtv/mysql.txt":
|
||||
ensure => present,
|
||||
content => template("mythtv/mysql.txt.erb"),
|
||||
mode => 0640,
|
||||
owner => root,
|
||||
group => mythtv,
|
||||
notify => Service["mythbackend"],
|
||||
require => Package["mythtv-backend"],
|
||||
}
|
||||
|
||||
file { "/etc/mythtv/config.xml":
|
||||
ensure => present,
|
||||
content => template("mythtv/config.xml.erb"),
|
||||
mode => 0640,
|
||||
owner => root,
|
||||
group => mythtv,
|
||||
notify => Service["mythbackend"],
|
||||
require => Package["mythtv-backend"],
|
||||
}
|
||||
|
||||
file { "/root/.mythtv":
|
||||
ensure => "/etc/mythtv",
|
||||
force => true,
|
||||
require => Package["mythtv-backend"],
|
||||
}
|
||||
|
||||
service { "mythbackend":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["mythtv-backend"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install MythTV daily cron jobs.
|
||||
#
|
||||
# This class should be included only to one host.
|
||||
#
|
||||
class mythtv::cron inherits mythtv::backend {
|
||||
|
||||
package { [ "perl-MythTV", "perl-Net-UPnP", "perl-DBD-MySQL" ]:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/etc/cron.daily/mythfilldatabase":
|
||||
ensure => present,
|
||||
source => "puppet:///mythtv/mythfilldatabase",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
|
||||
file { "/etc/cron.daily/mythoptimize":
|
||||
ensure => present,
|
||||
source => "puppet:///mythtv/mythoptimize",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install MythTV web frontend.
|
||||
#
|
||||
class mythtv::mythweb {
|
||||
|
||||
package { [ "mythweb", "mythweather" ]:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/usr/share/mythweb/data":
|
||||
ensure => directory,
|
||||
mode => 0770,
|
||||
owner => root,
|
||||
group => httpsd,
|
||||
require => Package["mythweb"],
|
||||
}
|
||||
|
||||
}
|
12
mythtv/templates/config.xml.erb
Normal file
12
mythtv/templates/config.xml.erb
Normal file
|
@ -0,0 +1,12 @@
|
|||
<Configuration>
|
||||
<UPnP>
|
||||
<MythFrontend>
|
||||
<DefaultBackend>
|
||||
<DBHostName><%= mythtv_dbhost -%></DBHostName>
|
||||
<DBUserName><%= mythtv_dbuser -%></DBUserName>
|
||||
<DBPassword><%= mythtv_dbpass -%></DBPassword>
|
||||
<DBName><%= mythtv_dbname -%></DBName>
|
||||
</DefaultBackend>
|
||||
</MythFrontend>
|
||||
</UPnP>
|
||||
</Configuration>
|
39
mythtv/templates/mysql.txt.erb
Normal file
39
mythtv/templates/mysql.txt.erb
Normal file
|
@ -0,0 +1,39 @@
|
|||
DBHostName=<%= mythtv_dbhost %>
|
||||
|
||||
# By default, Myth tries to ping the DB host to see if it exists.
|
||||
# If your DB host or network doesn't accept pings, set this to no:
|
||||
#
|
||||
#DBHostPing=no
|
||||
|
||||
DBUserName=<%= mythtv_dbuser %>
|
||||
DBPassword=<%= mythtv_dbpass %>
|
||||
DBName=<%= mythtv_dbname %>
|
||||
DBType=QMYSQL3
|
||||
|
||||
# Set the following if you want to use something other than this
|
||||
# machine's real hostname for identifying settings in the database.
|
||||
# This is useful if your hostname changes often, as otherwise you
|
||||
# will need to reconfigure mythtv (or futz with the DB) every time.
|
||||
# TWO HOSTS MUST NOT USE THE SAME VALUE
|
||||
#
|
||||
#LocalHostName=my-unique-identifier-goes-here
|
||||
|
||||
# If you want your frontend to be able to wake your MySQL server
|
||||
# using WakeOnLan, have a look at the following settings:
|
||||
#
|
||||
#
|
||||
# The time the frontend waits (in seconds) between reconnect tries.
|
||||
# This should be the rough time your MySQL server needs for startup
|
||||
#
|
||||
#WOLsqlReconnectWaitTime=0
|
||||
#
|
||||
#
|
||||
# This is the number of retries to wake the MySQL server
|
||||
# until the frontend gives up
|
||||
#
|
||||
#WOLsqlConnectRetry=5
|
||||
#
|
||||
#
|
||||
# This is the command executed to wake your MySQL server.
|
||||
#
|
||||
#WOLsqlCommand=echo 'WOLsqlServerCommand not set'
|
Loading…
Add table
Reference in a new issue