PSARC/2016/037 Common MCollective agents
authorsaurabh.vyas@oracle.com
Tue, 22 Mar 2016 12:01:24 -0700
changeset 5643 ccf9fb8a1db9
parent 5642 6758c401e924
child 5644 b7ac9aa7be4d
PSARC/2016/037 Common MCollective agents 21940478 Add MCollective plugins to userland gate
components/ruby/mcollective/Makefile
components/ruby/mcollective/mcollective-GENFRAG.p5m
components/ruby/mcollective/mcollective-RUBYVER.p5m
components/ruby/mcollective/patches/03-mco-service-name
--- a/components/ruby/mcollective/Makefile	Mon Mar 21 16:26:40 2016 -0700
+++ b/components/ruby/mcollective/Makefile	Tue Mar 22 12:01:24 2016 -0700
@@ -21,10 +21,12 @@
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../../make-rules/shared-macros.mk
+include ../../../make-rules/shared-targets.mk
 
 RUBY_VERSION=       2.1
 RUBY_LIB_VERSION=   2.1.0
 RUBY_VERSIONS=      2.1.0
+PATCH_EACH_ARCHIVE = 1
 
 COMPONENT_NAME=		mcollective
 COMPONENT_VERSION=	2.8.2
@@ -36,8 +38,35 @@
 COMPONENT_PROJECT_URL=  https://puppetlabs.com/mcollective
 COMPONENT_BUGDB=	utility/mcollective
 
-TPNO=                   23491
+TPNO_FRMWK=        23491
+TPNO_PKG_AGENT=    26722
+TPNO_PPT_AGENT=    26719
+TPNO_FCT_AGENT=    26723
+TPNO_SVC_AGENT=    26724
+
+COMPONENT_NAME_1=  mcollective-puppet-agent
+VERSION_PPT_AGENT= 1.10.0
+GIT_REPO_1=        https://github.com/puppetlabs/$(COMPONENT_NAME_1)
+GIT_COMMIT_ID_1=   cfa4b5e4a9752f6b631f0231b25051c3c16e89d8
+PKG_PROTO_DIRS +=  $(COMPONENT_NAME_1)-$(GIT_COMMIT_ID_1)
 
+COMPONENT_NAME_2=  mcollective-package-agent
+VERSION_PKG_AGENT= 4.4.0
+GIT_REPO_2=        https://github.com/puppetlabs/$(COMPONENT_NAME_2)
+GIT_COMMIT_ID_2=   8520f756cbe4ce8a1e0fc416ed4d79ee774bcb71
+PKG_PROTO_DIRS +=  $(COMPONENT_NAME_2)-$(GIT_COMMIT_ID_2)
+
+COMPONENT_NAME_3=  mcollective-service-agent
+VERSION_SVC_AGENT= 3.3.1
+GIT_REPO_3=        https://github.com/puppetlabs/$(COMPONENT_NAME_3)
+GIT_COMMIT_ID_3=   75478ac81f80bfd5ebaab05fe5dc5b92d90af815
+PKG_PROTO_DIRS +=  $(COMPONENT_NAME_3)-$(GIT_COMMIT_ID_3)
+
+COMPONENT_NAME_4=  mcollective-facter-facts
+VERSION_FCT_AGENT= 1.0.0
+GIT_REPO_4=        https://github.com/puppetlabs/$(COMPONENT_NAME_4)
+GIT_COMMIT_ID_4=   30adc0e50bc38fc261cae437e84a1b69a08fdae3
+PKG_PROTO_DIRS +=  $(COMPONENT_NAME_4)-$(GIT_COMMIT_ID_4)
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/install.rb.mk
@@ -48,6 +77,12 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
+COMPONENT_POST_UNPACK_ACTION_3 += \
+  $(GPATCH) -d \
+      $(COMPONENT_DIR)/$(COMPONENT_NAME_3)-$(GIT_COMMIT_ID_3) \
+      $(GPATCH_FLAGS) \
+      < patches/03-mco-service-name
+
 # common targets
 build:		$(BUILD_64)
 
--- a/components/ruby/mcollective/mcollective-GENFRAG.p5m	Mon Mar 21 16:26:40 2016 -0700
+++ b/components/ruby/mcollective/mcollective-GENFRAG.p5m	Tue Mar 22 12:01:24 2016 -0700
@@ -29,6 +29,10 @@
 # force a dependency on the unversioned mcollective package
 depend type=require \
     fmri=pkg:/system/management/mcollective@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+
