Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/281493
Change subject: Provision fundraising-tools repo
......................................................................
Provision fundraising-tools repo
Clone and provision the Silverpop export script, for this first iteration.
TODO:
* Requires I62439f585e5eb05be62c1092caa63cc6ac7b71ed
* Wrapper for PYTHONPATH=/vagrant/srv/fundraising-tools
* Other tool config files
Change-Id: I2383a7793414a6ef437ad9bd7e66e0b39cdb1d27
---
M puppet/hieradata/common.yaml
M puppet/modules/crm/manifests/init.pp
A puppet/modules/crm/manifests/tools.pp
A puppet/modules/crm/templates/silverpop_export.yaml.erb
4 files changed, 87 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
refs/changes/93/281493/1
diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 8a79303..23a617d 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -76,6 +76,8 @@
crm::drupal::dir: "%{hiera('crm::dir')}/drupal"
crm::drupal::files_dir:
"%{hiera('mwv::files_dir')}/org.wikimedia.civicrm-files"
+crm::tools::dir: "%{hiera('mwv::services_dir')}/fundraising-tools"
+
hhvm::common_settings:
date:
timezone: UTC
diff --git a/puppet/modules/crm/manifests/init.pp
b/puppet/modules/crm/manifests/init.pp
index 6d7bfb4..c79ed8b 100644
--- a/puppet/modules/crm/manifests/init.pp
+++ b/puppet/modules/crm/manifests/init.pp
@@ -37,6 +37,7 @@
include ::postfix
include ::crm::apache
include ::crm::civicrm
+ include ::crm::tools
git::clone { $repo:
directory => $dir,
diff --git a/puppet/modules/crm/manifests/tools.pp
b/puppet/modules/crm/manifests/tools.pp
new file mode 100644
index 0000000..37b36ed
--- /dev/null
+++ b/puppet/modules/crm/manifests/tools.pp
@@ -0,0 +1,50 @@
+# == Class: crm::tools
+#
+# Miscellaneous tools written in Python.
+#
+# === Parameters
+#
+# [*dir*]
+# Installation directory.
+#
+class crm::tools(
+ $dir,
+) {
+ $db_url =
"mysql://${::crm::db_user}:${::crm::db_pass}@localhost/${::crm::drupal_db}"
+
+ $audit_base = '/var/spool/audit'
+
+ git::clone { 'wikimedia/fundraising/tools':
+ directory => $dir,
+ }
+
+ file { '/etc/fundraising':
+ ensure => 'directory',
+ mode => '0755',
+ }
+
+ file { '/etc/fundraising/silverpop_export.yaml':
+ ensure => 'file',
+ content => template('crm/silverpop_export.yaml.erb'),
+ mode => '0644',
+ require => File['/etc/fundraising'],
+ }
+
+ mysql::db { 'silverpop': }
+
+ exec { 'create_silverpop_reference_data':
+ command => "/usr/bin/mysql -u '${::crm::db_user}'
-p'${::crm::db_pass}' 'silverpop' <
${dir}/silverpop_export/silverpop_countrylangs.sql",
+ unless => "/usr/bin/mysql -u '${::crm::db_user}'
-p'${::crm::db_pass}' 'silverpop' -e 'select 1 from silverpop_countrylangs'",
+ require => [
+ Git::Clone['wikimedia/fundraising/tools'],
+ Mysql::Db['silverpop'],
+ ],
+ }
+
+ exec { 'frtools_python_requirements':
+ command => "pip install -r ${dir}/silverpop_export/requirements.txt",
+ require => [
+ Git::Clone['wikimedia/fundraising/tools'],
+ ],
+ }
+}
diff --git a/puppet/modules/crm/templates/silverpop_export.yaml.erb
b/puppet/modules/crm/templates/silverpop_export.yaml.erb
new file mode 100644
index 0000000..647fb16
--- /dev/null
+++ b/puppet/modules/crm/templates/silverpop_export.yaml.erb
@@ -0,0 +1,34 @@
+# Deploy as /etc/fundraising/silverpop_export.yaml, or
$HOME/.fundraising/silverpop_export.yaml
+# vim: ft=yaml
+
+# Directory which will stage the working files
+working_path: /tmp/
+
+# For archival purposes, how many days of old runs should we keep? 0 means
forever.
+days_to_keep_files: 1
+
+# Login credentials for the silverpop transfer server
+sftp:
+ host: 123.123.123.123
+ username: foo
+ password: "lissp#"
+ host_key:
+
+ remote_root: /upload/
+
+civicrm_db:
+ db: civicrm
+
+drupal_db:
+ db: drupal
+
+geonames_db:
+ db: geonames
+
+silverpop_db:
+ host: localhost
+ user: "<%= scope['::crm::db_user'] %>"
+ passwd: "<%= scope['::crm::db_pass'] %>"
+ db: silverpop
+ debug: false
+
--
To view, visit https://gerrit.wikimedia.org/r/281493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2383a7793414a6ef437ad9bd7e66e0b39cdb1d27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits