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

Unified Diff: modules/roundup/manifests/init.pp

Issue 4553114493386752: Initial configuration for issues.adblockplus.org (Closed)
Patch Set: Add to monitoring, rename to issues1 consistently, remove trailing ? Created Jan. 22, 2014, 2:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/private-stub/manifests/roundup.pp ('k') | modules/roundup/templates/config.ini.erb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/roundup/manifests/init.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/roundup/manifests/init.pp
@@ -0,0 +1,67 @@
+class roundup($tracker_name, $domain) inherits private::roundup {
+ package {['roundup', 'python-mysqldb']: ensure => present}
+
+ include nginx
+
+ nginx::hostconfig {$domain:
+ content => template('roundup/site.erb'),
+ enabled => true
+ }
+
+ class {'mysql::server':
+ config_hash => {'root_password' => $database_root_password}
+ }
+
+ mysql::db {'roundup':
+ user => 'roundup',
+ password => $database_password,
+ host => 'localhost',
+ grant => ['all'],
+ require => Class['mysql::config']
+ }
+
+ file {'/etc/roundup/roundup-server.ini':
+ ensure => present,
+ content => template('roundup/roundup-server.ini.erb'),
+ require => Package['roundup'],
+ notify => Service['roundup']
+ }
+
+ $tracker_home = "/var/lib/roundup/trackers/${tracker_name}"
+
+ Exec {
+ path => ['/bin', '/usr/bin'],
+ }
+
+ exec {'install':
+ command => "roundup-admin -i ${tracker_home} install classic mysql",
+ onlyif => "test ! -d ${tracker_home}",
+ require => Package['roundup', 'python-mysqldb']
+ }
+
+ file {"${tracker_home}/config.ini":
+ ensure => present,
+ content => template('roundup/config.ini.erb'),
+ require => Exec['install'],
+ notify => Service['roundup']
+ }
+
+ service {'roundup':
+ ensure => running,
+ hasstatus => false
+ }
+
+ $db_path = "${tracker_home}/db"
+
+ exec {'initialise':
+ command => "bash -c 'echo y | roundup-admin -i ${tracker_home} initialise ${admin_password}'",
+ onlyif => "test ! -d ${db_path}/lock",
+ require => [Package['roundup'], Mysql::Db['roundup']],
+ notify => File[$db_path]
+ }
+
+ file {$db_path:
+ owner => 'roundup',
+ notify => Service['roundup']
+ }
+}
« no previous file with comments | « modules/private-stub/manifests/roundup.pp ('k') | modules/roundup/templates/config.ini.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld