This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding vagrant and puppet for development server provisioning
- Loading branch information
Martin Moscosa
committed
Apr 14, 2012
1 parent
f2eb94a
commit 3137cac
Showing
21 changed files
with
2,807 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ nbproject/ | |
*.kpf | ||
.idea | ||
src/inc/img/event_icons/ | ||
.DS_Store | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "modules/apache"] | ||
path = modules/apache | ||
url = https://github.com/example42/puppet-apache | ||
[submodule "modules/puppi"] | ||
path = modules/puppi | ||
url = https://github.com/example42/puppi | ||
[submodule "modules/puppet-mysql"] | ||
path = modules/puppet-mysql | ||
url = https://github.com/example42/puppet-mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant::Config.run do |config| | ||
config.vm.box = 'puppet-centos-56-64' | ||
#config.vm.box_url = 'http://dl.dropbox.com/u/1627760/centos-6.0-x86_64.box' | ||
|
||
# Forward a port from the guest to the host, which allows for outside | ||
# computers to access the VM, whereas host only networking does not. | ||
config.vm.forward_port 80, 8080 | ||
|
||
# Share an additional folder to the guest VM. The first argument is | ||
# an identifier, the second is the path on the guest to mount the | ||
# folder, and the third is the path on the host to the actual folder. | ||
# config.vm.share_folder "v-data", "/vagrant_data", "../data" | ||
|
||
config.vm.provision :puppet do |puppet| | ||
puppet.manifests_path = "manifests" | ||
puppet.module_path = "modules" | ||
puppet.manifest_file = "vagrant.pp" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
node default { | ||
include apache | ||
include puppi | ||
include mysql | ||
include php | ||
include something::db | ||
} | ||
|
||
|
||
define mysqldb( $user, $password ) { | ||
exec { "create-${name}-db": | ||
unless => "/usr/bin/mysql -u${user} -p${password} ${name}", | ||
command => "/usr/bin/mysql -uroot -p$mysql_password -e \"create database ${name}; grant all on ${name}.* to ${user}@localhost identified by '$password';\"", | ||
require => Service["mysqld"], | ||
} | ||
} | ||
|
||
Exec { | ||
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] | ||
} | ||
|
||
class { "apache": } | ||
php::module { mysql: } | ||
|
||
apache::vhost{ 'dev.joind.in': | ||
docroot => '/vagrant/src', | ||
template => '/vagrant/templates/virtualhost/vhost.conf.erb', | ||
} | ||
|
||
class something::db { | ||
mysqldb { "joindin": | ||
user => 'joindin', | ||
password => 'password', | ||
} | ||
} | ||
|
||
exec { 'patch-db': | ||
command => "/vagrant/src/scripts/patchdb.sh -t /vagrant -d joindin -u joindin -p password -i", | ||
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] | ||
} | ||
|
||
file { 'database-config': | ||
path => '/vagrant/src/system/application/config/database.php', | ||
source => '/vagrant/templates/database.php.erb', | ||
} | ||
file { 'application-config': | ||
path => '/vagrant/src/system/application/config/config.php', | ||
source => '/vagrant/templates/config.php.erb', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Puppet module: php | ||
|
||
# Written by Lab42 # | ||
# http://www.example42.com | ||
|
||
Licence: Apache2 | ||
|
||
|
||
DESCRIPTION: | ||
This module installs php and provides custom defines to manage php modules, pear components and pecl extensions | ||
|
||
USAGE: | ||
include php # Installs php | ||
include php::pear # Installs pear support | ||
include php::dev # Installs php-dev | ||
#TODO include php::absent # Remove php package. | ||
|
||
php::module { mysql: } # Installs specific module for php | ||
|
||
php::pear::module { Crypt-CHAP: } # Installs pear component using OS package | ||
php::pear::module { "XML_Serializer": use_package => "no", preferred_state => "beta" } # Installs pear component with pear command | ||
php::pear::config { "http_proxy": value => "$proxy_server" } # Configures pear environment | ||
|
||
php::pecl::module { "xslcache": } # Installs pecl module using OS package | ||
php::pecl::module { "xslcache": use_package => "no", preferred_state => "beta" } # Installs pecl module with pecl command | ||
php::pecl::config { "http_proxy": value => "$proxy_server" } # Configures pecl environment | ||
|
Oops, something went wrong.