From 6eb456b9b039fe3574eccbe3d6be73eb83c5615a Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Fri, 12 Oct 2012 17:22:09 -0700 Subject: [PATCH] code cleanup --- manifests/site.pp | 8 ++++++++ modules/drupal/manifests/nginx/vhost.pp | 14 ++++++++------ modules/drush/manifests/config.pp | 5 +++++ modules/drush/manifests/init.pp | 8 +++++++- modules/drush/manifests/install.pp | 7 ++++++- modules/git/manifests/init.pp | 9 +++++++-- modules/mysql/manifests/init.pp | 8 +++++++- modules/mysql/manifests/my.pp | 9 ++++++++- modules/mysql/manifests/server.pp | 8 +++++++- modules/mysql/manifests/server/config.pp | 6 +++++- modules/mysql/manifests/server/db.pp | 9 ++++++++- modules/mysql/manifests/server/install.pp | 15 +++++++++++++-- modules/mysql/manifests/server/service.pp | 8 +++++++- modules/network/manifests/config.pp | 9 +++++++-- modules/network/manifests/init.pp | 8 +++++++- modules/nginx/manifests/init.pp | 10 +++++++--- modules/nginx/manifests/install.pp | 8 ++++++-- modules/nginx/manifests/service.pp | 6 +++++- modules/nginx/manifests/vhost.pp | 9 ++++++++- modules/php5/manifests/config.pp | 6 +++++- modules/php5/manifests/ini.pp | 9 ++++++++- modules/php5/manifests/init.pp | 6 +++++- modules/php5/manifests/install.pp | 6 +++++- modules/phpfpm/manifests/config.pp | 8 +++++++- modules/phpfpm/manifests/extension.pp | 8 +++++++- modules/phpfpm/manifests/extensions/apc.pp | 9 ++++++++- modules/phpfpm/manifests/extensions/curl.pp | 6 +++++- modules/phpfpm/manifests/extensions/gd.pp | 6 +++++- modules/phpfpm/manifests/extensions/imap.pp | 6 +++++- modules/phpfpm/manifests/extensions/mcrypt.pp | 6 +++++- modules/phpfpm/manifests/extensions/pear.pp | 6 +++++- modules/phpfpm/manifests/extensions/xdebug.pp | 8 +++++++- modules/phpfpm/manifests/init.pp | 6 +++++- modules/phpfpm/manifests/install.pp | 6 +++++- modules/phpfpm/manifests/nginx/kalabox.pp | 10 +++++++++- modules/phpfpm/manifests/nginx/vhost.pp | 9 ++++++++- modules/phpfpm/manifests/service.pp | 6 +++++- modules/phpmyadmin/manifests/config.pp | 12 +++++++++++- modules/phpmyadmin/manifests/init.pp | 6 +++++- modules/phpmyadmin/manifests/install.pp | 6 +++++- modules/puppet/manifests/config.pp | 7 ++++++- modules/puppet/manifests/init.pp | 6 +++++- modules/puppet/manifests/install.pp | 8 +++++++- modules/puppet/manifests/service.pp | 6 +++++- modules/samba/manifests/config.pp | 6 +++++- modules/samba/manifests/init.pp | 8 +++++++- modules/samba/manifests/install.pp | 8 +++++++- modules/samba/manifests/service.pp | 8 +++++++- modules/solr/manifests/init.pp | 6 +++++- modules/solr/manifests/install.pp | 6 +++++- modules/solr/manifests/params.pp | 6 +++++- modules/solr/manifests/service.pp | 5 +++++ modules/ssh/manifests/client.pp | 8 ++++++++ modules/ssh/manifests/client/install.pp | 7 +++++++ modules/ssh/manifests/init.pp | 7 +++++++ modules/ssh/manifests/server.pp | 7 +++++++ modules/ssh/manifests/server/install.pp | 7 +++++++ modules/ssh/manifests/server/service.pp | 7 +++++++ 58 files changed, 378 insertions(+), 60 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index f75e672..0ec7b10 100755 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1,3 +1,10 @@ +/** + * + * This will build a basic LEMP stack with some extra goodies for every node that connects to the puppetmaster + * at kalabox.kalamuna.com + * + */ + node "default" { # initialize core packages @@ -27,4 +34,5 @@ enabled => "FALSE", custom => "# THIS IS MEANT TO BE USED FOR BUILDING OTHER DRUPAL VHOSTS" } + } diff --git a/modules/drupal/manifests/nginx/vhost.pp b/modules/drupal/manifests/nginx/vhost.pp index 1023485..ad083e3 100644 --- a/modules/drupal/manifests/nginx/vhost.pp +++ b/modules/drupal/manifests/nginx/vhost.pp @@ -1,3 +1,8 @@ +/** + * + * This is a basic definition for creating a drupal based nginx vhost file + * + */ define drupal::nginx::vhost ( $vhost = $title, @@ -12,6 +17,7 @@ include nginx + # Enable the site if enabled = true if ($enabled == TRUE) { file { "/etc/nginx/sites-enabled/${vhost}": ensure => link, @@ -28,6 +34,8 @@ notify => Class["nginx::service"], } } + + # Only make the site available else { file { "/etc/nginx/sites-available/${vhost}": ensure => file, @@ -37,10 +45,4 @@ } } - file { $root: - ensure => "directory", - owner => "www-data", - group => "www-data", - mode => 755, - } } diff --git a/modules/drush/manifests/config.pp b/modules/drush/manifests/config.pp index 481e2f1..9c12b74 100644 --- a/modules/drush/manifests/config.pp +++ b/modules/drush/manifests/config.pp @@ -1,3 +1,8 @@ +/** + * + * Provides some custom drush commands + * + */ class drush::config { file { "/usr/share/drush/commands/kala": diff --git a/modules/drush/manifests/init.pp b/modules/drush/manifests/init.pp index f9982b2..530a377 100644 --- a/modules/drush/manifests/init.pp +++ b/modules/drush/manifests/init.pp @@ -1,4 +1,10 @@ - +/** + * + * Installs drush and provides some custom commands + * + */ class drush { + include drush::install, drush::config + } \ No newline at end of file diff --git a/modules/drush/manifests/install.pp b/modules/drush/manifests/install.pp index f98288e..0645f4e 100644 --- a/modules/drush/manifests/install.pp +++ b/modules/drush/manifests/install.pp @@ -1,7 +1,12 @@ - +/** + * + * Installs drush + * + */ class drush::install { package { "drush": ensure => "4.5-6", } + } \ No newline at end of file diff --git a/modules/git/manifests/init.pp b/modules/git/manifests/init.pp index aeb9834..e74183a 100644 --- a/modules/git/manifests/init.pp +++ b/modules/git/manifests/init.pp @@ -1,7 +1,12 @@ - +/** + * + * Nothing special, just a basic version of git + * + */ class git { - + package { "git-core": ensure => "1:1.7.9.5-1", } + } diff --git a/modules/mysql/manifests/init.pp b/modules/mysql/manifests/init.pp index a084ca3..9b9a1ce 100644 --- a/modules/mysql/manifests/init.pp +++ b/modules/mysql/manifests/init.pp @@ -1,4 +1,10 @@ - +/** + * + * Installs and configures the mysql-server + * + */ class mysql { + include mysql::server + } \ No newline at end of file diff --git a/modules/mysql/manifests/my.pp b/modules/mysql/manifests/my.pp index 775a574..98ff329 100644 --- a/modules/mysql/manifests/my.pp +++ b/modules/mysql/manifests/my.pp @@ -1,5 +1,10 @@ - +/** + * + * Defines and sets default values for a my.cnf file + * + */ define mysql::my ( + # basic settings $path = "/etc/mysql/my.cnf", $port = 3306, @@ -33,6 +38,7 @@ $isort_buffer_size = "256M", $iread_buffer = "2M", $iwrite_buffer = "2M", + ) { file { @@ -40,4 +46,5 @@ path => "${path}", content => template("mysql/my.cnf.erb"), } + } \ No newline at end of file diff --git a/modules/mysql/manifests/server.pp b/modules/mysql/manifests/server.pp index 4780bf1..738cfee 100644 --- a/modules/mysql/manifests/server.pp +++ b/modules/mysql/manifests/server.pp @@ -1,4 +1,10 @@ - +/** + * + * Loads subclasses to complete the server install and config + * + */ class mysql::server { + include mysql::server::install, mysql::server::config, mysql::server::service + } \ No newline at end of file diff --git a/modules/mysql/manifests/server/config.pp b/modules/mysql/manifests/server/config.pp index 0a726ba..182f35e 100644 --- a/modules/mysql/manifests/server/config.pp +++ b/modules/mysql/manifests/server/config.pp @@ -1,4 +1,8 @@ - +/** + * + * Class that governs the creation of the mysql-server configuration + * + */ class mysql::server::config { mysql::my { "my.cnf": diff --git a/modules/mysql/manifests/server/db.pp b/modules/mysql/manifests/server/db.pp index 27b3e2a..811647c 100644 --- a/modules/mysql/manifests/server/db.pp +++ b/modules/mysql/manifests/server/db.pp @@ -1,9 +1,16 @@ - +/** + * + * Basic definition to create a database + * + */ define mysql::server::db($username, $password, $host = 'localhost') { + $root_password = $mysql::server::install::password + exec { "create-${name}-db": unless => "/usr/bin/mysql -u${username} -p${password} ${name}", command => "/usr/bin/mysql -uroot -p${root_password} -e \"create database ${name}; grant all on ${name}.* to ${username}@${host} identified by '$password';\"", require => Class['mysql::server::service'], } + } diff --git a/modules/mysql/manifests/server/install.pp b/modules/mysql/manifests/server/install.pp index 9ee6c26..2fbfd3b 100644 --- a/modules/mysql/manifests/server/install.pp +++ b/modules/mysql/manifests/server/install.pp @@ -1,13 +1,25 @@ - +/** + * + * Sets up mysql-server by: + * + * 1. Installs the mysql-server package + * 2. Installs the php5 mysql extension + * 3. Adds the mysql root user and sets it's password + * + */ class mysql::server::install { + $password = "password" + # Install mysql-server package { "mysql-server": ensure => "5.5.24-0ubuntu0.12.04.1" } + # Install php5 extension phpfpm::extension { "php5-mysql": version => "5.3.10-1ubuntu3.4", } + # Add the root user exec { "Set MySQL server root password": subscribe => Package["mysql-server"], refreshonly => true, @@ -16,5 +28,4 @@ command => "mysqladmin -uroot password $password", } - } \ No newline at end of file diff --git a/modules/mysql/manifests/server/service.pp b/modules/mysql/manifests/server/service.pp index b2477c6..c44a20f 100644 --- a/modules/mysql/manifests/server/service.pp +++ b/modules/mysql/manifests/server/service.pp @@ -1,5 +1,10 @@ - +/** + * + * Makes sure the mysql service is running + * + */ class mysql::server::service { + service { "mysql-server": ensure => running, name => "mysql", @@ -8,4 +13,5 @@ enable => true, require => Class["mysql::server::install"], } + } diff --git a/modules/network/manifests/config.pp b/modules/network/manifests/config.pp index bf14236..100b30e 100644 --- a/modules/network/manifests/config.pp +++ b/modules/network/manifests/config.pp @@ -1,10 +1,15 @@ - +/** + * + * Provides a basic hosts file + * + */ class network::config { - + file { "/etc/hosts" : ensure => present, content => template("network/hosts.erb"), owner => "root", group => "root", } + } \ No newline at end of file diff --git a/modules/network/manifests/init.pp b/modules/network/manifests/init.pp index 1ff3d62..66b9518 100644 --- a/modules/network/manifests/init.pp +++ b/modules/network/manifests/init.pp @@ -1,4 +1,10 @@ - +/** + * + * All classes regarding networking go here + * + */ class network { + include network::config + } \ No newline at end of file diff --git a/modules/nginx/manifests/init.pp b/modules/nginx/manifests/init.pp index bc84557..26942c4 100644 --- a/modules/nginx/manifests/init.pp +++ b/modules/nginx/manifests/init.pp @@ -1,6 +1,10 @@ - +/** + * + * Installs and configures nginx + * + */ class nginx { - + include nginx::install, nginx::service - + } \ No newline at end of file diff --git a/modules/nginx/manifests/install.pp b/modules/nginx/manifests/install.pp index b6c189a..c830058 100644 --- a/modules/nginx/manifests/install.pp +++ b/modules/nginx/manifests/install.pp @@ -1,6 +1,10 @@ - +/** + * + * Installst the nginx package + * + */ class nginx::install { - + package { "nginx": ensure => "1.1.19-1", } diff --git a/modules/nginx/manifests/service.pp b/modules/nginx/manifests/service.pp index f961250..b4c9cb8 100644 --- a/modules/nginx/manifests/service.pp +++ b/modules/nginx/manifests/service.pp @@ -1,4 +1,8 @@ - +/** + * + * Makes sure nginx is running + * + */ class nginx::service ($ensure = "running") { service { "nginx": diff --git a/modules/nginx/manifests/vhost.pp b/modules/nginx/manifests/vhost.pp index 15ae623..eb7bc00 100644 --- a/modules/nginx/manifests/vhost.pp +++ b/modules/nginx/manifests/vhost.pp @@ -1,8 +1,14 @@ - +/** + * + * Basic definition for a barebones nginx vhost + * + */ define nginx::vhost ( + $vhost = $title, $root = "/var/www", $server_name = "_", + ) { file { "/etc/nginx/sites-available/${vhost}": @@ -19,4 +25,5 @@ target => "/etc/nginx/sites-available/${vhost}", require => Class["nginx::install"], } + } \ No newline at end of file diff --git a/modules/php5/manifests/config.pp b/modules/php5/manifests/config.pp index a83b714..7e2b72a 100644 --- a/modules/php5/manifests/config.pp +++ b/modules/php5/manifests/config.pp @@ -1,4 +1,8 @@ - +/** + * + * Builds a basic php.ini file for CLI + * + */ class php5::config { php5::ini { "cli": diff --git a/modules/php5/manifests/ini.pp b/modules/php5/manifests/ini.pp index d7133e4..8a60433 100644 --- a/modules/php5/manifests/ini.pp +++ b/modules/php5/manifests/ini.pp @@ -1,5 +1,10 @@ - +/** + * + * Definition for building a php.ini file + * + */ define php5::ini ( + $path = "/etc/php.ini", $disable_functions = "pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,", $max_execution_time = 30, @@ -12,6 +17,7 @@ $error_log = "/var/log/php_errors.l#og", $post_max_size = "200M", $upload_max_filesize = "200M", + ) { file { @@ -19,4 +25,5 @@ path => "${path}", content => template("php5/php.ini.erb"), } + } \ No newline at end of file diff --git a/modules/php5/manifests/init.pp b/modules/php5/manifests/init.pp index fa92c66..c9470f4 100644 --- a/modules/php5/manifests/init.pp +++ b/modules/php5/manifests/init.pp @@ -1,4 +1,8 @@ - +/** + * + * Install and sets up PHP5 for CLI + * + */ class php5 { include php5::install, php5::config diff --git a/modules/php5/manifests/install.pp b/modules/php5/manifests/install.pp index 44a4501..6571805 100644 --- a/modules/php5/manifests/install.pp +++ b/modules/php5/manifests/install.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs PHP5 for CLI + * + */ class php5::install { package { "php5-cli": diff --git a/modules/phpfpm/manifests/config.pp b/modules/phpfpm/manifests/config.pp index 60a5e64..611591e 100644 --- a/modules/phpfpm/manifests/config.pp +++ b/modules/phpfpm/manifests/config.pp @@ -1,4 +1,10 @@ - +/** + * + * Configures PHP5-FPM + * Creates a basic pool + * Loads all PHP extensions + * + */ class phpfpm::config { php5::ini { "fpm": diff --git a/modules/phpfpm/manifests/extension.pp b/modules/phpfpm/manifests/extension.pp index 346bd52..cc7c451 100644 --- a/modules/phpfpm/manifests/extension.pp +++ b/modules/phpfpm/manifests/extension.pp @@ -1,6 +1,12 @@ - +/** + * + * Definition for a PHP5 extension + * + */ define phpfpm::extension ( + $version, + ){ package { "${name}": diff --git a/modules/phpfpm/manifests/extensions/apc.pp b/modules/phpfpm/manifests/extensions/apc.pp index 6184d65..b008754 100644 --- a/modules/phpfpm/manifests/extensions/apc.pp +++ b/modules/phpfpm/manifests/extensions/apc.pp @@ -1,8 +1,14 @@ - +/** + * + * Installs and configures the APC extension for PHP5 + * + */ class phpfpm::extensions::apc ( + $enabled = 1, $shm_size = "128M", $rfc1867 = 1 + ){ phpfpm::extension { "php-apc": version => "3.1.7-1", } @@ -15,4 +21,5 @@ notify => [Class["phpfpm::service"], Class["nginx::service"]], content => template("phpfpm/extensions/apc.ini.erb") } + } \ No newline at end of file diff --git a/modules/phpfpm/manifests/extensions/curl.pp b/modules/phpfpm/manifests/extensions/curl.pp index c25fcab..38430cb 100644 --- a/modules/phpfpm/manifests/extensions/curl.pp +++ b/modules/phpfpm/manifests/extensions/curl.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures the CURL extension for PHP5 + * + */ class phpfpm::extensions::curl { phpfpm::extension { "php5-curl": version => "5.3.10-1ubuntu3.4", } diff --git a/modules/phpfpm/manifests/extensions/gd.pp b/modules/phpfpm/manifests/extensions/gd.pp index 2e9ea7c..364b0c5 100644 --- a/modules/phpfpm/manifests/extensions/gd.pp +++ b/modules/phpfpm/manifests/extensions/gd.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures the GD extension for PHP5 + * + */ class phpfpm::extensions::gd { phpfpm::extension { "php5-gd": version => "5.3.10-1ubuntu3.4", } diff --git a/modules/phpfpm/manifests/extensions/imap.pp b/modules/phpfpm/manifests/extensions/imap.pp index a827f94..1c8c317 100644 --- a/modules/phpfpm/manifests/extensions/imap.pp +++ b/modules/phpfpm/manifests/extensions/imap.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures the IMAP extension for PHP5 + * + */ class phpfpm::extensions::imap { phpfpm::extension { "php5-imap": version => "5.3.5-0ubuntu2", } diff --git a/modules/phpfpm/manifests/extensions/mcrypt.pp b/modules/phpfpm/manifests/extensions/mcrypt.pp index 4dafc4d..3ab5d5c 100644 --- a/modules/phpfpm/manifests/extensions/mcrypt.pp +++ b/modules/phpfpm/manifests/extensions/mcrypt.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures the mcrypt extension for PHP5 + * + */ class phpfpm::extensions::mcrypt { phpfpm::extension { "php5-mcrypt": version => "5.3.5-0ubuntu1", } diff --git a/modules/phpfpm/manifests/extensions/pear.pp b/modules/phpfpm/manifests/extensions/pear.pp index 4203c9f..506ad02 100644 --- a/modules/phpfpm/manifests/extensions/pear.pp +++ b/modules/phpfpm/manifests/extensions/pear.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures the PEAR extension for PHP5 + * + */ class phpfpm::extensions::pear { phpfpm::extension { "php-pear": version => "5.3.10-1ubuntu3.4", } diff --git a/modules/phpfpm/manifests/extensions/xdebug.pp b/modules/phpfpm/manifests/extensions/xdebug.pp index 1154ae4..66c5db7 100644 --- a/modules/phpfpm/manifests/extensions/xdebug.pp +++ b/modules/phpfpm/manifests/extensions/xdebug.pp @@ -1,5 +1,10 @@ - +/** + * + * Installs and configures the XDEBUG extension for PHP5 + * + */ class phpfpm::extensions::xdebug ( + $remote_enable = "On", $remote_host = "xdebug.kala", $remote_port = 9000, @@ -9,6 +14,7 @@ $collect_params = "On", $show_local_vars = "On", + ){ phpfpm::extension { "php5-xdebug": version => "2.1.0-1", } diff --git a/modules/phpfpm/manifests/init.pp b/modules/phpfpm/manifests/init.pp index 6ff59eb..69cd280 100644 --- a/modules/phpfpm/manifests/init.pp +++ b/modules/phpfpm/manifests/init.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures PHP5-FPM so that php5 works on nginx + * + */ class phpfpm { include phpfpm::install, phpfpm::config, phpfpm::service diff --git a/modules/phpfpm/manifests/install.pp b/modules/phpfpm/manifests/install.pp index 90ce10d..9e27515 100644 --- a/modules/phpfpm/manifests/install.pp +++ b/modules/phpfpm/manifests/install.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs PHP5-FPM and PHP5-CLI + * + */ class phpfpm::install { include php5 diff --git a/modules/phpfpm/manifests/nginx/kalabox.pp b/modules/phpfpm/manifests/nginx/kalabox.pp index 2aa499d..ddd5409 100644 --- a/modules/phpfpm/manifests/nginx/kalabox.pp +++ b/modules/phpfpm/manifests/nginx/kalabox.pp @@ -1,5 +1,11 @@ - +/** + * + * Defintion to set up a basic KALAMUNA splash screen + * @todo derecate in favor of dashboard + * + */ define phpfpm::nginx::kalabox ( + $vhost = $title, $root = "/var/www", $server_name = "_", @@ -7,6 +13,7 @@ $upstream = "unix:/tmp/php-fpm.sock", $custom = "", $options = {}, + ){ include nginx @@ -48,4 +55,5 @@ mode => 777, source => "puppet:///modules/phpfpm/kalamuna.jpg", } + } diff --git a/modules/phpfpm/manifests/nginx/vhost.pp b/modules/phpfpm/manifests/nginx/vhost.pp index c9698a5..c921d98 100644 --- a/modules/phpfpm/manifests/nginx/vhost.pp +++ b/modules/phpfpm/manifests/nginx/vhost.pp @@ -1,5 +1,10 @@ - +/** + * + * Definition to build a basic PHP5 vhost for nginx + * + */ define phpfpm::nginx::vhost ( + $vhost = $title, $root = "/var/www", $server_name = "_", @@ -7,6 +12,7 @@ $upstream = "unix:/tmp/php-fpm.sock", $custom = "", $options = {}, + ) { include nginx @@ -32,4 +38,5 @@ group => "www-data", mode => 755, } + } diff --git a/modules/phpfpm/manifests/service.pp b/modules/phpfpm/manifests/service.pp index 9aa2e93..6843bfb 100644 --- a/modules/phpfpm/manifests/service.pp +++ b/modules/phpfpm/manifests/service.pp @@ -1,4 +1,8 @@ - +/** + * + * Makes sure PHP5-FPM is running + * + */ class phpfpm::service { service { "php5-fpm": diff --git a/modules/phpmyadmin/manifests/config.pp b/modules/phpmyadmin/manifests/config.pp index 6192227..4a95b88 100644 --- a/modules/phpmyadmin/manifests/config.pp +++ b/modules/phpmyadmin/manifests/config.pp @@ -1,6 +1,11 @@ - +/** + * + * Configures PHPMYADMIN + * + */ class phpmyadmin::config { + # Makes a nginx vhost for phpmyadmin phpfpm::nginx::vhost { "phpmyadmin": vhost => "phpmyadmin", root => "/usr/share/phpmyadmin", @@ -11,12 +16,14 @@ options => {}, } + # Sets some basic vars for phpmyadmin $php_pass = $mysql::server::install::password $pma_db = "phpmyadmin" $pma_user = "root" $pma_pass = "password" $pma_server = "kala" + # Builds the phpmyadmin config DB exec { "phpmyadmindbconfig": path => "/bin:/usr/bin", command => "gunzip < /usr/share/doc/phpmyadmin/examples/create_tables.sql.gz | mysql -u${pma_user} -p${pma_pass} -h${pma_server}", @@ -26,12 +33,14 @@ ], } + # Adds the pma user exec { "phpmyadmincontrolconfig": path => "/bin:/usr/bin", command => "mysql -u${pma_user} -p${pma_pass} -h${pma_server} -e \"GRANT ALL PRIVILEGES ON ${pma_db}.* TO ${pma_user}@${pma_server} IDENTIFIED BY '${pma_pass}';\"", require => Exec["phpmyadmindbconfig"], } + # Provides a custom config file file{ "/etc/phpmyadmin/config.inc.php": path => "/etc/phpmyadmin/config.inc.php", ensure => present, @@ -42,6 +51,7 @@ require => Class[phpmyadmin::install], } + # Sets the above creds for the DB file{ "/etc/phpmyadmin/config-db.php": path => "/etc/phpmyadmin/config-db.php", ensure => present, diff --git a/modules/phpmyadmin/manifests/init.pp b/modules/phpmyadmin/manifests/init.pp index d6c1097..bdd5578 100644 --- a/modules/phpmyadmin/manifests/init.pp +++ b/modules/phpmyadmin/manifests/init.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures PHPMYDAMIN + * + */ class phpmyadmin { include phpmyadmin::install, phpmyadmin::config } \ No newline at end of file diff --git a/modules/phpmyadmin/manifests/install.pp b/modules/phpmyadmin/manifests/install.pp index 7f6a59b..0b3ad22 100644 --- a/modules/phpmyadmin/manifests/install.pp +++ b/modules/phpmyadmin/manifests/install.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs PHPMYADMIN + * + */ class phpmyadmin::install { package { "phpmyadmin" : ensure => "4:3.4.10.1-1", diff --git a/modules/puppet/manifests/config.pp b/modules/puppet/manifests/config.pp index 26d9730..0ff943e 100644 --- a/modules/puppet/manifests/config.pp +++ b/modules/puppet/manifests/config.pp @@ -1,4 +1,9 @@ - +/** + * + * Makes sure the puppet agent does not need to be re-run with the --server flag + * Sets up reporting + * + */ class puppet::config { $puppetserver = "kalabox.kalamuna.com" diff --git a/modules/puppet/manifests/init.pp b/modules/puppet/manifests/init.pp index 77013c8..5f4b36e 100644 --- a/modules/puppet/manifests/init.pp +++ b/modules/puppet/manifests/init.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configures the puppet agent + * + */ class puppet { include puppet::install, puppet::config, puppet::service } \ No newline at end of file diff --git a/modules/puppet/manifests/install.pp b/modules/puppet/manifests/install.pp index c53802c..877d00b 100644 --- a/modules/puppet/manifests/install.pp +++ b/modules/puppet/manifests/install.pp @@ -1,6 +1,12 @@ - +/** + * + * Installs the puppet agent + * + */ class puppet::install { + package { "puppet" : ensure => "2.7.11-1ubuntu2.1", } + } \ No newline at end of file diff --git a/modules/puppet/manifests/service.pp b/modules/puppet/manifests/service.pp index 177cb6c..cf53690 100644 --- a/modules/puppet/manifests/service.pp +++ b/modules/puppet/manifests/service.pp @@ -1,4 +1,8 @@ - +/** + * + * Makes sure the agent is running + * + */ class puppet::service { service { "puppet": ensure => running, diff --git a/modules/samba/manifests/config.pp b/modules/samba/manifests/config.pp index 65982f7..223b9a1 100644 --- a/modules/samba/manifests/config.pp +++ b/modules/samba/manifests/config.pp @@ -1,4 +1,8 @@ - +/** + * + * Configures samba and shares /var/www + * + */ class samba::config { file { "/etc/samba/smb.conf" : diff --git a/modules/samba/manifests/init.pp b/modules/samba/manifests/init.pp index 2dcf4c9..648a2d6 100644 --- a/modules/samba/manifests/init.pp +++ b/modules/samba/manifests/init.pp @@ -1,4 +1,10 @@ - +/** + * + * Installs and configures samba + * + */ class samba { + include samba::install, samba::config, samba::service + } \ No newline at end of file diff --git a/modules/samba/manifests/install.pp b/modules/samba/manifests/install.pp index 8f67fa7..39932ea 100644 --- a/modules/samba/manifests/install.pp +++ b/modules/samba/manifests/install.pp @@ -1,6 +1,12 @@ - +/** + * + * Installs samba + * + */ class samba::install { + package { "samba" : ensure => "2:3.6.3-2ubuntu2.3", } + } \ No newline at end of file diff --git a/modules/samba/manifests/service.pp b/modules/samba/manifests/service.pp index f018a7c..e86e969 100644 --- a/modules/samba/manifests/service.pp +++ b/modules/samba/manifests/service.pp @@ -1,5 +1,10 @@ - +/** + * + * Makes sure the file server is running + * + */ class samba::service { + service { "samba": name => "smbd", ensure => running, @@ -8,4 +13,5 @@ enable => true, require => Class["samba::install"], } + } \ No newline at end of file diff --git a/modules/solr/manifests/init.pp b/modules/solr/manifests/init.pp index 383e511..a200ffe 100644 --- a/modules/solr/manifests/init.pp +++ b/modules/solr/manifests/init.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs and configurs SOLR to run inside of TOMCAT6 + * + */ class solr { include solr::params, solr::install, solr::service } \ No newline at end of file diff --git a/modules/solr/manifests/install.pp b/modules/solr/manifests/install.pp index a8b188b..885b116 100644 --- a/modules/solr/manifests/install.pp +++ b/modules/solr/manifests/install.pp @@ -1,4 +1,8 @@ - +/** + * + * Installs solr and tomcat + * + */ class solr::install { package { "solr-tomcat": ensure => "1.4.1+dfsg1-2ubuntu2", diff --git a/modules/solr/manifests/params.pp b/modules/solr/manifests/params.pp index 5475512..f1816ef 100644 --- a/modules/solr/manifests/params.pp +++ b/modules/solr/manifests/params.pp @@ -1,4 +1,8 @@ - +/** + * + * Sets the tomcat versions + * + */ class solr::params { $tomcat = "tomcat6" } diff --git a/modules/solr/manifests/service.pp b/modules/solr/manifests/service.pp index b5d6ea8..16808ff 100644 --- a/modules/solr/manifests/service.pp +++ b/modules/solr/manifests/service.pp @@ -1,3 +1,8 @@ +/** + * + * Makes sure tomcat is running + * + */ class solr::service { service { $solr::params::tomcat: ensure => running, diff --git a/modules/ssh/manifests/client.pp b/modules/ssh/manifests/client.pp index 88f14e5..608bf2b 100644 --- a/modules/ssh/manifests/client.pp +++ b/modules/ssh/manifests/client.pp @@ -1,3 +1,11 @@ +/** + * + * Installs the SSH client + * + */ class ssh::client { + include ssh::client::install + } + diff --git a/modules/ssh/manifests/client/install.pp b/modules/ssh/manifests/client/install.pp index ab892c1..715396d 100644 --- a/modules/ssh/manifests/client/install.pp +++ b/modules/ssh/manifests/client/install.pp @@ -1,5 +1,12 @@ +/** + * + * Installs the SSH client + * + */ class ssh::client::install { + package { "openssh-client": ensure => "1:5.9p1-5ubuntu1", } } + diff --git a/modules/ssh/manifests/init.pp b/modules/ssh/manifests/init.pp index e89da5e..bc3f1e5 100644 --- a/modules/ssh/manifests/init.pp +++ b/modules/ssh/manifests/init.pp @@ -1,4 +1,11 @@ +/** + * + * Installs and configures both the SSH server and client + * + */ class ssh { + include ssh::server include ssh::client + } diff --git a/modules/ssh/manifests/server.pp b/modules/ssh/manifests/server.pp index ddb99ed..ddff562 100644 --- a/modules/ssh/manifests/server.pp +++ b/modules/ssh/manifests/server.pp @@ -1,4 +1,11 @@ +/** + * + * Installs and configures the SSH server + * + */ class ssh::server { + include ssh::server::install include ssh::server::service + } diff --git a/modules/ssh/manifests/server/install.pp b/modules/ssh/manifests/server/install.pp index 5ab2431..bcbb812 100644 --- a/modules/ssh/manifests/server/install.pp +++ b/modules/ssh/manifests/server/install.pp @@ -1,5 +1,12 @@ +/** + * + * Installs the SSH server + * + */ class ssh::server::install { + package { "openssh-server": ensure => "1:5.9p1-5ubuntu1", } + } diff --git a/modules/ssh/manifests/server/service.pp b/modules/ssh/manifests/server/service.pp index c8f7539..b6772d6 100644 --- a/modules/ssh/manifests/server/service.pp +++ b/modules/ssh/manifests/server/service.pp @@ -1,4 +1,10 @@ +/** + * + * Makes sure the SSH server is running + * + */ class ssh::server::service { + service { "ssh": ensure => running, hasstatus => true, @@ -6,4 +12,5 @@ enable => true, require => Class["ssh::server::install"], } + }