Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Improvments for MCollective Client/Server Origin vs OSE #399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 36 additions & 25 deletions templates/mcollective/mcollective-client.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
main_collective = mcollective
collectives = mcollective
libdir = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/usr/libexec/mcollective
<% if scope.lookupvar('::openshift_origin::ose_version') != "" -%>
# logger_type = file cannot be set for OpenShift Enterprise
# # https://bugzilla.redhat.com/show_bug.cgi?id=963332
logger_type = console
loglevel = warn
<% else -%>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this works in origin but not ose? That seems odd as I doubt we're customizing mcollective. John is assigned the referenced bug, lets see what he says, ping @dobbymoodge

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I inverted the conditional in my head here. So this would be enabled only for OSE.

I think if the fix works for origin as well we can go ahead and fix it for origin too. The other items in your previous pull requests that were places where variable names differed between Origin M4 and OSE 2.2 so we had no option but to conditionalize it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdodson you have never come back to me regarding this one :)

logfile = /var/log/openshift/broker/<%= scope.lookupvar('::openshift_origin::params::ruby_scl_prefix') %>mcollective-client.log
loglevel = debug
<% end -%>
direct_addressing = 0

# Plugins
Expand All @@ -13,37 +20,41 @@ plugin.psk = unset

connector = activemq
plugin.activemq.pool.size = <%= @pool_size %>
<% if scope.lookupvar('::openshift_origin::msgserver_cluster') then
@cluster_members.each_with_index do |cluster_member, index| -%>

<% if scope.lookupvar('::openshift_origin::msgserver_cluster') -%>
<% @cluster_members.each_with_index do |cluster_member, index| -%>
plugin.activemq.pool.<%= index + 1%>.host = <%= cluster_member %>
plugin.activemq.pool.<%= index + 1%>.user = <%= scope.lookupvar('::openshift_origin::mcollective_user') %>
plugin.activemq.pool.<%= index + 1%>.password = <%= scope.lookupvar('::openshift_origin::mcollective_password') %>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.<%= index + 1%>.port = 61614
plugin.activemq.pool.<%= index + 1%>.ssl = true
plugin.activemq.pool.<%= index + 1%>.ssl.ca = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/ca.pem
plugin.activemq.pool.<%= index + 1%>.ssl.key = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/key.pem
plugin.activemq.pool.<%= index + 1%>.ssl.cert = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/cert.pem
<% else %>
plugin.activemq.pool.<%= index + 1%>.port = 61613
<% end %>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.<%= index + 1%>.port = 61614
plugin.activemq.pool.<%= index + 1%>.ssl = true
plugin.activemq.pool.<%= index + 1%>.ssl.ca = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/ca.pem
plugin.activemq.pool.<%= index + 1%>.ssl.key = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/key.pem
plugin.activemq.pool.<%= index + 1%>.ssl.cert = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/cert.pem
<% else -%>
plugin.activemq.pool.<%= index + 1%>.port = 61613
<% end -%>

<% end %>
<% else -%>
plugin.activemq.pool.1.host = <%= scope.lookupvar('::openshift_origin::msgserver_fqdn') %>
plugin.activemq.pool.1.user = <%= scope.lookupvar('::openshift_origin::mcollective_user') %>
plugin.activemq.pool.1.password = <%= scope.lookupvar('::openshift_origin::mcollective_password') %>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.1.port = 61614
plugin.activemq.pool.1.ssl = true
plugin.activemq.pool.1.ssl.ca = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/ca.pem
plugin.activemq.pool.1.ssl.key = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/key.pem
plugin.activemq.pool.1.ssl.cert = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/cert.pem
<% else -%>
plugin.activemq.pool.1.port = 61613
<% end -%>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.1.port = 61614
plugin.activemq.pool.1.ssl = true
plugin.activemq.pool.1.ssl.ca = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/ca.pem
plugin.activemq.pool.1.ssl.key = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/key.pem
plugin.activemq.pool.1.ssl.cert = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/cert.pem
<% else -%>
plugin.activemq.pool.1.port = 61613
<% end -%>
<% end -%>
<% if scope.lookupvar('::openshift_origin::ose_version') != "" %>
plugin.activemq.initial_reconnect_delay = 0.1
plugin.activemq.max_reconnect_attempts = 6
plugin.activemq.heartbeat_interval = 30
plugin.activemq.max_hbread_fails = 2
plugin.activemq.max_hbrlck_fails = 2
<% end %>

