|
|
|
|
@ -2,6 +2,11 @@
|
|
|
|
|
|
|
|
|
|
class odoo {
|
|
|
|
|
|
|
|
|
|
class { 'sudo':
|
|
|
|
|
purge => false,
|
|
|
|
|
config_file_replace => false,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user { odoo:
|
|
|
|
|
ensure => present,
|
|
|
|
|
shell => '/bin/bash',
|
|
|
|
|
@ -20,22 +25,24 @@ class odoo {
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDBIg6NZV4tTs+J5qUP4/zQAn+Xi3muKqbaSDV8yYm50mH77PcLwbkZVlxdF0/OFCl5f5FCNp4Ag4Px97M35Nv+BweOTCZNMKOHmvtXY1fCRUQnk6ca3NlipImppL0U47SUzt9KkNIsz0FWxLu74LANgxKwrf8Hgim8Nkq8WrlvuoJCqf+542N15cGrf/9eD6yRm7AmdFi7VIYrP4m7TPbXJBGX+cXOo0bKTyaq8mtinbUN5UCi/eJ08wYkm/CGVxL+9cm6HOABw332A8OadAliCZBWqhFT0rBKdoWLxBbTsILALskrddpKLwBLOUIU79YeT0OfNpLCnVi8u67X9inl',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ssh_authorized_key { "stefan@camadeus":
|
|
|
|
|
user => odoo,
|
|
|
|
|
type => 'ssh-rsa',
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQC0Lv4GOvotyJRzPphIjf+UEzRzWZpGaEt5HiWBx9ih6aBnSLXx0O+PA8+ejN4dfMK3rAu3vdcXcI/egj9eJbIYWeHnE2k/gckCgk3Ttg2aq24cGDcgTDB0MdfLYSeFNxRsrLH4fFpPtvulNyu7ZPuXJj/BaIUHGGas+lUP3r+Bmhj2+guWlTMVMLFMENn3FUlrtMCiL7wIiXGQ+xXHhRAqG55t+CLxX0jaf57uCGkYKlkTfQAmnGMiUnUcxjileUDq8HRlANSqv2XRH/tjonP/bPqs0PySCU9rWEomSpertvdrO/8ZPCo3fjAKCyAAC6GS8uPJlQIoEMo2EVG8DrbX',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ssh_authorized_key { "joerg@camadeus":
|
|
|
|
|
user => odoo,
|
|
|
|
|
type => 'ssh-rsa',
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQC5wf8HJPMWf9+NGbrHxehVB/mWavztXx6v6hgsjvY+mg8V2eAHwKVvm8k9idvg/AqkMR6DbxC5GbMYcYP9drxcE5WhBFV5okR8o5h0/ZvpCmF8FQOZuR0NbRWA9ybVPfkn9thdMv3PI7iAMt+3Nh0g1QBEx/w7RRZ+/3LxSeGOGIFBtWja5hA94SLIunjKTyo2wPxyr3GZoGkG9KTN9f1iI4Imrg5kUXAXtT7rpJ1NdZdphYiuBZiZ9rAHymr9yJkXsSLxNWboqBsFoWSkFVc1CxGeqHNcEKO16wtOeGoJgsURM0wscWi+YjQXCYxLVY8a8JzeRLlMVhojk0zSfwdD',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ssh_authorized_key { "christian@camadeus":
|
|
|
|
|
user => odoo,
|
|
|
|
|
type => 'ssh-rsa',
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDt1sWm9vgxSzLLIU8KUJunWmJDpX3KNRgcDI8NeTEVTlfSBWniLzbur1qaQrl1WuC9rMTIZ3JarhknVue/7RPq2fjZU2n9wBCkwgtanvpmv7eLBckyGAmW5ctHWnvLcbEexl3YsgKfQJ10a1xCDY2+Vm+cLDCO6ZH7L0KlnboRryMiASxYA+C73/ySXWTKj0tO6kSuDvt48DgRbbeqTMpRrhHlab5svz37AkZtb3cPz3UnMh+a7OlqA6Q4EL4fLVAmAC5bBVi2bsYzSVxwqbnAn/OwtmfIUP3v0UsyW/D6F8De9UhSPm2lgc+ZtTpXqUzrnHDxjituD6vFZPSLzayz',
|
|
|
|
|
|
|
|
|
|
sshkey { "gitlab.datenpol.at":
|
|
|
|
|
ensure => present,
|
|
|
|
|
type => "rsa",
|
|
|
|
|
key => "AAAAB3NzaC1yc2EAAAABIwAAAQEA06iMjK8mfl0MYClE91ilueqOA4Kx394xLZ4bJHFYUdalySAIPLJPQbtfO2cAjSDqJaq+lvCGdDyzQ8L+ZnNIhWea1FNA/QBHBSZEzsKsUPXUiL1gb0RUdPIgr24NJ4gQlLVf5SBRYPXv/JRE80TwEa7st1vkNiBzY+wt2IsLeEr+ekq0YufaODUxMfrHoAbqM4izdlWS9KVSWXdtnaFLnvYuY0d7nU9id8+ZSdLFzLrzIVuPRLVaRg00TYlxyUfLnyhKP+74GAtX9IG+yOwbzXONEjQYXsz6Ivhe6Z+fnWUrtAqyCvlvQxWXPgLNf3tCH9gnXXr3psjzNWpZDTGo6w=="
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file { '/etc/ssh/ssh_known_hosts':
|
|
|
|
|
ensure => file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class { 'postgresql::server':
|
|
|
|
|
@ -44,15 +51,6 @@ class odoo {
|
|
|
|
|
encoding => 'UTF8',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# # workaround for http://projects.puppetlabs.com/issues/4695
|
|
|
|
|
# # when PostgreSQL is installed with SQL_ASCII encoding instead of UTF8
|
|
|
|
|
# exec { 'utf8 postgres':
|
|
|
|
|
# command => 'sudo -u postgres pg_dropcluster --stop 9.3 main ; pg_createcluster --start --locale en_US.UTF-8 9.3 main',
|
|
|
|
|
# unless => 'sudo -u postgres psql -t -c "\l" | grep template1 | grep -q UTF',
|
|
|
|
|
# require => Class['postgresql::server'],
|
|
|
|
|
# path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin'],
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
file { "/var/log/odoo":
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
@ -111,23 +109,44 @@ class odoo {
|
|
|
|
|
# für wkhtmltox
|
|
|
|
|
'xfonts-base',
|
|
|
|
|
'xfonts-75dpi',
|
|
|
|
|
'node-less'
|
|
|
|
|
]:
|
|
|
|
|
ensure => present,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exec { "/usr/bin/wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb":
|
|
|
|
|
alias => "wkhtmltox",
|
|
|
|
|
cwd => "/tmp",
|
|
|
|
|
creates => '/tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file { 'wkhtmltox':
|
|
|
|
|
file { "wkthmltox":
|
|
|
|
|
name => "/tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb",
|
|
|
|
|
owner => root,
|
|
|
|
|
group => root,
|
|
|
|
|
source => "puppet:///modules/odoo/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb"
|
|
|
|
|
}
|
|
|
|
|
ensure => present,
|
|
|
|
|
alias => "wkhtmltox",
|
|
|
|
|
require => Exec["wkhtmltox"] }
|
|
|
|
|
|
|
|
|
|
# file { 'wkhtmltox':
|
|
|
|
|
# name => "/tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb",
|
|
|
|
|
# owner => root,
|
|
|
|
|
# group => root,
|
|
|
|
|
# source => "puppet:///modules/odoo/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb"
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# wget::fetch { "wkhtmltox":
|
|
|
|
|
# source => 'http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb',
|
|
|
|
|
# destination => '/tmp/',
|
|
|
|
|
# timeout => 0,
|
|
|
|
|
# verbose => true,
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
package { 'wkhtmltox':
|
|
|
|
|
provider => dpkg,
|
|
|
|
|
ensure => installed,
|
|
|
|
|
source => "/tmp/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb",
|
|
|
|
|
require => [File['wkhtmltopdf'],Package['xfonts-base']],
|
|
|
|
|
require => [FILE['wkhtmltox'],Package['xfonts-base']],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
package {['passlib',
|
|
|
|
|
@ -136,6 +155,7 @@ class odoo {
|
|
|
|
|
'requests',
|
|
|
|
|
'vatnumber',
|
|
|
|
|
'xlsxwriter',
|
|
|
|
|
'ofxparse'
|
|
|
|
|
]:
|
|
|
|
|
ensure => installed,
|
|
|
|
|
provider => 'pip',
|
|
|
|
|
@ -167,14 +187,6 @@ class odoo {
|
|
|
|
|
ensure => "directory",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Postfix setup
|
|
|
|
|
# class { '::postfix::server':
|
|
|
|
|
# myhostname => 'test.camadeus.at',
|
|
|
|
|
# mydomain => 'camadeus.at',
|
|
|
|
|
# mydestination => "\$myhostname, localhost.\$mydomain, localhost, $fqdn",
|
|
|
|
|
# inet_interfaces => 'localhost',
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# Default nginx file (prevent default server) REQUIRES SSL-key!!!
|
|
|
|
|
# Conf file
|
|
|
|
|
file { "/etc/nginx/conf.d/default.conf":
|
|
|
|
|
@ -204,7 +216,7 @@ class odoo {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_longpolling) {
|
|
|
|
|
define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_longpolling, $gitrepo, $gitbranch) {
|
|
|
|
|
$instance = $title
|
|
|
|
|
|
|
|
|
|
include odoo
|
|
|
|
|
@ -223,13 +235,6 @@ define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_lo
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDBIg6NZV4tTs+J5qUP4/zQAn+Xi3muKqbaSDV8yYm50mH77PcLwbkZVlxdF0/OFCl5f5FCNp4Ag4Px97M35Nv+BweOTCZNMKOHmvtXY1fCRUQnk6ca3NlipImppL0U47SUzt9KkNIsz0FWxLu74LANgxKwrf8Hgim8Nkq8WrlvuoJCqf+542N15cGrf/9eD6yRm7AmdFi7VIYrP4m7TPbXJBGX+cXOo0bKTyaq8mtinbUN5UCi/eJ08wYkm/CGVxL+9cm6HOABw332A8OadAliCZBWqhFT0rBKdoWLxBbTsILALskrddpKLwBLOUIU79YeT0OfNpLCnVi8u67X9inl',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$key_stefan="stefan@$instance"
|
|
|
|
|
ssh_authorized_key { $key_stefan:
|
|
|
|
|
user => $instance,
|
|
|
|
|
type => 'ssh-rsa',
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQC0Lv4GOvotyJRzPphIjf+UEzRzWZpGaEt5HiWBx9ih6aBnSLXx0O+PA8+ejN4dfMK3rAu3vdcXcI/egj9eJbIYWeHnE2k/gckCgk3Ttg2aq24cGDcgTDB0MdfLYSeFNxRsrLH4fFpPtvulNyu7ZPuXJj/BaIUHGGas+lUP3r+Bmhj2+guWlTMVMLFMENn3FUlrtMCiL7wIiXGQ+xXHhRAqG55t+CLxX0jaf57uCGkYKlkTfQAmnGMiUnUcxjileUDq8HRlANSqv2XRH/tjonP/bPqs0PySCU9rWEomSpertvdrO/8ZPCo3fjAKCyAAC6GS8uPJlQIoEMo2EVG8DrbX',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$key_joerg="joerg@$instance"
|
|
|
|
|
ssh_authorized_key { $key_joerg:
|
|
|
|
|
user => odoo,
|
|
|
|
|
@ -237,13 +242,7 @@ define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_lo
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQC5wf8HJPMWf9+NGbrHxehVB/mWavztXx6v6hgsjvY+mg8V2eAHwKVvm8k9idvg/AqkMR6DbxC5GbMYcYP9drxcE5WhBFV5okR8o5h0/ZvpCmF8FQOZuR0NbRWA9ybVPfkn9thdMv3PI7iAMt+3Nh0g1QBEx/w7RRZ+/3LxSeGOGIFBtWja5hA94SLIunjKTyo2wPxyr3GZoGkG9KTN9f1iI4Imrg5kUXAXtT7rpJ1NdZdphYiuBZiZ9rAHymr9yJkXsSLxNWboqBsFoWSkFVc1CxGeqHNcEKO16wtOeGoJgsURM0wscWi+YjQXCYxLVY8a8JzeRLlMVhojk0zSfwdD',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$key_christian="christian@$instance"
|
|
|
|
|
ssh_authorized_key { $key_christian:
|
|
|
|
|
user => odoo,
|
|
|
|
|
type => 'ssh-rsa',
|
|
|
|
|
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDt1sWm9vgxSzLLIU8KUJunWmJDpX3KNRgcDI8NeTEVTlfSBWniLzbur1qaQrl1WuC9rMTIZ3JarhknVue/7RPq2fjZU2n9wBCkwgtanvpmv7eLBckyGAmW5ctHWnvLcbEexl3YsgKfQJ10a1xCDY2+Vm+cLDCO6ZH7L0KlnboRryMiASxYA+C73/ySXWTKj0tO6kSuDvt48DgRbbeqTMpRrhHlab5svz37AkZtb3cPz3UnMh+a7OlqA6Q4EL4fLVAmAC5bBVi2bsYzSVxwqbnAn/OwtmfIUP3v0UsyW/D6F8De9UhSPm2lgc+ZtTpXqUzrnHDxjituD6vFZPSLzayz',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ssh_keygen { $instance: }
|
|
|
|
|
|
|
|
|
|
$sudo_entry="$instance ALL = (root) NOPASSWD: /etc/init.d/odoo-server-$instance, /usr/sbin/service odoo-server-$instance *"
|
|
|
|
|
sudo::conf { $instance:
|
|
|
|
|
@ -306,42 +305,76 @@ define odoo::instance ($db_pw,$ssl = false, $servername, $odooport, $odooport_lo
|
|
|
|
|
content => template('odoo/restart.sh.erb'),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file { "/home/$instance/ext.git":
|
|
|
|
|
owner => $instance,
|
|
|
|
|
group => $instance,
|
|
|
|
|
mode => '0600',
|
|
|
|
|
ensure => "directory",
|
|
|
|
|
recurse => true,
|
|
|
|
|
require => Package[git],
|
|
|
|
|
file { "/home/$instance/update-source.sh":
|
|
|
|
|
owner => $instance,
|
|
|
|
|
group => $instance,
|
|
|
|
|
mode => '0755',
|
|
|
|
|
ensure => present,
|
|
|
|
|
content => template('odoo/update-source.sh.erb'),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$gitdir="/home/$instance/ext"
|
|
|
|
|
$giturl="ssh://git@gitlab.datenpol.at:122/odoo/$gitrepo.git"
|
|
|
|
|
vcsrepo { $gitdir:
|
|
|
|
|
ensure => present,
|
|
|
|
|
provider => git,
|
|
|
|
|
source => $giturl,
|
|
|
|
|
revision => $gitbranch,
|
|
|
|
|
user => 'ctba-prod'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file { "/home/$instance/ext":
|
|
|
|
|
file { "/home/$instance/config":
|
|
|
|
|
owner => $instance,
|
|
|
|
|
group => $instance,
|
|
|
|
|
mode => '0700',
|
|
|
|
|
ensure => "directory",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$git_requires = "File[/home/$instance/ext.git]"
|
|
|
|
|
$git_create_cmd = "sudo -u $instance git init --bare /home/$instance/ext.git"
|
|
|
|
|
$git_unless_cmd = "sudo -u $instance test -e /home/$instance/ext.git/HEAD"
|
|
|
|
|
$git_repo = "git_repo_$instance"
|
|
|
|
|
exec { $git_repo:
|
|
|
|
|
command => $git_create_cmd,
|
|
|
|
|
unless => $git_unless_cmd,
|
|
|
|
|
path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin'],
|
|
|
|
|
require => $git_requires,
|
|
|
|
|
}
|
|
|
|
|
# Odoo config
|
|
|
|
|
file { "/home/$instance/config/odoo-server.conf":
|
|
|
|
|
owner => $instance,
|
|
|
|
|
group => $instance,
|
|
|
|
|
mode => '0700',
|
|
|
|
|
ensure => present,
|
|
|
|
|
content => template('odoo/odoo-server.conf.erb'),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file { "/home/$instance/ext.git/hooks/post-receive":
|
|
|
|
|
owner => $instance,
|
|
|
|
|
group => $instance,
|
|
|
|
|
mode => '0700',
|
|
|
|
|
ensure => present,
|
|
|
|
|
content => "#!/bin/bash
|
|
|
|
|
git --work-tree=/home/$instance/ext --git-dir=/home/$instance/ext.git checkout -f",
|
|
|
|
|
require => Exec[$git_repo],
|
|
|
|
|
}
|
|
|
|
|
# file { "/home/$instance/ext.git":
|
|
|
|
|
# owner => $instance,
|
|
|
|
|
# group => $instance,
|
|
|
|
|
# mode => '0600',
|
|
|
|
|
# ensure => "directory",
|
|
|
|
|
# recurse => true,
|
|
|
|
|
# require => Package[git],
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# file { "/home/$instance/ext":
|
|
|
|
|
# owner => $instance,
|
|
|
|
|
# group => $instance,
|
|
|
|
|
# mode => '0700',
|
|
|
|
|
# ensure => "directory",
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# $git_requires = "File[/home/$instance/ext.git]"
|
|
|
|
|
# $git_create_cmd = "sudo -u $instance git init --bare /home/$instance/ext.git"
|
|
|
|
|
# $git_unless_cmd = "sudo -u $instance test -e /home/$instance/ext.git/HEAD"
|
|
|
|
|
# $git_repo = "git_repo_$instance"
|
|
|
|
|
# exec { $git_repo:
|
|
|
|
|
# command => $git_create_cmd,
|
|
|
|
|
# unless => $git_unless_cmd,
|
|
|
|
|
# path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin'],
|
|
|
|
|
# require => $git_requires,
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# file { "/home/$instance/ext.git/hooks/post-receive":
|
|
|
|
|
# owner => $instance,
|
|
|
|
|
# group => $instance,
|
|
|
|
|
# mode => '0700',
|
|
|
|
|
# ensure => present,
|
|
|
|
|
# content => "#!/bin/bash
|
|
|
|
|
#git --work-tree=/home/$instance/ext --git-dir=/home/$instance/ext.git checkout -f",
|
|
|
|
|
# require => Exec[$git_repo],
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# backup
|
|
|
|
|
|