+# MCollective agents depend on puppet module, thus force dependency on puppet
+# package
+depend type=require fmri=pkg:/system/management/puppet
 # Only Ruby 2.1 mcollective packages are currently available
 depend type=require-any fmri=pkg:/library/ruby/stomp-21
 depend type=require-any fmri=pkg:/runtime/ruby-21
--- a/components/ruby/mcollective/mcollective-RUBYVER.p5m	Mon Mar 21 16:26:40 2016 -0700
+++ b/components/ruby/mcollective/mcollective-RUBYVER.p5m	Tue Mar 22 12:01:24 2016 -0700
@@ -31,7 +31,6 @@
     value="MCollective is a framework for building server orchestration or parallel job execution systems. Most people use it to programmatically execute administrative tasks on clusters of servers. In Solaris, we plan to use this with Puppet for managing configurations in large IT infrastructures."
 set name=com.oracle.info.description \
     value="MCollective - framework for building server orchestration."
-set name=com.oracle.info.tpno value=$(TPNO)
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Ruby \
     value="org.opensolaris.category.2008:System/Administration and Configuration"
@@ -215,5 +214,107 @@
 link path=usr/sbin/mcollectived \
     target=../ruby/$(RUBY_VERSION)/sbin/mcollectived mediator=ruby \
     mediator-version=$(RUBY_VERSION)
-license mcollective.license license="Apache v2.0"
+file agent/package.ddl path=usr/share/mcollective/mcollective/agent/package.ddl
+file agent/package.rb path=usr/share/mcollective/mcollective/agent/package.rb
+file agent/puppet.ddl path=usr/share/mcollective/mcollective/agent/puppet.ddl
+file agent/puppet.rb path=usr/share/mcollective/mcollective/agent/puppet.rb
+file agent/service.ddl path=usr/share/mcollective/mcollective/agent/service.ddl
+file agent/service.rb path=usr/share/mcollective/mcollective/agent/service.rb
+file aggregate/boolean_summary.ddl \
+    path=usr/share/mcollective/mcollective/aggregate/boolean_summary.ddl
+file aggregate/boolean_summary.rb \
+    path=usr/share/mcollective/mcollective/aggregate/boolean_summary.rb
+file application/package.rb \
+    path=usr/share/mcollective/mcollective/application/package.rb
+file application/puppet.rb \
+    path=usr/share/mcollective/mcollective/application/puppet.rb
+file application/service.rb \
+    path=usr/share/mcollective/mcollective/application/service.rb
+file data/puppet_data.ddl \
+    path=usr/share/mcollective/mcollective/data/puppet_data.ddl
+file data/puppet_data.rb \
+    path=usr/share/mcollective/mcollective/data/puppet_data.rb
+file data/resource_data.ddl \
+    path=usr/share/mcollective/mcollective/data/resource_data.ddl
+file data/resource_data.rb \
+    path=usr/share/mcollective/mcollective/data/resource_data.rb
+file data/service_data.ddl \
+    path=usr/share/mcollective/mcollective/data/service_data.ddl
+file data/service_data.rb \
+    path=usr/share/mcollective/mcollective/data/service_data.rb
+file facts/facter_facts.ddl \
+    path=usr/share/mcollective/mcollective/facts/facter_facts.ddl
+file facts/facter_facts.rb \
+    path=usr/share/mcollective/mcollective/facts/facter_facts.rb
+file util/package/base.rb \
+    path=usr/share/mcollective/mcollective/util/package/base.rb
+file util/package/packagehelpers.rb \
+    path=usr/share/mcollective/mcollective/util/package/packagehelpers.rb
+file util/package/puppetpackage.rb \
+    path=usr/share/mcollective/mcollective/util/package/puppetpackage.rb
+file util/package/yumHelper.py \
+    path=usr/share/mcollective/mcollective/util/package/yumHelper.py
+file util/package/yumpackage.rb \
+    path=usr/share/mcollective/mcollective/util/package/yumpackage.rb
+file util/puppet_agent_mgr.rb \
+    path=usr/share/mcollective/mcollective/util/puppet_agent_mgr.rb
+file util/puppet_agent_mgr/mgr_v2.rb \
+    path=usr/share/mcollective/mcollective/util/puppet_agent_mgr/mgr_v2.rb
+file util/puppet_agent_mgr/mgr_v3.rb \
+    path=usr/share/mcollective/mcollective/util/puppet_agent_mgr/mgr_v3.rb
+file util/puppet_agent_mgr/mgr_windows.rb \
+    path=usr/share/mcollective/mcollective/util/puppet_agent_mgr/mgr_windows.rb
+file util/puppet_server_address_validation.rb \
+    path=usr/share/mcollective/mcollective/util/puppet_server_address_validation.rb
+file util/puppetrunner.rb \
+    path=usr/share/mcollective/mcollective/util/puppetrunner.rb
+file util/service/base.rb \
+    path=usr/share/mcollective/mcollective/util/service/base.rb
+file util/service/puppetservice.rb \
+    path=usr/share/mcollective/mcollective/util/service/puppetservice.rb
+file validator/puppet_resource_validator.ddl \
+    path=usr/share/mcollective/mcollective/validator/puppet_resource_validator.ddl
+file validator/puppet_resource_validator.rb \
+    path=usr/share/mcollective/mcollective/validator/puppet_resource_validator.rb
+file validator/puppet_server_address_validator.ddl \
+    path=usr/share/mcollective/mcollective/validator/puppet_server_address_validator.ddl
+file validator/puppet_server_address_validator.rb \
+    path=usr/share/mcollective/mcollective/validator/puppet_server_address_validator.rb
+file validator/puppet_tags_validator.ddl \
+    path=usr/share/mcollective/mcollective/validator/puppet_tags_validator.ddl
+file validator/puppet_tags_validator.rb \
+    path=usr/share/mcollective/mcollective/validator/puppet_tags_validator.rb
+file validator/puppet_variable_validator.ddl \
+    path=usr/share/mcollective/mcollective/validator/puppet_variable_validator.ddl
+file validator/puppet_variable_validator.rb \
+    path=usr/share/mcollective/mcollective/validator/puppet_variable_validator.rb
+file validator/service_name.ddl \
+    path=usr/share/mcollective/mcollective/validator/service_name.ddl
+file validator/service_name.rb \
+    path=usr/share/mcollective/mcollective/validator/service_name.rb
 
