diff --git a/deployment/puppet/mcollective/examples/mcollective-client-only.pp b/deployment/puppet/mcollective/examples/mcollective-client-only.pp new file mode 100644 index 0000000000..17c6c5f83c --- /dev/null +++ b/deployment/puppet/mcollective/examples/mcollective-client-only.pp @@ -0,0 +1,19 @@ +$fuel_settings = parseyaml($astute_settings_yaml) +$fuel_version = parseyaml($fuel_version_yaml) + +$mco_host = $::fuel_settings['ADMIN_NETWORK']['ipaddress'] + +$mco_pskey = "unset" +$mco_vhost = "mcollective" +$mco_user = "mcollective" +$mco_password = "marionette" +$mco_connector = "rabbitmq" + +class { "mcollective::client": + pskey => $::mco_pskey, + vhost => $::mco_vhost, + user => $::mco_user, + password => $::mco_password, + host => $::mco_host, + stomp => false, +} diff --git a/deployment/puppet/mcollective/examples/mcollective-server-only.pp b/deployment/puppet/mcollective/examples/mcollective-server-only.pp new file mode 100644 index 0000000000..b9fb8b36cc --- /dev/null +++ b/deployment/puppet/mcollective/examples/mcollective-server-only.pp @@ -0,0 +1,19 @@ +$fuel_settings = parseyaml($astute_settings_yaml) +$fuel_version = parseyaml($fuel_version_yaml) + +$mco_host = $::fuel_settings['ADMIN_NETWORK']['ipaddress'] + +$mco_pskey = "unset" +$mco_vhost = "mcollective" +$mco_user = "mcollective" +$mco_password = "marionette" +$mco_connector = "rabbitmq" + +class { "mcollective::server": + pskey => $::mco_pskey, + vhost => $::mco_vhost, + user => $::mco_user, + password => $::mco_password, + host => $::mco_host, + stomp => false, +} diff --git a/deployment/puppet/mcollective/manifests/client.pp b/deployment/puppet/mcollective/manifests/client.pp index 706adb41c9..707e5125c8 100644 --- a/deployment/puppet/mcollective/manifests/client.pp +++ b/deployment/puppet/mcollective/manifests/client.pp @@ -23,6 +23,8 @@ class mcollective::client( $stomp = false, ){ + include mcollective::clientpackages + case $::osfamily { 'Debian': { $mcollective_client_config_template="mcollective/client.cfg.ubuntu.erb" @@ -37,37 +39,15 @@ class mcollective::client( } } - case $::rubyversion { - '2.1.1': { - $mcollective_client_package = "ruby21-rubygem-mcollective-client" - } - '1.8.7': { - $mcollective_client_package = "mcollective-client" - } - } - - package { $mcollective_client_package : - ensure => 'present', - } - - case $::rubyversion { - '2.1.1': { - package { 'ruby21-nailgun-mcagents': } - } - '1.8.7': { - package { 'nailgun-mcagents': } - } - } - file { "/etc/mcollective": ensure => directory } file { "/etc/mcollective/client.cfg": - ensure => present, + ensure => present, content => template($mcollective_client_config_template), - owner => root, - group => root, - mode => 0600, - require => Package[$mcollective_client_package], + owner => 'root', + group => 'root', + mode => '0600', + require => Class['::mcollective::clientpackages'], } ###DEPRECATED - RETAINED FROM OLD FUEL VERSIONS#### # file {"${mcollective_agent_path}/puppetd.ddl" : diff --git a/deployment/puppet/mcollective/manifests/clientpackages.pp b/deployment/puppet/mcollective/manifests/clientpackages.pp new file mode 100644 index 0000000000..02bd2830a6 --- /dev/null +++ b/deployment/puppet/mcollective/manifests/clientpackages.pp @@ -0,0 +1,33 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed 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. + + +class mcollective::clientpackages +{ + + case $::rubyversion { + '2.1.1': { + $mcollective_client_package = "ruby21-rubygem-mcollective-client" + package { 'ruby21-nailgun-mcagents': } + } + '1.8.7': { + $mcollective_client_package = "mcollective-client" + package { 'nailgun-mcagents': } + } + } + + package { $mcollective_client_package : + ensure => 'present', + } +} diff --git a/deployment/puppet/mcollective/manifests/server.pp b/deployment/puppet/mcollective/manifests/server.pp index 4f4f94927a..97ad82af7e 100644 --- a/deployment/puppet/mcollective/manifests/server.pp +++ b/deployment/puppet/mcollective/manifests/server.pp @@ -23,6 +23,8 @@ class mcollective::server( $stomp = false, ){ + include mcollective::clientpackages + case $operatingsystem { /(?i)(centos|redhat)/: { # THIS PACKAGE ALSO INSTALLS REQUIREMENTS