diff --git a/manifests/init.pp b/manifests/init.pp index 7408883..fc1d695 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,16 +3,24 @@ define git_repo ( $repo, $dest, $user = 'root', - $branch = 'master' + $branch = 'master', + $clone_only = undef ) { + if $clone_only == 'true' { + $checkout_condition = "false" + } + else { + $checkout_condition = "test -d ${dest}" + } + # if we already have the git repo the pull updates exec { "update_${title}": command => "git pull --ff-only origin ${branch}", cwd => $dest, path => '/bin:/usr/bin', user => $user, - onlyif => "test -d ${dest}", + onlyif => $checkout_condition, before => Exec["clone_${title}"], } @@ -108,10 +116,11 @@ class etherpad_lite ( } git_repo { 'nodejs_repo': - repo => 'https://github.com/joyent/node.git', - dest => "${base_install_dir}/nodejs", - branch => 'v0.6.16-release', - require => Package['git'] + repo => 'https://github.com/joyent/node.git', + dest => "${base_install_dir}/nodejs", + branch => 'v0.6.16-release', + clone_only => 'true', + require => Package['git'] } package { ['gzip', @@ -135,10 +144,11 @@ class etherpad_lite ( } git_repo { 'etherpad_repo': - repo => 'https://github.com/Pita/etherpad-lite.git', - dest => "${base_install_dir}/etherpad-lite", - user => $ep_user, - require => Package['git'] + repo => 'https://github.com/Pita/etherpad-lite.git', + dest => "${base_install_dir}/etherpad-lite", + user => $ep_user, + clone_only => 'true', + require => Package['git'] } exec { 'install_etherpad_dependencies': diff --git a/manifests/mysql.pp b/manifests/mysql.pp index 508c51e..8af56ca 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -27,7 +27,7 @@ class etherpad_lite::mysql { } -> exec { "grant-etherpad-lite-db": - unless => "mysql -ueplite -p'`grep password ${etherpad_lite::base_install_dir}/etherpad-lite/settings.json | cut -d: -f2 | sed -e 's/.*\"\(.*\)\".*/\1/'`' etherpad-lite", + unless => "mysql -ueplite -p\"`grep password ${etherpad_lite::base_install_dir}/etherpad-lite/settings.json | cut -d: -f2 | sed -e 's/.*\"\(.*\)\".*/\1/'`\" etherpad-lite", path => ['/bin', '/usr/bin'], command => "mysql --defaults-file=/etc/mysql/debian.cnf -e \"grant all on \`etherpad-lite\`.* to 'eplite'@'localhost' identified by '`grep password ${etherpad_lite::base_install_dir}/etherpad-lite/settings.json | cut -d: -f2 | sed -e 's/.*\"\(.*\)\".*/\1/'`';\" mysql", require => [Service['mysql'],