diff --git a/modules/etherpad_lite/manifests/mysql.pp b/modules/etherpad_lite/manifests/mysql.pp index 65994a3aa5..c749fe68ee 100644 --- a/modules/etherpad_lite/manifests/mysql.pp +++ b/modules/etherpad_lite/manifests/mysql.pp @@ -1,64 +1,76 @@ -class etherpad_lite::mysql ( +class etherpad_lite::mysql( + $database_password, $dbType = 'mysql', $database_user = 'eplite', - $database_name = 'etherpad-lite', - $database_password + $database_name = 'etherpad-lite' ) { - include etherpad_lite package { 'mysql-server': - ensure => present + ensure => present, } package { 'mysql-client': - ensure => present + ensure => present, } - service { "mysql": - enable => true, + service { 'mysql': ensure => running, + enable => true, hasrestart => true, - require => [Package['mysql-server'], - Package['mysql-client']] + require => [ + Package['mysql-server'], + Package['mysql-client'] + ], } file { "${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh": - ensure => 'present', + ensure => present, content => template('etherpad_lite/create_database.sh.erb'), - replace => true, - owner => $etherpad_lite::ep_user, group => $etherpad_lite::ep_user, - mode => 0755, + mode => '0755', + owner => $etherpad_lite::ep_user, + replace => true, require => Class['etherpad_lite'] } file { "${etherpad_lite::base_install_dir}/etherpad-lite/create_user.sh": - ensure => 'present', + ensure => present, content => template('etherpad_lite/create_user.sh.erb'), - replace => true, - owner => $etherpad_lite::ep_user, group => $etherpad_lite::ep_user, - mode => 0755, + mode => '0755', + owner => $etherpad_lite::ep_user, + replace => true, require => Class['etherpad_lite'] } - exec { "create-etherpad-lite-db": + exec { 'create-etherpad-lite-db': 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", - require => [Service['mysql'], - 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": - 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"]] + require => [ + Service['mysql'], + File["${etherpad_lite::base_install_dir}/etherpad-lite/settings.json"], + File["${etherpad_lite::base_install_dir}/etherpad-lite/create_database.sh"] + ], + before => Exec['grant-etherpad-lite-db'], } + 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 diff --git a/modules/planet/manifests/init.pp b/modules/planet/manifests/init.pp index 9801379d2f..d379988e5e 100644 --- a/modules/planet/manifests/init.pp +++ b/modules/planet/manifests/init.pp @@ -1,19 +1,19 @@ class planet { - package { 'planet-venus': - ensure => present + ensure => present, } file { '/srv/planet': - ensure => directory + ensure => directory, } file { '/var/lib/planet': - ensure => directory + ensure => directory, } file { '/var/log/planet': - ensure => directory + ensure => directory, } - } + +# vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/modules/planet/manifests/site.pp b/modules/planet/manifests/site.pp index cf26ce47d5..96a5d5b576 100644 --- a/modules/planet/manifests/site.pp +++ b/modules/planet/manifests/site.pp @@ -1,26 +1,29 @@ -define planet::site($git_url, $vhost_name="planet.${name}.org") { - +define planet::site( + $git_url, + $vhost_name = "planet.${name}.org" +) { include apache include remove_nginx apache::vhost { $vhost_name: - port => 80, + docroot => "/srv/planet/${name}", + port => 80, priority => '50', - docroot => "/srv/planet/${name}", - require => File["/srv/planet"], + require => File['/srv/planet'], } vcsrepo { "/var/lib/planet/${name}": - ensure => present, + ensure => present, provider => git, - source => $git_url, - require => File['/var/lib/planet'], + require => File['/var/lib/planet'], + source => $git_url, } cron { "update_planet_${name}": - user => root, - minute => "*/5", - command => "date >> /var/log/planet/${name}.log && cd /var/lib/planet/${name} && git pull -q --ff-only && planet /var/lib/planet/${name}/planet.ini >> /var/log/planet/${name}.log 2>&1" + command => "date >> /var/log/planet/${name}.log && cd /var/lib/planet/${name} && git pull -q --ff-only && planet /var/lib/planet/${name}/planet.ini >> /var/log/planet/${name}.log 2>&1", + minute => '*/5', + user => 'root', } - } + +# vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/modules/subversion/manifests/init.pp b/modules/subversion/manifests/init.pp index c130643d80..3e207ea11e 100644 --- a/modules/subversion/manifests/init.pp +++ b/modules/subversion/manifests/init.pp @@ -1,5 +1,7 @@ class subversion { - package { ["subversion"]: - ensure => latest; + package { 'subversion': + ensure => latest, } } + +# vim:sw=2:ts=2:expandtab:textwidth=79