+# License & TPNOs
+license mcollective.license license="Apache v2.0" \
+    com.oracle.info.description="MCollective framework for building server orchestration" \
+    com.oracle.info.name=$(COMPONENT_NAME) com.oracle.info.tpno=$(TPNO_FRMWK) \
+    com.oracle.info.version=$(IPS_COMPONENT_VERSION)
+license mcollective.license license="Apache v2.0 (facter agent)" \
+    com.oracle.info.description="MCollective facter agent" \
+    com.oracle.info.name=$(COMPONENT_NAME_4) \
+    com.oracle.info.tpno=$(TPNO_FCT_AGENT) \
+    com.oracle.info.version=$(VERSION_FCT_AGENT)
+license mcollective.license license="Apache v2.0 (package agent)" \
+    com.oracle.info.description="MCollective package agent" \
+    com.oracle.info.name=$(COMPONENT_NAME_2) \
+    com.oracle.info.tpno=$(TPNO_PKG_AGENT) \
+    com.oracle.info.version=$(VERSION_PKG_AGENT)
+license mcollective.license license="Apache v2.0 (puppet agent)" \
+    com.oracle.info.description="MCollective puppet agent" \
+    com.oracle.info.name=$(COMPONENT_NAME_1) \
+    com.oracle.info.tpno=$(TPNO_PPT_AGENT) \
+    com.oracle.info.version=$(VERSION_PPT_AGENT)
+license mcollective.license license="Apache v2.0 (service agent)" \
+    com.oracle.info.description="MCollective service agent" \
+    com.oracle.info.name=$(COMPONENT_NAME_3) \
+    com.oracle.info.tpno=$(TPNO_SVC_AGENT) \
+    com.oracle.info.version=$(VERSION_SVC_AGENT)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ruby/mcollective/patches/03-mco-service-name	Tue Mar 22 12:01:24 2016 -0700
@@ -0,0 +1,11 @@
+--- mcollective-service-agent-75478ac81f80bfd5ebaab05fe5dc5b92d90af815/validator/service_name.rb.orig	2016-03-03 12:06:59.523158420 -0800
++++ mcollective-service-agent-75478ac81f80bfd5ebaab05fe5dc5b92d90af815/validator/service_name.rb	2016-03-03 12:07:26.197744202 -0800
+@@ -2,7 +2,7 @@
+   module Validator
+     class Service_nameValidator
+       def self.validate(service_name)
+-        raise("%s is not a valid service name" % service_name) unless !!(service_name =~ /\A^[a-zA-Z\.\-_\d]+$\z/)
++        raise("%s is not a valid service name" % service_name) unless !!(service_name =~ /\A^[a-zA-Z\.\-_\d\:\/]+$\z/)
+       end
+     end
+   end