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 build-essential \
ruby ruby-dev rubygems
gem install puppet puppet-pip
package { "nginx":
ensure => "0.7.67-3ubuntu1",
}
package {
"mysql-python":
ensure => "1.2.3",
provider => pip;
"django":
ensure => "1.2.3",
provider => pip;
}
package {
"mysql-python":
ensure => "1.2.3",
provider => pip;
}
libmysqlclient-dev
package which is needed to build mysql-python
package.package {
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql-python":
ensure => "1.2.3",
provider => pip;
}
package {
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql-python":
ensure => "1.2.3",
provider => pip;
}
package {
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql-python":
ensure => "1.2.3",
provider => pip,
require =>
Package["libmysqlclient-dev"];
}
(master) rcrowley@wd-40:~/work/example$ ls -l
total 20
-rw-r--r-- 1 rcrowley rcrowley 0 Nov 9 01:36 __init__.py
-rw-r--r-- 1 rcrowley rcrowley 2700 Nov 9 01:40 deps.pp
-rw-r--r-- 1 rcrowley rcrowley 79 Nov 9 01:37 fabfile.py
-rw-r--r-- 1 rcrowley rcrowley 546 Nov 9 01:36 manage.py
-rw-r--r-- 1 rcrowley rcrowley 3388 Nov 9 01:36 settings.py
-rw-r--r-- 1 rcrowley rcrowley 484 Nov 9 01:36 urls.py
(master) rcrowley@wd-40:~/work/example$
pip
stage { "pre": before => Stage["main"] }
class pre {
package {
"build-essential": ensure => latest;
"python": ensure => "";
"python-dev": ensure => "";
"python-setuptools": ensure => "";
}
exec { "easy_install pip":
path => "/usr/local/bin:/usr/bin:/bin",
refreshonly => true,
require => Package["python-setuptools"],
subscribe => Package["python-setuptools"],
}
}
class { "pre": stage => "pre" }
deps.pp
# Python and pip from before goes here.
package {
"django":
ensure => "1.2.3",
provider => pip;
"libmysqlclient-dev":
ensure => "5.1.49-1ubuntu8";
"mysql-python":
ensure => "1.2.3",
provider => pip,
require => Package["libmysqlclient-dev"];
"nginx":
ensure => "0.7.67-3ubuntu1";
}
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;
}
# As root!
export GEMS="/usr/lib/ruby/gems/1.8/gems"
export RUBYLIB=$GEMS/"puppet-pip-0.0.1/lib"
puppet apply deps.pp