space, → | next slide |
← | previous slide |
d | debug mode |
## <ret> | go to slide # |
c | table of contents (vi) |
f | toggle footer |
r | reload slides |
z | toggle help (this) |
apt-get install puppet
or
gem install puppet
You really want 2.6 or better.
package { "nginx":
ensure => "0.7.67-3ubuntu1",
}
package {
"mysql2":
ensure => "0.2.6",
provider => gem;
"rails":
ensure => "3.0.1",
provider => gem;
}
package {
"mysql2":
ensure => "0.2.6",
provider => gem;
}
libmysqlclient-dev
package which is needed to build mysql2
gem.package {
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql2":
ensure => "0.2.6",
provider => gem;
}
package {
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql2":
ensure => "0.2.6",
provider => gem;
}
package {
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql2":
ensure => "0.2.6",
provider => gem,
require =>
Package["libmysqlclient-dev"];
}
(master) rcrowley@wd-40:~/work/example$ ls -al
total 44
drwxr-xr-x 5 rcrowley rcrowley 4096 Sep 29 23:02 .
drwxr-xr-x 3 rcrowley rcrowley 4096 Sep 29 22:42 ..
drwxr-xr-x 7 rcrowley rcrowley 4096 Sep 29 22:42 .git
-rw-r--r-- 1 rcrowley rcrowley 6 Sep 29 22:59 .gitignore
-rw-r--r-- 1 rcrowley rcrowley 1672 Sep 29 23:00 Capfile
-rw-r--r-- 1 rcrowley rcrowley 2986 Sep 29 23:02 app.rb
-rw-r--r-- 1 rcrowley rcrowley 179 Sep 29 23:01 config.ru
-rw-r--r-- 1 rcrowley rcrowley 38 Sep 29 22:58 deps.pp
drwxr-xr-x 2 rcrowley rcrowley 4096 Sep 29 23:01 public
-rw-r--r-- 1 rcrowley rcrowley 798 Sep 29 23:01 unicorn.conf.rb
drwxr-xr-x 2 rcrowley rcrowley 4096 Sep 29 23:01 views
(master) rcrowley@wd-40:~/work/example$
stage { "pre": before => Stage["main"] }
class pre {
package {
"build-essential": ensure => latest;
"ruby": ensure => "4.5"; # Ruby 1.8.7
"ruby-dev": ensure => "4.5"; # Ruby 1.8.7
"rubygems": ensure => "1.3.7-2";
}
}
class { "pre": stage => "pre" }
deps.pp
# Ruby and RubyGems from before goes here.
package {
"json":
ensure => "1.4.6",
provider => gem;
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql2":
ensure => "0.2.6",
provider => gem,
require => Package["libmysqlclient-dev"];
"nginx":
ensure => "0.7.67-3ubuntu1";
"sinatra":
ensure => "1.1.0",
provider => gem;
}
deps.pp
, continuedfile {
"/etc/nginx/sites-available/example":
content => "
server {
listen 80;
root /var/www/example;
}
",
ensure => file;
"/etc/nginx/sites-enabled/example":
ensure => "/etc/nginx/sites-available/example";
"/var/www/example":
ensure => directory;
}
sudo puppet apply deps.pp
Bring a new server up to speed.