Multi-OS Version

This commit is contained in:
Wile E. Coyote 2017-01-24 21:12:53 +00:00
parent 15630ec66a
commit b353f4410b
19 changed files with 3077 additions and 49 deletions

View file

@ -10,11 +10,14 @@
#
# Sample Usage:
#
class rhizo_base::apt {
include "rhizo_base::apt::$operatingsystem"
}
class rhizo_base::apt::common {
class { '::apt': }
apt::ppa { 'ppa:keithw/mosh': }
apt::ppa { 'ppa:ondrej/php': }
apt::ppa { 'ppa:ondrej/apache2': }
file { '/etc/apt/apt.conf.d/90unsigned':
ensure => present,
@ -34,6 +37,15 @@ class rhizo_base::apt {
include_src => false,
require => File['/etc/apt/apt.conf.d/90unsigned'],
}
}
class rhizo_base::apt::ubuntu inherits rhizo_base::apt::common {
apt::ppa { 'ppa:keithw/mosh': }
apt::ppa { 'ppa:ondrej/php': }
apt::ppa { 'ppa:ondrej/apache2': }
apt::source { 'icinga':
location => 'https://packages.icinga.org/ubuntu',
release => 'icinga-precise',
@ -41,10 +53,29 @@ class rhizo_base::apt {
key_source => 'https://packages.icinga.org/icinga.key',
include_src => false,
}
apt::source { 'nodesource':
location => 'https://deb.nodesource.com/node_0.10',
release => 'precise',
repos => 'main',
key_source => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key'
}
}
}
class rhizo_base::apt::debian inherits rhizo_base::apt::common {
apt::source { 'freeswitch':
location => 'http://files.freeswitch.org/repo/deb/freeswitch-1.6/',
release => 'jessie',
repos => 'main',
include_src => false,
key_source => 'http://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub'
}
apt::source { 'nodesource':
location => 'https://deb.nodesource.com/node_0.10',
release => 'jessie',
repos => 'main',
key_source => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key'
}
}

View file

@ -10,7 +10,12 @@
#
# Sample Usage:
#
class rhizo_base::fixes {
include "rhizo_base::fixes::$operatingsystem"
}
class rhizo_base::fixes::ubuntu {
#FSCK at boot
file { '/etc/default/rcS':
ensure => present,
@ -28,4 +33,8 @@ class rhizo_base::fixes {
command => '/usr/sbin/update-grub',
refreshonly => true,
}
}
}
class rhizo_base::fixes::debian {
# Nothing
}

View file

@ -11,6 +11,62 @@
# Sample Usage:
#
class rhizo_base::freeswitch {
include "rhizo_base::freeswitch::$operatingsystem"
}
class rhizo_base::freeswitch::ubuntu inherits rhizo_base::freeswitch::common {
file { '/usr/lib/freeswitch/mod/mod_g729.so':
source => 'puppet:///modules/rhizo_base/mod_g729.so',
require => Package['freeswitch'],
}
package {
['freeswitch-mod-speex','freeswitch-mod-cdr-pg-csv',
'freeswitch-mod-vp8']:
ensure => installed,
require => Class['rhizo_base::apt'],
}
service { 'freeswitch':
enable => false,
require => Package['freeswitch']
}
}
class rhizo_base::freeswitch::debian inherits rhizo_base::freeswitch::common {
include systemd
package {
[ 'freeswitch-mod-g729' ]:
ensure => installed,
require => Class['rhizo_base::apt'],
}
file { '/usr/lib/freeswitch/mod/mod_cdr_pg_csv.so':
source => 'puppet:///modules/rhizo_base/usr/lib/freeswitch/mod/mod_cdr_pg_csv.so',
require => Package['freeswitch'],
}
file { '/etc/default/freeswitch':
source => 'puppet:///modules/rhizo_base/etc/default/freeswitch',
require => Package['freeswitch'],
}
systemd::unit_file { 'freeswitch.service':
source => "puppet:///modules/rhizo_base/freeswitch.service",
}
systemd::tmpfile { 'freeswitch.tmpfile':
source => "puppet:///modules/rhizo_base/freeswitch.tmpfile",
}
}
class rhizo_base::freeswitch::common {
$pgsql_db = $rhizo_base::pgsql_db
$pgsql_user = $rhizo_base::pgsql_user
@ -29,7 +85,7 @@ class rhizo_base::freeswitch {
['freeswitch', 'freeswitch-lang-en',
'freeswitch-mod-amr', 'freeswitch-mod-amrwb',
'freeswitch-mod-b64', 'freeswitch-mod-bv',
'freeswitch-mod-cdr-pg-csv', 'freeswitch-mod-cluechoo',
'freeswitch-mod-cluechoo',
'freeswitch-mod-commands', 'freeswitch-mod-conference',
'freeswitch-mod-console', 'freeswitch-mod-db',
'freeswitch-mod-dialplan-asterisk', 'freeswitch-mod-dialplan-xml',
@ -44,25 +100,15 @@ class rhizo_base::freeswitch {
'freeswitch-mod-python', 'freeswitch-mod-say-en',
'freeswitch-mod-say-es', 'freeswitch-mod-sms',
'freeswitch-mod-sndfile', 'freeswitch-mod-sofia',
'freeswitch-mod-spandsp', 'freeswitch-mod-speex',
'freeswitch-mod-spandsp',
'freeswitch-mod-syslog', 'freeswitch-mod-tone-stream',
'freeswitch-mod-voicemail', 'freeswitch-mod-voicemail-ivr',
'freeswitch-mod-vp8', 'freeswitch-mod-xml-cdr',
'freeswitch-mod-xml-cdr',
'freeswitch-sysvinit', 'libfreeswitch1']:
ensure => installed,
require => Class['rhizo_base::apt'],
}
service { 'freeswitch':
enable => false,
require => Package['freeswitch']
}
file { '/usr/lib/freeswitch/mod/mod_g729.so':
source => 'puppet:///modules/rhizo_base/mod_g729.so',
require => Package['freeswitch'],
}
file { '/etc/freeswitch':
ensure => directory,
source => 'puppet:///modules/rhizo_base/etc/freeswitch',

View file

@ -150,7 +150,9 @@ class rhizo_base {
include rhizo_base::fixes
include rhizo_base::apt
include rhizo_base::postgresql
include rhizo_base::riak
if $operatingsystem != 'Debian' {
include rhizo_base::riak
}
include rhizo_base::packages
include rhizo_base::freeswitch
include rhizo_base::runit
@ -158,7 +160,9 @@ class rhizo_base {
include rhizo_base::lcr
include rhizo_base::sudo
include rhizo_base::users
include rhizo_base::icinga
if $operatingsystem != 'Debian' {
include rhizo_base::icinga
}
include rhizo_base::kiwi
@ -241,12 +245,23 @@ class rhizo_base {
content => template('rhizo_base/localnet.json.erb'),
}
exec { 'locale-gen':
command => '/usr/sbin/locale-gen',
require => [ File['/var/rhizomatica/rccn/config_values.py'],
File['/var/lib/locales/supported.d/local'] ],
refreshonly => true,
}
if $operatingsystem == 'Debian' {
exec { 'locale-gen':
command => '/usr/sbin/locale-gen',
require => [ File['/var/rhizomatica/rccn/config_values.py'],
File['/etc/locale.gen'] ],
refreshonly => true,
}
}
if $operatingsystem == 'Ubuntu' {
exec { 'locale-gen':
command => '/usr/sbin/locale-gen',
require => [ File['/var/rhizomatica/rccn/config_values.py'],
File['/var/lib/locales/supported.d/local'] ],
refreshonly => true,
}
}
exec { 'notify-freeswitch':
command => '/bin/echo 1 > /tmp/FS-dirty',
@ -262,12 +277,21 @@ class rhizo_base {
command => '/usr/bin/sv restart rapi',
refreshonly => true,
}
file { '/var/lib/locales/supported.d/local':
ensure => present,
source => 'puppet:///modules/rhizo_base/var/lib/locales/supported.d/local',
}
if $operatingsystem == 'Ubuntu' {
file { '/var/lib/locales/supported.d/local':
ensure => present,
source => 'puppet:///modules/rhizo_base/var/lib/locales/supported.d/local',
}
}
if $operatingsystem == 'Debian' {
file { '/etc/locale.gen':
ensure => present,
source => 'puppet:///modules/rhizo_base/etc/locale.gen',
}
}
file { '/var/www/html/rai':
ensure => link,
target => '/var/rhizomatica/rai',
@ -287,6 +311,18 @@ class rhizo_base {
dev => true,
}
if $operatingsystem == 'Debian' {
python::pip { 'twisted':
ensure => '13.1.0',
pkgname => 'Twisted',
}
python::pip { 'corepost':
ensure => 'present',
pkgname => 'CorePost',
}
}
python::pip { 'riak':
ensure => '2.0.3',
pkgname => 'riak',

View file

@ -22,7 +22,10 @@ class rhizo_base::kiwi {
package {
['nodejs']:
ensure => '0.10.48-1nodesource1~precise1',
ensure => $operatingsystem ? {
"Ubuntu" => '0.10.48-1nodesource1~precise1',
"Debian" => '0.10.48-1nodesource1~jessie1',
},
require => Class['rhizo_base::apt'],
}

View file

@ -11,6 +11,11 @@
# Sample Usage:
#
class rhizo_base::packages {
include "rhizo_base::packages::$operatingsystem"
}
class rhizo_base::packages::common {
package { ['mosh', 'git', 'openvpn', 'lm-sensors', 'runit', 'sqlite3',
'libffi-dev', 'apcupsd', 'expect', 'gawk']:
@ -18,6 +23,16 @@ class rhizo_base::packages {
require => Class['rhizo_base::apt'],
}
file { '/etc/php5/apache2/php.ini':
ensure => present,
source => "puppet:///modules/rhizo_base/etc/php5/apache2/php.ini.$operatingsystem"
}
}
class rhizo_base::packages::ubuntu inherits rhizo_base::packages::common {
package { ['puppet', 'puppet-common']:
ensure => '3.8.1-1puppetlabs1',
}
@ -33,10 +48,17 @@ class rhizo_base::packages {
require => Class['rhizo_base::apt'],
}
file { '/etc/php5/apache2/php.ini':
ensure => present,
source => 'puppet:///modules/rhizo_base/etc/php5/apache2/php.ini',
require => Package['libapache2-mod-php5.6'],
}
}
class rhizo_base::packages::debian inherits rhizo_base::packages::common {
package { ['apache2','libapache2-mod-php5',
'rrdtool', 'python-psycopg2',
'python-pysqlite2', 'php5', 'php5-pgsql',
'php5-curl', 'php5-cli', 'php5-gd',
'python-yaml', 'python-formencode', 'python-unidecode',
'python-dateutil', 'sudo', 'apt-transport-https']:
ensure => installed,
require => Class['rhizo_base::apt'],
}
}

View file

@ -10,12 +10,26 @@
#
# Sample Usage:
#
class rhizo_base::postgresql {
include "rhizo_base::postgresql::$operatingsystem"
}
class rhizo_base::postgresql::common {
$pgsql_db = $rhizo_base::pgsql_db
$pgsql_user = $rhizo_base::pgsql_user
$pgsql_pwd = $rhizo_base::pgsql_pwd
$pgsql_host = $rhizo_base::pgsql_host
postgresql::server::db { $pgsql_db:
user => $pgsql_user,
password => postgresql_password($pgsql_user, $pgsql_pwd),
}
}
class rhizo_base::postgresql::ubuntu inherits rhizo_base::postgresql::common {
class { 'postgresql::globals':
manage_package_repo => true,
@ -24,8 +38,15 @@ class rhizo_base::postgresql {
class { 'postgresql::server':
}
postgresql::server::db { $pgsql_db:
user => $pgsql_user,
password => postgresql_password($pgsql_user, $pgsql_pwd),
}
class rhizo_base::postgresql::debian inherits rhizo_base::postgresql::common {
class { 'postgresql::globals':
manage_package_repo => true,
version => '9.4',
}->
class { 'postgresql::server':
}
}
}

View file

@ -25,12 +25,14 @@ class rhizo_base::runit {
[ File['/etc/sv'], Class['rhizo_base::openbsc'] ],
}
file { '/etc/service/freeswitch':
ensure => link,
target => '/etc/sv/freeswitch',
require =>
[ File['/etc/sv'], Class['rhizo_base::freeswitch'] ],
}
if $operatingsystem != 'Debian' {
file { '/etc/service/freeswitch':
ensure => link,
target => '/etc/sv/freeswitch',
require =>
[ File['/etc/sv'], Class['rhizo_base::freeswitch'] ],
}
}
file { '/etc/service/rapi':
ensure => link,

View file

@ -14,7 +14,7 @@ class rhizo_base::sudo {
file { '/etc/sudoers':
ensure => present,
source => 'puppet:///modules/rhizo_base/etc/sudoers',
source => "puppet:///modules/rhizo_base/etc/sudoers.$operatingsystem",
owner => 'root',
group => 'root',
mode => '0440',