55 changes: 30 additions & 25 deletions templates/mcollective/mcollective-server.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,46 @@ plugin.psk = unset

connector = activemq
plugin.activemq.pool.size = <%= @pool_size %>
<% if scope.lookupvar('::openshift_origin::msgserver_cluster') then
@cluster_members.each_with_index do |cluster_member, index| -%>

<% if scope.lookupvar('::openshift_origin::msgserver_cluster') -%>
<% @cluster_members.each_with_index do |cluster_member, index| -%>
plugin.activemq.pool.<%= index + 1%>.host = <%= cluster_member %>
plugin.activemq.pool.<%= index + 1%>.user = <%= scope.lookupvar('::openshift_origin::mcollective_user') %>
plugin.activemq.pool.<%= index + 1%>.password = <%= scope.lookupvar('::openshift_origin::mcollective_password') %>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.<%= index + 1%>.port = 61614
plugin.activemq.pool.<%= index + 1%>.ssl = true
plugin.activemq.pool.<%= index + 1%>.ssl.ca = <%= scope.lookupvar('::openshift_origin::msgserver_tls_ca') %>
plugin.activemq.pool.<%= index + 1%>.ssl.key = <%= scope.lookupvar('::openshift_origin::msgserver_tls_key') %>
plugin.activemq.pool.<%= index + 1%>.ssl.cert = <%= scope.lookupvar('::openshift_origin::msgserver_tls_cert') %>
<% else %>
plugin.activemq.pool.<%= index + 1%>.port = 61613
<% end %>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.<%= index + 1%>.port = 61614
plugin.activemq.pool.<%= index + 1%>.ssl = true
plugin.activemq.pool.<%= index + 1%>.ssl.ca = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/ca.pem
plugin.activemq.pool.<%= index + 1%>.ssl.key = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/key.pem
plugin.activemq.pool.<%= index + 1%>.ssl.cert = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/cert.pem
<% else -%>
plugin.activemq.pool.<%= index + 1%>.port = 61613
<% end -%>
<% end %>
<% else -%>
plugin.activemq.pool.1.host = <%= scope.lookupvar('::openshift_origin::msgserver_fqdn') %>
plugin.activemq.pool.1.user = <%= scope.lookupvar('::openshift_origin::mcollective_user') %>
plugin.activemq.pool.1.password = <%= scope.lookupvar('::openshift_origin::mcollective_password') %>


<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.1.port = 61614
plugin.activemq.pool.1.ssl = true
plugin.activemq.pool.1.ssl.ca = <%= scope.lookupvar('::openshift_origin::msgserver_tls_ca') %>
plugin.activemq.pool.1.ssl.key = <%= scope.lookupvar('::openshift_origin::msgserver_tls_key') %>
plugin.activemq.pool.1.ssl.cert = <%= scope.lookupvar('::openshift_origin::msgserver_tls_cert') %>
<% else -%>
plugin.activemq.pool.1.port = 61613
<% end -%>

<% if (scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'enabled' and @tls_certs_provided == true) or scope.lookupvar('::openshift_origin::msgserver_tls_enabled') == 'strict' -%>
plugin.activemq.pool.1.port = 61614
plugin.activemq.pool.1.ssl = true
plugin.activemq.pool.1.ssl.ca = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/ca.pem
plugin.activemq.pool.1.ssl.key = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/key.pem
plugin.activemq.pool.1.ssl.cert = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/certs/cert.pem
<% else -%>
plugin.activemq.pool.1.port = 61613
<% end -%>
<% end -%>

# Facts
factsource = yaml
plugin.yaml = <%= scope.lookupvar('::openshift_origin::params::ruby_scl_path_prefix') %>/etc/mcollective/facts.yaml
<% if scope.lookupvar('::openshift_origin::ose_version') != "" -%>
plugin.activemq.max_reconnect_attempts = 0
plugin.activemq.initial_reconnect_delay = 0.1
plugin.activemq.max_reconnect_delay = 4.0
plugin.activemq.heartbeat_interval = 30
plugin.activemq.max_hbread_fails = 2
plugin.activemq.max_hbrlck_fails = 2
<% end -%>

15 changes: 0 additions & 15 deletions templates/mcollective/mcollective.service

This file was deleted.