More puppet-lint formatting fixes
Yet another bunch of puppet-lint fixes. Change-Id: I9574cf1c5e35620b12e4d5e2bd6b2eb4d320c935 Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com> Reviewed-on: https://review.openstack.org/13988 Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
c0ed8b10f1
commit
488e7afeb1
@ -1,64 +1,76 @@
|
|||||||
class etherpad_lite::mysql (
|
class etherpad_lite::mysql(
|
||||||
|
$database_password,
|
||||||
$dbType = 'mysql',
|
$dbType = 'mysql',
|
||||||
$database_user = 'eplite',
|
$database_user = 'eplite',
|
||||||
$database_name = 'etherpad-lite',
|
$database_name = 'etherpad-lite'
|
||||||
$database_password
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include etherpad_lite
|
include etherpad_lite
|
||||||
|
|
||||||
package { 'mysql-server':
|
package { 'mysql-server':
|
||||||
ensure => present
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'mysql-client':
|
package { 'mysql-client':
|
||||||
ensure => present
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
service { "mysql":
|
service { 'mysql':
|
||||||
enable => true,
|
|
||||||
ensure => running,
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
require => [Package['mysql-server'],
|
require => [
|
||||||
Package['mysql-client']]
|
Package['mysql-server'],
|
||||||
|
Package['mysql-client']
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh":
|
file { "${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh":
|
||||||
ensure => 'present',
|
ensure => present,
|
||||||
content => template('etherpad_lite/create_database.sh.erb'),
|
content => template('etherpad_lite/create_database.sh.erb'),
|
||||||
replace => true,
|
|
||||||
owner => $etherpad_lite::ep_user,
|
|
||||||
group => $etherpad_lite::ep_user,
|
group => $etherpad_lite::ep_user,
|
||||||
mode => 0755,
|
mode => '0755',
|
||||||
|
owner => $etherpad_lite::ep_user,
|
||||||
|
replace => true,
|
||||||
require => Class['etherpad_lite']
|
require => Class['etherpad_lite']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh":
|
file { "${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh":
|
||||||
ensure => 'present',
|
ensure => present,
|
||||||
content => template('etherpad_lite/create_user.sh.erb'),
|
content => template('etherpad_lite/create_user.sh.erb'),
|
||||||
replace => true,
|
|
||||||
owner => $etherpad_lite::ep_user,
|
|
||||||
group => $etherpad_lite::ep_user,
|
group => $etherpad_lite::ep_user,
|
||||||
mode => 0755,
|
mode => '0755',
|
||||||
|
owner => $etherpad_lite::ep_user,
|
||||||
|
replace => true,
|
||||||
require => Class['etherpad_lite']
|
require => Class['etherpad_lite']
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "create-etherpad-lite-db":
|
exec { 'create-etherpad-lite-db':
|
||||||
unless => "mysql --defaults-file=/etc/mysql/debian.cnf ${database_name}",
|
unless => "mysql --defaults-file=/etc/mysql/debian.cnf ${database_name}",
|
||||||
path => ['/bin', '/usr/bin'],
|
path => [
|
||||||
|
'/bin', '/usr/bin'
|
||||||
|
],
|
||||||
command => "${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh",
|
command => "${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh",
|
||||||
require => [Service['mysql'],
|
require => [
|
||||||
File["${etherpad_lite::base_install_dir}/etherpad-lite/settings.json"],
|
Service['mysql'],
|
||||||
File["${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh"]]
|
File["${etherpad_lite::base_install_dir}/etherpad-lite/settings.json"],
|
||||||
} ->
|
File["${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh"]
|
||||||
|
],
|
||||||
exec { "grant-etherpad-lite-db":
|
before => Exec['grant-etherpad-lite-db'],
|
||||||
unless => "mysql -u${database_user} -p${database_password} ${database_name}",
|
|
||||||
path => ['/bin', '/usr/bin'],
|
|
||||||
command => "${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh",
|
|
||||||
require => [Service['mysql'],
|
|
||||||
File["${etherpad_lite::base_install_dir}/etherpad-lite/settings.json"],
|
|
||||||
File["${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh"]]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec { 'grant-etherpad-lite-db':
|
||||||
|
unless => "mysql -u${database_user} -p${database_password} ${database_name}",
|
||||||
|
path => [
|
||||||
|
'/bin',
|
||||||
|
'/usr/bin'
|
||||||
|
],
|
||||||
|
command => "${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh",
|
||||||
|
require => [
|
||||||
|
Service['mysql'],
|
||||||
|
File["${etherpad_lite::base_install_dir}/etherpad-lite/settings.json"],
|
||||||
|
File["${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh"]
|
||||||
|
],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vim:sw=2:ts=2:expandtab:textwidth=79
|
||||||
|
Loading…
x
Reference in New Issue
Block a user