Skip to content

Commit

Permalink
Workaround for SERVER-973
Browse files Browse the repository at this point in the history
This workaround is needed in some cases by Puppet Server users. It is
implemented in voxpupuli-archive as well.

Fixes #278

Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie committed Jun 16, 2016
1 parent 8e5d86b commit 9caaedf
Show file tree
Hide file tree
Showing 24 changed files with 186 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2016-06-16 - Release 1.1.1
### Summary
- Workaround upstream Puppet bug regarding PuppetX ruby namespace (#278 #284
SERVER-973)

## 2016-06-13 - Release 1.1.0
### Summary
- Move helpers functions to PuppetX ruby namespace (#259)
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_clone/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_clone).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Provider to add, delete, manipulate primitive clones.'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_clone/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_clone).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Provider to add, delete, manipulate primitive clones.'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_colocation/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_colocation).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_colocation/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_colocation).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_commit/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_commit).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
commands crm_shadow: 'crm_shadow'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_commit/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_commit).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
commands crm_shadow: 'crm_shadow'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_group/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_group).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Provider to add, delete, manipulate primitive groups.'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_group/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_group).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Provider to add, delete, manipulate primitive groups.'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_location/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_location).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_location/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_location).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_order/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_order).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_order/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_order).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_primitive/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_primitive).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Specific provider for a rather specific type since I currently have no
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_primitive/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_primitive).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Specific provider for a rather specific type since I currently have no
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_property/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_property).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_property/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_property).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_rsc_defaults/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_rsc_defaults).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
desc 'Specific provider for a rather specific type since I currently have no plan to
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_shadow/crm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
begin
require 'puppet_x/voxpupuli/corosync/provider/crmsh'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/crmsh'
end

Puppet::Type.type(:cs_shadow).provide(:crm, parent: PuppetX::Voxpupuli::Corosync::Provider::Crmsh) do
commands crm_shadow: 'crm_shadow'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/cs_shadow/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider/pcs'
begin
require 'puppet_x/voxpupuli/corosync/provider/pcs'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/pcs'
end

Puppet::Type.type(:cs_shadow).provide(:pcs, parent: PuppetX::Voxpupuli::Corosync::Provider::Pcs) do
commands crm_shadow: 'crm_shadow'
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet_x/voxpupuli/corosync/provider/cib_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'puppet_x/voxpupuli/corosync/provider'
begin
require 'puppet_x/voxpupuli/corosync/provider'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider'
end

class PuppetX::Voxpupuli::Corosync::Provider::CibHelper < Puppet::Provider
# Yep, that's right we are parsing XML...FUN! (It really wasn't that bad)
Expand Down
12 changes: 10 additions & 2 deletions lib/puppet_x/voxpupuli/corosync/provider/crmsh.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
require 'puppet_x/voxpupuli/corosync/provider'
require 'puppet_x/voxpupuli/corosync/provider/cib_helper'
begin
require 'puppet_x/voxpupuli/corosync/provider'
require 'puppet_x/voxpupuli/corosync/provider/cib_helper'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider'
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/cib_helper'
end

class PuppetX::Voxpupuli::Corosync::Provider::Crmsh < PuppetX::Voxpupuli::Corosync::Provider::CibHelper
# Yep, that's right we are parsing XML...FUN! (It really wasn't that bad)
Expand Down
12 changes: 10 additions & 2 deletions lib/puppet_x/voxpupuli/corosync/provider/pcs.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
require 'puppet_x/voxpupuli/corosync/provider'
require 'puppet_x/voxpupuli/corosync/provider/cib_helper'
begin
require 'puppet_x/voxpupuli/corosync/provider'
require 'puppet_x/voxpupuli/corosync/provider/cib_helper'
rescue LoadError
require 'pathname' # WORKAROUND #14073, #7788 and SERVER-973
corosync = Puppet::Module.find('corosync', Puppet[:environment].to_s)
raise(LoadError, "Unable to find corosync module in modulepath #{Puppet[:basemodulepath] || Puppet[:modulepath]}") unless corosync
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider'
require File.join corosync.path, 'lib/puppet_x/voxpupuli/corosync/provider/cib_helper'
end

class PuppetX::Voxpupuli::Corosync::Provider::Pcs < PuppetX::Voxpupuli::Corosync::Provider::CibHelper
# Yep, that's right we are parsing XML...FUN! (It really wasn't that bad)
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-corosync",
"version": "1.1.0",
"version": "1.1.1",
"author": "voxpupuli",
"summary": "This module is a set of manifests and types/providers for quickly setting up highly available clusters using Corosync",
"license": "Apache-2.0",
Expand Down

0 comments on commit 9caaedf

Please sign in to comment.