diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-12-26 12:51:11 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-12-26 12:51:11 -0200 |
commit | c7b5e6382568aa06f26d80b7130a959c4384b990 (patch) | |
tree | a0ec190262fa16a622107d49786c53b898d8ca94 /manifests | |
download | puppet-etherpad-c7b5e6382568aa06f26d80b7130a959c4384b990.tar.gz puppet-etherpad-c7b5e6382568aa06f26d80b7130a959c4384b990.tar.bz2 |
Initial import
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..180285b --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,80 @@ +class etherpad { + case $etherpad_db_password { + '': { fail("You need to define a mysql root password! Please set \$etherpad_db_password in your site.pp or host config") } + } + + database::instance { "etherpad": + password => $etherpad_db_password, + } + + user { "etherpad-lite": + ensure => present, + allowdupe => false, + } + + group { "etherpad-lite": + ensure => present, + allowdupe => false, + } + + package { 'npm': + ensure => present, + } + + vcsrepo { "/var/lib/etherpad-lite": + ensure => present, + provider => git, + source => 'git://github.com/Pita/etherpad-lite.git', + revision => 'ddf1cd345c8516a77c1440b53ddc05279551db7b' + owner => 'etherpad-lite', + group => 'etherpad-lite', + require => [ User['etherpad-lite'], Group['etherpad-lite'] ], + notify => Service['etherpad-lite'], + } + + file { '/etc/init.d/etherpad-lite': + ensure => present, + owner => root, + group => root, + mode => 0755, + source => 'puppet:///modules/etherpad/init.d/etherpad-lite.sh', + require => Vcsrepo['/var/lib/etherpad-lite'], + } + + file { '/var/log/etherpad-lite': + ensure => directory, + owner => 'etherpad-lite', + group => 'etherpad-lite', + mode => 0755, + require => [ User['etherpad-lite'], Group['etherpad-lite'] ], + } + + file { '/etc/logrotate.d/etherpad-lite': + ensure => present, + owner => root, + group => root, + mode => 0644, + source => 'puppet:///modules/etherpad/logrotate.d/etherpad-lite', + require => File['/var/log/etherpad-lite'], + } + + file { '/var/lib/etherpad-lite/settings.json': + ensure => present, + owner => 'etherpad-lite', + group => 'etherpad-lite', + mode => 0640, + content => template('etherpad/settings.json.erb'), + require => Vcsrepo['/var/lib/etherpad-lite'], + notify => Service['etherpad-lite'], + } + + service { 'etherpad-lite': + enable => true, + ensure => running, + hasrestart => true, + hasstatus => true, + require => [ File['/etc/init.d/etherpad-lite', '/var/lib/etherpad-lite/settings.json'], + Mysql_database['etherpad-lite'], Mysql_user['etherpad-lite'], + Mysql_grant['etherpad-lite'], Package['npm'] ], + } +} |