Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/325441
Change subject: [WIP] Wipe out activemq
......................................................................
[WIP] Wipe out activemq
Change-Id: I70af0564badd12703a41beee5e6ae9b67f648d6b
---
D puppet/modules/activemq/lib/puppet/type/tarball.rb
D puppet/modules/activemq/manifests/init.pp
D puppet/modules/activemq/templates/activemq-upstart.conf.erb
D puppet/modules/activemq/templates/activemq.xml.erb
M puppet/modules/crm/manifests/init.pp
M puppet/modules/crm/templates/DonationInterface.settings.php.erb
M puppet/modules/payments/manifests/donation_interface.pp
M puppet/modules/role/manifests/fundraising.pp
8 files changed, 11 insertions(+), 250 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
refs/changes/41/325441/1
diff --git a/puppet/modules/activemq/lib/puppet/type/tarball.rb
b/puppet/modules/activemq/lib/puppet/type/tarball.rb
deleted file mode 100644
index bec0237..0000000
--- a/puppet/modules/activemq/lib/puppet/type/tarball.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require 'open-uri'
-
-Puppet::Type.newtype(:tarball) do
- @doc = "Fetch and extract tarballed packages"
-
- ensurable
-
- newparam(:source) do
- desc "URL where the tarball will be found"
- end
-
- newparam(:path) do
- desc "Directory in which the tarball shall be extracted"
- end
-
- newparam(:creates) do
- desc "Will create this path when untarred"
-
- isnamevar
- end
-
- newparam(:storage) do
- desc "Directory in which to store the original tarball"
- end
-
- def create
- if not File.exists? filename
- fetch
- end
- extract
- end
-
- def creates_path
- self[:creates] || filename
- end
-
- def destroy
- File.unlink creates_path
- end
-
- def exists?
- # TODO verify signature
- File.exists? creates_path
- end
-
- def extract
- notice "Unpacking tarball #{filename} into #{self[:path]}"
- system("tar", "-C", self[:path], "-xzf", filename)
- end
-
- def fetch
- # TODO safe noclobber
-
- FileUtils.copy_stream(
- open(self[:source]),
- File.open(filename, "w+")
- )
- end
-
- def filename
- File.join(self[:storage], self[:source].split(/\//).last)
- end
-end
diff --git a/puppet/modules/activemq/manifests/init.pp
b/puppet/modules/activemq/manifests/init.pp
deleted file mode 100644
index 4d2f4b1..0000000
--- a/puppet/modules/activemq/manifests/init.pp
+++ /dev/null
@@ -1,73 +0,0 @@
-# == Class: activemq
-#
-# Provisions Apache ActiveMQ
-#
-class activemq(
- $version = '5.11.4',
- $hostname = '127.0.0.1',
- $port = '61613',
-) {
- $pkgname = "apache-activemq-${version}"
- $mirror =
"http://mirrors.ibiblio.org/apache/activemq/${version}/${pkgname}-bin.tar.gz"
-
- $destdir = '/usr/local'
- $pkgdir = "${destdir}/${pkgname}"
-
- tarball { $pkgname:
- ensure => present,
- source => $mirror,
- storage => '/vagrant/cache/apt',
- path => $destdir,
- creates => $pkgdir,
- }
-
- $config = '/etc/activemq.xml'
-
- file { $config:
- owner => root,
- group => root,
- content => template('activemq/activemq.xml.erb'),
- }
-
- package { 'default-jre-headless':
- ensure => present,
- }
-
- user { 'activemq':
- ensure => present,
- managehome => true,
- home => '/home/activemq',
- }
-
- file { [ "${pkgdir}/data", "${pkgdir}/tmp" ]:
- ensure => directory,
- owner => 'activemq',
- group => 'activemq',
- mode => '0770',
- recurse => true,
- require => Tarball[$pkgname],
- }
-
- service { 'activemq':
- ensure => running,
- enable => true,
- provider => 'upstart',
- require => [
- Package['default-jre-headless'],
- Tarball[$pkgname],
- File["${pkgdir}/data"],
- User['activemq'],
- ],
- subscribe => [
- File['/etc/init/activemq.conf'],
- File[$config],
- ],
- }
-
- file { '/etc/init/activemq.conf':
- content => template('activemq/activemq-upstart.conf.erb'),
- owner => 'root',
- group => 'root',
- mode => '0644',
- }
-}
diff --git a/puppet/modules/activemq/templates/activemq-upstart.conf.erb
b/puppet/modules/activemq/templates/activemq-upstart.conf.erb
deleted file mode 100755
index 7aa71a0..0000000
--- a/puppet/modules/activemq/templates/activemq-upstart.conf.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-description "ActiveMQ STOMP server"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid activemq
-setgid activemq
-
-exec <%= @pkgdir %>/bin/activemq-admin start
diff --git a/puppet/modules/activemq/templates/activemq.xml.erb
b/puppet/modules/activemq/templates/activemq.xml.erb
deleted file mode 100644
index 5c406f2..0000000
--- a/puppet/modules/activemq/templates/activemq.xml.erb
+++ /dev/null
@@ -1,63 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<beans
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:amq="http://activemq.apache.org/schema/core"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
- http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">
-
- <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <value>file:${activemq.base}/conf/credentials.properties</value>
- </property>
- </bean>
-
- <!-- Allows us to use system properties as variables in this configuration
file -->
- <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
-
- <broker xmlns="http://activemq.apache.org/schema/core"
- brokerName="localhost"
- dataDirectory="${activemq.base}/data">
-
- <!--
- Configure message persistence for the broker. The default
persistence
- mechanism is the KahaDB store (identified by the kahaDB tag).
- For more information, see:
-
- http://activemq.apache.org/persistence.html
- -->
- <persistenceAdapter>
- <kahaDB directory="${activemq.base}/data/kahadb"/>
- </persistenceAdapter>
-
- <!--
- The transport connectors expose ActiveMQ over a given protocol to
- clients and other brokers. For more information, see:
-
- http://activemq.apache.org/configuring-transports.html
- -->
- <transportConnectors>
- <transportConnector name="stomp" uri="stomp://<%= @hostname %>:<%=
@port %>"/>
- </transportConnectors>
-
- </broker>
-
- <import resource="jetty.xml"/>
-
-</beans>
-
diff --git a/puppet/modules/crm/manifests/init.pp
b/puppet/modules/crm/manifests/init.pp
index df53a6c..f4f41dd 100644
--- a/puppet/modules/crm/manifests/init.pp
+++ b/puppet/modules/crm/manifests/init.pp
@@ -38,7 +38,6 @@
include ::crm::apache
include ::crm::civicrm
include ::crm::tools
- include ::activemq
git::clone { $repo:
directory => $dir,
@@ -72,29 +71,27 @@
'astropay_audit_recon_completed_dir' =>
'/var/spool/audit/astropay/completed',
'astropay_audit_recon_files_dir' =>
'/var/spool/audit/astropay/incoming/',
'astropay_audit_working_log_dir' =>
'/tmp/astropay_audit/',
- 'banner_history_queue' =>
'/queue/banner-history',
- 'donationqueue_url' =>
"tcp://${::activemq::hostname}:${::activemq::port}",
- 'fredge_payments_antifraud_queue' =>
'/queue/payments-antifraud',
- 'fredge_payments_init_queue' =>
'/queue/payments-init',
+ 'banner_history_queue' =>
'banner-history',
+ 'fredge_payments_antifraud_queue' =>
'payments-antifraud',
+ 'fredge_payments_init_queue' =>
'payments-init',
'queue2civicrm_batch' => 5,
'queue2civicrm_batch_time' => 90,
'queue2civicrm_gateways_to_monitor' =>
'adyen,amazon,astropay,globalcollect,paypal',
'queue2civicrm_gmetric_dmax' => 360,
'queue2civicrm_gmetric_tmax' => 60,
- 'queue2civicrm_subscription' =>
'/queue/donations',
- 'queue2civicrm_url' =>
"tcp://${::activemq::hostname}:${::activemq::port}",
+ 'queue2civicrm_subscription' =>
'donations',
'recurring_globalcollect_batch' => 1,
'recurring_globalcollect_batch_max' => 100,
'recurring_globalcollect_failure_retry_rate' => 1,
'recurring_globalcollect_failures_before_cancellation' => 3,
'recurring_globalcollect_run_missed_days' => 7,
- 'recurring_subscription' =>
'/queue/donations_recurring',
+ 'recurring_subscription' =>
'donations_recurring',
'refund_batch' => 0,
'refund_batch_time' => 90,
- 'refund_queue' =>
'/queue/refund',
+ 'refund_queue' => 'refund',
'thank_you_days' => 14,
'thank_you_batch' => 100,
- 'unsubscribe_queue' =>
'/queue/unsubscribe',
+ 'unsubscribe_queue' =>
'unsubscribe',
},
require => Php::Composer::Install['crm-composer'],
}
diff --git a/puppet/modules/crm/templates/DonationInterface.settings.php.erb
b/puppet/modules/crm/templates/DonationInterface.settings.php.erb
index ad550e5..f2ca06c 100644
--- a/puppet/modules/crm/templates/DonationInterface.settings.php.erb
+++ b/puppet/modules/crm/templates/DonationInterface.settings.php.erb
@@ -31,9 +31,8 @@
$wgGlobalCollectGatewayAvsMap;
$wgDonationInterfaceDefaultQueueServer = array(
- 'type' => 'PHPQueue\Backend\Stomp',
- 'persistent' => 1,
- 'uri' => 'tcp://<%= scope['::activemq::hostname'] %>:<%=
scope['::activemq::port'] %>',
+ 'type' => 'PHPQueue\Backend\Predis',
+ 'servers' => 'tcp://localhost',
);
$wgDonationInterfaceQueues = array(
diff --git a/puppet/modules/payments/manifests/donation_interface.pp
b/puppet/modules/payments/manifests/donation_interface.pp
index b48eef2..fe77d01 100644
--- a/puppet/modules/payments/manifests/donation_interface.pp
+++ b/puppet/modules/payments/manifests/donation_interface.pp
@@ -44,43 +44,16 @@
wgDonationInterfaceUseSyslog => true,
wgDonationInterfaceDefaultQueueServer => {
- 'type' => 'PHPQueue\Backend\Stomp',
- 'uri' => 'tcp://localhost:61613',
- 'persistent' => 1
+ 'type' => 'PHPQueue\Backend\Predis',
+ 'servers' => 'tcp://localhost',
},
wgDonationInterfaceQueues => {
'globalcollect-cc-limbo' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
'order_key' => 'date',
- },
- 'pending' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
},
'complete-new' => {
'queue' => 'donations',
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'banner-history' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'payments-antifraud' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'payments-init' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
},
},
diff --git a/puppet/modules/role/manifests/fundraising.pp
b/puppet/modules/role/manifests/fundraising.pp
index 3647869..38f3c87 100644
--- a/puppet/modules/role/manifests/fundraising.pp
+++ b/puppet/modules/role/manifests/fundraising.pp
@@ -5,7 +5,6 @@
class role::fundraising {
include ::role::centralnotice
include ::role::payments
- include ::activemq
include ::crm
include ::rsyslog
include ::smashpig
--
To view, visit https://gerrit.wikimedia.org/r/325441
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70af0564badd12703a41beee5e6ae9b67f648d6b
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