diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-09 15:28:56 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-09 15:28:56 -0300 |
commit | c85f7b5ab0bb759a8f0b2dd0fa7292c6b639571f (patch) | |
tree | 8f994a49130a327e00194330728599a54cf0901f | |
parent | 4c07b9c3c29e845ac7c5d3a66cdc80a223b7b54f (diff) | |
download | puppet-etherpad-c85f7b5ab0bb759a8f0b2dd0fa7292c6b639571f.tar.gz puppet-etherpad-c85f7b5ab0bb759a8f0b2dd0fa7292c6b639571f.tar.bz2 |
Remove ensurable parameter
-rw-r--r-- | manifests/init.pp | 66 |
1 files changed, 20 insertions, 46 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 9dee680..f7630c1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,8 +1,7 @@ class etherpad( $db_password = hiera('etherpad::db_password', ''), $admin_password = hiera('etherpadd::admin_password', ''), - $api_key = hiera('etherpad::api_key', ''), - $ensure = hiera('etherpad::ensure', 'present') + $api_key = hiera('etherpad::api_key', '') ) { case $db_password { @@ -10,39 +9,30 @@ class etherpad( } mysql_database { 'etherpad': - ensure => $ensure, + ensure => present, } mysql_user { "etherpad@%": - ensure => $ensure, + ensure => present, password_hash => mysql_password($db_password), require => Mysql_database['etherpad'], } - if $ensure == 'present' { - mysql_grant { "etherpad@%/etherpad": - privileges => 'all', - require => Mysql_user["etherpad@%"], - } + mysql_grant { "etherpad@%/etherpad": + privileges => 'all', + require => Mysql_user["etherpad@%"], } group { "etherpad-lite": - ensure => $ensure, + ensure => present, allowdupe => false, - require => $ensure ? { - present => undef, - default => User['etherpad-lite'], # Make sure the user is removed first - } } user { "etherpad-lite": - ensure => $ensure, + ensure => present, allowdupe => false, gid => 'etherpad-lite', - require => $ensure ? { - present => Group['etherpad-lite'], - default => undef, - } + require => Group['etherpad-lite'], } file { '/home/etherpad-lite': @@ -53,11 +43,11 @@ class etherpad( } package { [ 'npm', 'abiword' ]: - ensure => $ensure, + ensure => present, } vcsrepo { "/var/lib/etherpad-lite": - ensure => $ensure, + ensure => present, provider => git, source => 'https://github.com/ether/etherpad-lite.git', revision => '8fffe4777e366923ee89d380b12eb413c950b721', @@ -68,7 +58,7 @@ class etherpad( } file { '/etc/init.d/etherpad-lite': - ensure => $ensure, + ensure => present, owner => root, group => root, mode => 0755, @@ -76,24 +66,16 @@ class etherpad( require => Vcsrepo['/var/lib/etherpad-lite'], } - $directory = $ensure ? { - 'present' => 'directory', - default => 'absent', - } - file { '/var/log/etherpad-lite': - ensure => $directory, + ensure => directory, owner => 'etherpad-lite', group => 'etherpad-lite', mode => 0755, - require => $ensure ? { - present => [ User['etherpad-lite'], Group['etherpad-lite'] ], - default => undef, - }, + require => [ User['etherpad-lite'], Group['etherpad-lite'] ], } file { '/etc/logrotate.d/etherpad-lite': - ensure => $ensure, + ensure => present, owner => root, group => root, mode => 0644, @@ -102,7 +84,7 @@ class etherpad( } file { '/var/lib/etherpad-lite/settings.json': - ensure => $ensure, + ensure => present, owner => 'etherpad-lite', group => 'etherpad-lite', mode => 0640, @@ -113,7 +95,7 @@ class etherpad( if $api_key != '' { file { '/var/lib/etherpad-lite/APIKEY.txt': - ensure => $ensure, + ensure => present, owner => 'etherpad-lite', group => 'etherpad-lite', mode => 0640, @@ -123,20 +105,12 @@ class etherpad( } } - $service = $ensure ? { - 'present' => 'running', - default => 'stopped', - } - service { 'etherpad-lite': enable => true, - ensure => $service, + ensure => running, hasrestart => true, hasstatus => true, - require => $ensure ? { - present => [ File['/etc/init.d/etherpad-lite', '/var/lib/etherpad-lite/settings.json', - '/home/etherpad-lite'], Mysql_grant['etherpad@%/etherpad'], Package['npm'] ], - default => undef, - }, + require => [ File['/etc/init.d/etherpad-lite', '/var/lib/etherpad-lite/settings.json', + '/home/etherpad-lite'], Mysql_grant['etherpad@%/etherpad'], Package['npm'] ], } } |