Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 class rietveld($domain) inherits private::rietveld { | |
2 | |
3 include nginx | |
4 | |
5 nginx::hostconfig {$domain: | |
6 content => template('rietveld/site.erb'), | |
7 enabled => true | |
8 } | |
9 | |
10 package {['python-django', 'make', 'patch', 'gunicorn']: ensure => present} | |
11 | |
12 user {'rietveld': | |
13 ensure => present, | |
14 comment => 'User of the rietveld installation', | |
15 home => '/home/rietveld', | |
16 managehome => true | |
17 } | |
18 | |
19 exec { "get_rietveld": | |
Felix Dahlke
2014/02/07 15:27:36
No space after {, and ' instead of ". Likewise bel
christian
2014/02/07 17:17:21
Done.
| |
20 command => "hg clone https://code.google.com/p/django-gae2django/ /home/riet veld/django-gae2django/", | |
Felix Dahlke
2014/02/07 15:27:36
' instead of ", likewise various times below. Acco
christian
2014/02/07 17:17:21
Done.
| |
21 require => Package['mercurial'], | |
22 user => rietveld, | |
23 onlyif => "test ! -d /home/rietveld/django-gae2django", | |
Felix Dahlke
2014/02/07 15:27:36
This path (/home/rietveld/django-gae2django) is be
christian
2014/02/07 17:17:21
Done.
| |
24 path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin", | |
Felix Dahlke
2014/02/07 15:27:36
This is repeated below, you can have this above in
christian
2014/02/07 17:17:21
Done.
| |
25 #refreshonly => true, | |
Felix Dahlke
2014/02/07 15:27:36
Let's remove this if we don't need it. Likewise be
christian
2014/02/07 17:17:21
Done.
| |
26 } | |
27 | |
28 file {'/home/rietveld/django-gae2django/examples/rietveld/Makefile': | |
Felix Dahlke
2014/02/07 15:27:36
This path (/home/rietveld/django-gae2django/exampl
christian
2014/02/07 17:17:21
Done.
| |
29 ensure => file, | |
30 owner => rietveld, | |
31 require => Exec['get_rietveld'], | |
32 source => 'puppet:///modules/rietveld/Makefile', | |
33 } | |
34 | |
35 file {'/home/rietveld/django-gae2django/examples/rietveld/settings.py': | |
36 ensure => file, | |
37 owner => rietveld, | |
38 require => Exec['get_rietveld'], | |
39 source => 'puppet:///modules/rietveld/settings.py', | |
40 } | |
41 | |
42 exec { "install_rietveld": | |
43 command => "make all", | |
Felix Dahlke
2014/02/07 15:27:36
"all" is not necessary
christian
2014/02/07 17:17:21
Actual it is,see Makefile
default:
@echo "Run 'm
Felix Dahlke
2014/02/07 20:09:45
Ah. Well that's peculiar :)
| |
44 cwd => "/home/rietveld/django-gae2django/examples/rietveld", | |
45 user => rietveld, | |
46 require => [ | |
47 File['/home/rietveld/django-gae2django/examples/rietveld/Makefile'], | |
Felix Dahlke
2014/02/07 15:27:36
Should be indented just one level deeper than the
christian
2014/02/07 17:17:21
Done.
| |
48 File['/home/rietveld/django-gae2django/examples/rietveld/settings.py']], | |
49 onlyif => "test ! -f /home/rietveld/django-gae2django/examples/rietveld/dev. db", | |
50 path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin", | |
51 #refreshonly => true, | |
52 } | |
53 | |
54 file {'/etc/init/rietveld.conf': | |
55 ensure => file, | |
56 owner => root, | |
57 source => 'puppet:///modules/rietveld/rietveld.conf', | |
58 notify => Service['rietveld'], | |
59 } | |
60 | |
61 #work around puppets limitation towards upstart | |
Felix Dahlke
2014/02/07 15:27:36
This is not really clear, what particular limitati
christian
2014/02/07 17:17:21
It is simple, puppet is not aware of upstart so it
Felix Dahlke
2014/02/07 20:09:45
If Puppet can't do Upstart at all, I don't think t
christian
2014/02/12 14:14:26
Done.
| |
62 file { '/etc/init.d/rietveld': | |
63 ensure => link, | |
64 target => '/lib/init/upstart-job', | |
65 require => File['/etc/init/rietveld.conf'] | |
Felix Dahlke
2014/02/07 15:27:36
Shouldn't this require Exec['install_rietveld']? N
christian
2014/02/07 17:17:21
This only makes the symlink, the service it self n
Felix Dahlke
2014/02/07 20:09:45
Well, I think /etc/init.d/rietveld logically depen
christian
2014/02/12 14:14:26
Done.
| |
66 } | |
67 | |
68 service {'rietveld': | |
69 ensure => running, | |
70 hasstatus => false, | |
71 require => [Package['gunicorn'], File['/etc/init.d/rietveld'], Exec['install _rietveld']] | |
72 } | |
73 | |
74 exec { "set_superuser": | |
75 command => "echo \"from django.db import DEFAULT_DB_ALIAS as database; from django.contrib.auth.models import User; User.objects.db_manager(database).create _superuser('rietveld', 'rietveld@example.org', '${admin_password}')\" | ./manage .py shell", | |
Felix Dahlke
2014/02/07 15:27:36
I suppose it's fine to just have a single admin ac
christian
2014/02/07 17:17:21
I found it easier to just make this one account an
Felix Dahlke
2014/02/07 20:09:45
Ah, I see. Yeah sure, we only need to create the a
| |
76 cwd => "/home/rietveld/django-gae2django/examples/rietveld", | |
77 require => Exec['install_rietveld'], | |
78 path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin", | |
79 #refreshonly => true, | |
80 } | |
81 } | |
OLD | NEW |