Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/trac/manifests/init.pp

Issue 5777328449781760: Concept for Trac as issue tracker. (Closed)
Patch Set: Created Feb. 25, 2014, 8:22 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 class trac($domain) inherits private::trac {
2 package {['python-mysqldb','python-setuptools','subversion']: ensure => presen t}
Wladimir Palant 2014/03/03 08:44:31 Style nit: Could you please put |ensure => present
3
4 include nginx
5
6 nginx::hostconfig {$domain:
7 content => template('trac/site.erb'),
8 enabled => true
9 }
10
11 user {'trac':
12 ensure => present,
13 comment => 'User of the trac installation',
14 home => '/home/trac',
15 managehome => true
16 }
17
18 class {'mysql::server':
19 config_hash => {'root_password' => $database_root_password}
20 }
21
22 mysql::db {'trac':
23 user => 'trac',
24 password => $database_password,
25 host => 'localhost',
26 grant => ['all'],
27 require => Class['mysql::config']
28 }
29
30 Exec {
31 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
32 }
33
34 exec { 'collate':
35 command => "echo \"ALTER DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE ut f8_bin;\" | mysql -u trac -p${database_password}",
36 require => Mysql::Db['trac']
Wladimir Palant 2014/03/03 08:44:31 Please add charset => 'utf8 COLLATE utf8_bin' to t
37 }
38
39 exec { 'install_trac':
40 command => "easy_install Trac==1.0",
Wladimir Palant 2014/03/03 08:44:31 We might want to use the python-pip package and |p
41 require => [
42 Package['python-mysqldb', 'python-setuptools'],
43 Exec['collate']],
44 unless => "which tracd"
Wladimir Palant 2014/03/03 08:44:31 We might prefer something like "python -c 'import
45 }
46
47 exec { 'trac_env':
48 command => "trac-admin /home/trac/environment initenv \"Adblock Plus issue t racker\" mysql://trac:${database_password}@localhost:3306/trac",
49 require => Exec['install_trac'],
50 user => trac,
51 onlyif => "test ! -d /home/trac/environment"
52 }
53
54
55 exec { 'install_BlackMagicTicketTweaks':
56 command => "easy_install http://trac-hacks.org/svn/blackmagictickettweaksplu gin/0.12/",
57 require => [
58 Package['subversion'],
59 Exec['trac_env']]
Wladimir Palant 2014/03/03 08:44:31 This doesn't really depend on the trac enviroment,
60 }
61
62 exec { 'install_SensitiveTickets':
63 command => "easy_install http://trac-hacks.org/svn/sensitiveticketsplugin/tr unk/",
64 require => [
65 Package['subversion'],
66 Exec['trac_env']]
67 }
68
69 exec { 'install_AccountManager':
70 command => "easy_install http://trac-hacks.org/svn/accountmanagerplugin/tags /acct_mgr-0.4.3/",
71 require => [
72 Package['subversion'],
73 Exec['trac_env']]
74 }
75
76
77 exec { 'install_TicketTemplate':
78 command => "easy_install http://trac-hacks.org/svn/tractickettemplateplugin/ 0.11/",
79 require => [
80 Package['subversion'],
81 Exec['trac_env']]
82 }
83
84
85 exec { 'install_AutocompleteUsers':
86 command => "easy_install http://trac-hacks.org/svn/autocompleteusersplugin/t runk/",
87 require => [
88 Package['subversion'],
89 Exec['trac_env']]
90 }
91
92 file {"/home/trac/environment/conf/trac.ini":
93 ensure => present,
94 content => template('trac/trac.ini.erb'),
95 require => Exec['trac_env']
96 }
97
98 file {"/home/trac/environment/htdocs/adblockplus_logo.png":
99 ensure => present,
100 source => 'puppet:///modules/trac/adblockplus_logo.png',
101 require => Exec['trac_env']
102 }
103
104 exec {"tracd":
105 command => "tracd --port 8088 -d -s /home/trac/environment",
Wladimir Palant 2014/03/03 08:44:31 This needs to run as a service, otherwise it won't
106 require => [
107 Exec['install_SensitiveTickets'],
108 Exec['install_BlackMagicTicketTweaks'],
109 Exec['install_AccountManager'],
110 Exec['install_AutocompleteUsers'],
111 Exec['install_TicketTemplate']]
112 }
113
114 exec {"update_env":
115 command => "trac-admin /home/trac/environment upgrade",
Wladimir Palant 2014/03/03 08:44:31 Shouldn't we rather initialize the environment onl
Philip Hill 2014/03/06 14:50:20 As far as I unterstood, installing Plugins require
116 require => [
117 Exec['install_SensitiveTickets'],
118 Exec['install_BlackMagicTicketTweaks'],
119 Exec['install_AccountManager'],
120 Exec['install_AutocompleteUsers'],
121 Exec['install_TicketTemplate']]
122 }
123
124 file {"/home/trac/permissions.csv":
125 ensure => present,
126 source => 'puppet:///modules/trac/permissions.csv',
127 require => Exec['trac_env']
128 }
129
130 exec { "set_permission_groups":
131 command => "trac-admin /home/trac/environment permission import /home/trac/p ermissions.csv",
Wladimir Palant 2014/03/03 08:44:31 I don't think that we want to run that every time
132 require => [
133 Exec['trac_env'],
134 File['/home/trac/environment/conf/trac.ini']]
135 }
136
137 }
OLDNEW

Powered by Google App Engine
This is Rietveld