diff --git a/puppet/manifests/classes/apache.pp b/puppet/manifests/classes/apache.pp index 505d68a5..0e6ef446 100644 --- a/puppet/manifests/classes/apache.pp +++ b/puppet/manifests/classes/apache.pp @@ -1,22 +1,47 @@ # Get apache up and running class apache { - package { "httpd-devel": - ensure => present, - before => File['/etc/httpd/conf.d/playdoh-site.conf']; - } - file { "/etc/httpd/conf.d/playdoh-site.conf": - source => "$PROJ_DIR/puppet/files/etc/httpd/conf.d/playdoh-site.conf", - owner => "root", group => "root", mode => 0644, - require => [ Package['httpd-devel'] ]; - } - service { "httpd": - ensure => running, - enable => true, - require => [ - Package['httpd-devel'], - File['/etc/httpd/conf.d/playdoh-site.conf'] - ] - #subscribe => File['/etc/httpd/conf.d/playdoh-site.conf'] + case $operatingsystem { + centos: { + package { "httpd-devel": + ensure => present, + before => File['/etc/httpd/conf.d/playdoh-site.conf']; + } + file { "/etc/httpd/conf.d/playdoh-site.conf": + source => "$PROJ_DIR/puppet/files/etc/httpd/conf.d/playdoh-site.conf", + owner => "root", group => "root", mode => 0644, + require => [ Package['httpd-devel'] ]; + } + service { "httpd": + ensure => running, + enable => true, + require => [ + Package['httpd-devel'], + File['/etc/httpd/conf.d/playdoh-site.conf'] + ] + #subscribe => File['/etc/httpd/conf.d/playdoh-site.conf'] + } + + } + ubuntu: { + package { "apache2-dev": + ensure => present, + before => File['/etc/apache2/sites-enabled/playdoh-site.conf']; + } + file { "/etc/apache2/sites-enabled/playdoh-site.conf": + source => "$PROJ_DIR/puppet/files/etc/httpd/conf.d/playdoh-site.conf", + owner => "root", group => "root", mode => 0644, + require => [ Package['apache2-dev'] ]; + } + service { "apache2": + ensure => running, + enable => true, + require => [ + Package['apache2-dev'], + File['/etc/apache2/sites-enabled/playdoh-site.conf'] + ] + #subscribe => File['/etc/apache2/sites-enabled/playdoh-site.conf'] + } + } } } diff --git a/puppet/manifests/classes/dev_tools.pp b/puppet/manifests/classes/dev_tools.pp index 7d6d70e1..eca25d6a 100644 --- a/puppet/manifests/classes/dev_tools.pp +++ b/puppet/manifests/classes/dev_tools.pp @@ -1,7 +1,21 @@ # Ensure some handy dev tools are available. class dev_tools { - package { - [ "git", "vim-enhanced" ]: - ensure => installed; + case $operatingsystem { + centos: { + package { + [ "git", "vim-enhanced" ]: + ensure => installed; + } + } + + ubuntu: { + package { + [ "git-core", "vim", "emacs" ]: + ensure => installed; + } + } + + } + } diff --git a/puppet/manifests/classes/mysql.pp b/puppet/manifests/classes/mysql.pp index c2b89b09..bfa614ed 100644 --- a/puppet/manifests/classes/mysql.pp +++ b/puppet/manifests/classes/mysql.pp @@ -1,8 +1,11 @@ # Get mysql up and running class mysql { package { "mysql-server": ensure => installed; } - package { "mysql-devel": ensure => installed; } - service { "mysqld": + case $operatingsystem { + centos: { package { "mysql-devel": ensure => installed; }} + ubuntu: { package { "libmysqld-dev": ensure => installed; }} + } + service { "mysql": ensure => running, enable => true, require => Package['mysql-server'] diff --git a/puppet/manifests/classes/playdoh.pp b/puppet/manifests/classes/playdoh.pp index 1604f726..1da8c793 100644 --- a/puppet/manifests/classes/playdoh.pp +++ b/puppet/manifests/classes/playdoh.pp @@ -15,12 +15,16 @@ class playdoh_site { require => Exec["create_mysql_database"] } + # TODO: make this support centos or ubuntu (#centos) exec { "sql_migrate": cwd => "$PROJ_DIR", command => "/usr/bin/python2.6 ./vendor/src/schematic/schematic migrations/", require => [ - Service["mysqld"], - Package["python26-devel", "python26-mod_wsgi" ], + Service["mysql"], + Package["python2.6-dev", "libapache2-mod-wsgi", "python-wsgi-intercept" ], + + #centos Service["mysqld"], + #centos Package["python26-devel", "python26-mod_wsgi" ], Exec["grant_mysql_database"] ]; } diff --git a/puppet/manifests/classes/python.pp b/puppet/manifests/classes/python.pp index c1c4498b..230b1b90 100644 --- a/puppet/manifests/classes/python.pp +++ b/puppet/manifests/classes/python.pp @@ -1,16 +1,32 @@ # Install python and compiled modules for project class python { - package { - [ "python26-devel", "python26-libs", "python26-distribute", "python26-mod_wsgi" ]: - ensure => installed; + case $operatingsystem { + centos: { + package { + [ "python26-devel", "python26-libs", "python26-distribute", "python26-mod_wsgi" ]: + ensure => installed; + } + exec { "pip-install": + command => "/usr/bin/easy_install-2.6 -U pip", + creates => "/usr/bin/pip", + require => Package["python26-devel","python26-distribute"] + } + exec { "pip-install-compiled": + command => "/usr/bin/pip install -r $PROJ_DIR/requirements/compiled.txt", + require => Exec['pip-install'] + } + } + + ubuntu: { + package { + [ "python2.6-dev", "python2.6", "libapache2-mod-wsgi", "python-wsgi-intercept", "python-pip" ]: + ensure => installed; + } + exec { "pip-install-compiled": + command => "/usr/bin/pip install -r $PROJ_DIR/requirements/compiled.txt", + require => Package['python-pip'] + } + } + } - exec { "pip-install": - command => "/usr/bin/easy_install-2.6 -U pip", - creates => "/usr/bin/pip", - require => Package["python26-devel","python26-distribute"] - } - exec { "pip-install-compiled": - command => "/usr/bin/pip install -r $PROJ_DIR/requirements/compiled.txt", - require => Exec['pip-install'] - } -} +} \ No newline at end of file diff --git a/puppet/manifests/dev-vagrant.pp b/puppet/manifests/dev-vagrant.pp index 9afae55f..601a1189 100644 --- a/puppet/manifests/dev-vagrant.pp +++ b/puppet/manifests/dev-vagrant.pp @@ -17,8 +17,6 @@ class dev { dev_hacks: before => Class[repos]; repos: before => Class[dev_tools]; dev_tools: before => Class[slapd]; - #compilers: before => Class[bdb]; - #bdb: before => Class[slapd]; slapd: before => Class[mysql]; mysql: before => Class[python]; python: before => Class[apache];