diff --git a/wmde-odoo/manifests/init.pp b/wmde-odoo/manifests/init.pp index 2be1323..960a147 100644 --- a/wmde-odoo/manifests/init.pp +++ b/wmde-odoo/manifests/init.pp @@ -94,6 +94,15 @@ inherits odoo::params { require => Package[$prepkg] } + + file {"$reposdir": + ensure => directory + } + + odoo::addon{"tictac": + source => "https://srcsrv.wikimedia.de/WMDE/tictac" + } + exec {"install_pre": command => "/bin/ls > /dev/null && $preenv && $pip_cmd install -r $odoo_systemdir/requirements.txt", require => [ @@ -104,5 +113,36 @@ inherits odoo::params { } +define odoo::addon ( + $source , + $dstdir = "", +) +{ + $installdir = "${::odoo::params::odoo_systemdir}/openerp/addons/$dstdir" + + $reposdir = $::odoo::reposdir + + + vcsrepo { "$reposdir/$title": + ensure => present, + provider => git, + source => $source, + depth => 1, + require => [ + Vcsrepo[$::odoo::odoo_systemdir], + File[$reposdir], + ] + } -> + file {$installdir: + ensure => directory + } -> + exec{"/bin/cp -R $reposdir/$title/* $installdir": + refreshonly => true, + subscribe => Vcsrepo["$reposdir/$title"], + } + +} + + diff --git a/wmde-odoo/manifests/params.pp b/wmde-odoo/manifests/params.pp index c99482f..0f88963 100644 --- a/wmde-odoo/manifests/params.pp +++ b/wmde-odoo/manifests/params.pp @@ -10,6 +10,7 @@ class odoo::params{ $logdir = "/var/log/odoo" $logfile = "/var/log/odoo.log" + $reposdir = "/tmp/repos" case $::osfamily { 'FreeBSD':{