Skip to content

Commit

Permalink
Changes for Edison Nation stack
Browse files Browse the repository at this point in the history
* MySQL with our own my.cnf
* Internal DNS
* New iptables roles
* Assets servery
  • Loading branch information
root committed May 16, 2012
1 parent a44bbda commit 30e6665
Show file tree
Hide file tree
Showing 14 changed files with 1,324 additions and 60 deletions.
1 change: 1 addition & 0 deletions manifests/modules.pp
Expand Up @@ -7,3 +7,4 @@
import "postgresql"
import "nginx"
import "god"
import "dnsmasq"
90 changes: 58 additions & 32 deletions manifests/nodes.pp
@@ -1,5 +1,18 @@
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }

node 'en-puppet' {
class { "dnsmasq":
hosts => [
{ hostname => "puppet.edisonnation.com", ip => "10.176.71.36" },
{ hostname => "assets.staging.edisonnation.com", ip => "10.183.173.231" },
{ hostname => "cache.staging.edisonnation.com", ip => "10.183.173.12" },
{ hostname => "jobs.staging.edisonnation.com", ip => "10.183.170.224" },
{ hostname => "app.staging.edisonnation.com", ip => "10.183.173.128" },
{ hostname => "db.staging.edisonnation.com", ip => "10.183.169.227"},
],
}
}

node basenode {
include "apt"
include "backports"
Expand Down Expand Up @@ -29,10 +42,6 @@
}
}

node 'ruby-187-web' inherits 'ruby-187' {
iptables::role { "web-server": }
}

node 'ruby-193' inherits basenode {
rvm_system_ruby {
'1.9.3-p125':
Expand All @@ -50,8 +59,8 @@
iptables::role { "web-server": }
}


node 'en-copycopter' inherits 'ruby-193-web' {
$rails_environment = 'development'
include 'postgresql::v9-1'
postgresql::user { 'www': superuser => true, ensure => present, }
rvm_gemset {
Expand All @@ -60,17 +69,10 @@
require => Rvm_system_ruby['1.9.3-p125'],
}
nginx::unicorn_site { 'copycopter': }
class { "god":
rails_environment => "development",
role => "all",
ruby => "1.9.3-p125",
gemset => "copycopter",
ruby_type => "ruby",
project => "copycopter",
}
include copycopter_god_wrapper
}

node 'en-tesla' inherits 'ruby-187-web' {
node 'en-tesla' inherits 'ruby-187' {
rvm_gemset {
"ruby-1.8.7-p358@tesla":
ensure => present,
Expand All @@ -82,6 +84,14 @@
group => "www",
mode => 750,
}
package {"imagemagick": ensure => installed }
package {"libmysqlclient-dev": ensure => installed }
package {"libmagick9-dev": ensure => installed }
rvm_gem {
'ruby-1.8.7-p358@tesla/unicorn':
ensure => latest,
require => Rvm_system_ruby['1.8.7-p358'],
}
}

node 'en-tesla-ci' inherits 'en-tesla' {
Expand All @@ -94,34 +104,50 @@

node 'en-db' inherits 'en-tesla' {
include mysql::server
iptables::role { "db-server": }
}

node 'en-staging-db' inherits 'en-db' { }
node 'en-staging-jobs' inherits 'en-tesla' { }

node 'en-app' inherits 'en-tesla' {
nginx::unicorn_site { 'edisonnation.com': }
package {"imagemagick": ensure => installed }
package {"libmysqlclient-dev": ensure => installed }
package {"libmagick9-dev": ensure => installed }
class { "god":
rails_environment => "experimental",
node 'en-staging-app' inherits 'en-tesla' {
$rails_environment = 'staging'
include tesla_god_wrapper
$assethost = '173.45.227.152'
include tesla_unicorn_wrapper
iptables::role { "web-server": }
}

node 'en-staging-cache' inherits 'en-tesla' {
class {"memcached": memory => '128'}
}

node 'en-staging-assets' inherits 'en-tesla' {
$rails_environment = 'staging'
nginx::assets_site { 'edisonnation.com': }
include tesla_god_wrapper
}

class tesla_god_wrapper {
class { "god":
role => "app-server",
ruby => "1.8.7-p358",
gemset => "tesla",
ruby_type => "ruby",
project => "edisonnation.com",
}
rvm_gem {
'ruby-1.8.7-p358@tesla/unicorn':
ensure => latest,
require => Rvm_system_ruby['1.8.7-p358'],
}
}
}

node 'en-staging-app' inherits 'en-app' { }

node 'en-cache' inherits 'en-tesla' {
memcached::server {'edisonnation.com': memory => "128", }
class tesla_unicorn_wrapper {
nginx::unicorn_site { 'edisonnation.com': }
}

node 'en-staging-cache' inherits 'en-cache' {}
class copycopter_god_wrapper {
class { "god":
role => "all",
ruby => "1.9.3-p125",
gemset => "copycopter",
ruby_type => "ruby",
project => "copycopter",
}
}
17 changes: 17 additions & 0 deletions modules/dnsmasq/manifests/init.pp
@@ -0,0 +1,17 @@
class dnsmasq($hosts=[]) {
$hostnames = $hosts

package { "dnsmasq": ensure => installed }
service { "dnsmasq":
enable => true,
ensure => running,
require => Package["dnsmasq"],
subscribe => File["/etc/dnsmasq.conf"],
}

file {"/etc/dnsmasq.conf":
content => template("dnsmasq/dnsmasq.conf.erb"),
require => Package["dnsmasq"],
}

}
11 changes: 11 additions & 0 deletions modules/dnsmasq/manifests/init.pp~
@@ -0,0 +1,11 @@
class dnsmasq($hosts=[]) {
$hostnames = $hosts

package { "dnsmasq": ensure => installed }
service { "dnsmasq":
enable => true,
ensure => running,
require => Package["dnsmasq"]
}

}

0 comments on commit 30e6665

Please sign in to comment.