Date: Sat, 12 Mar 2016 14:30:01 +0000 (UTC) From: Kurt Jaeger <pi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r410891 - in head/sysutils: . puppetserver puppetserver/files Message-ID: <201603121430.u2CEU16P082427@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pi Date: Sat Mar 12 14:30:00 2016 New Revision: 410891 URL: https://svnweb.freebsd.org/changeset/ports/410891 Log: New port: sysutils/puppetserver Puppet master is a Ruby application that compiles configurations for any number of Puppet agent nodes, using Puppet code and various other data sources. (For more info, see Overview of Puppet's Architecture.) Puppet Server is an application that runs on the Java Virtual Machine (JVM) and provides the same services as the classic Puppet master application. It mostly does this by running the existing Puppet master code in several JRuby interpreters, but it replaces some parts of the classic application with new services written in Clojure. WWW: https://docs.puppetlabs.com/puppetserver/latest/services_master_puppetserver.html PR: 204072 Submitted by: Zach Leslie <freebsd@zleslie.info> Added: head/sysutils/puppetserver/ head/sysutils/puppetserver/Makefile (contents, props changed) head/sysutils/puppetserver/distinfo (contents, props changed) head/sysutils/puppetserver/files/ head/sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf (contents, props changed) head/sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf (contents, props changed) head/sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf (contents, props changed) head/sysutils/puppetserver/files/patch-ext__config__logback.xml (contents, props changed) head/sysutils/puppetserver/files/patch-ext__config__request-logging.xml (contents, props changed) head/sysutils/puppetserver/files/pkg-message.in (contents, props changed) head/sysutils/puppetserver/files/puppetserver.in (contents, props changed) head/sysutils/puppetserver/pkg-descr (contents, props changed) head/sysutils/puppetserver/pkg-plist (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sat Mar 12 14:16:27 2016 (r410890) +++ head/sysutils/Makefile Sat Mar 12 14:30:00 2016 (r410891) @@ -774,6 +774,7 @@ SUBDIR += puppet37 SUBDIR += puppet38 SUBDIR += puppet4 + SUBDIR += puppetserver SUBDIR += pv SUBDIR += pwd_unmkdb SUBDIR += pwgen Added: head/sysutils/puppetserver/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/Makefile Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,76 @@ +# $FreeBSD$ + +PORTNAME= puppetserver +PORTVERSION= 2.2.1 +CATEGORIES= sysutils java +MASTER_SITES= http://downloads.puppetlabs.com/puppet/ + +MAINTAINER= xaque208@gmail.com +COMMENT= Puppet Server running in the JVM + +LICENSE= APACHE20 + +RUN_DEPENDS= bash>=0:${PORTSDIR}/shells/bash \ + puppet4>=0:${PORTSDIR}/sysutils/puppet4 +BUILD_DEPENDS= rubygem-rake>=0:${PORTSDIR}/devel/rubygem-rake + +USE_RC_SUBR= puppetserver + +USE_JAVA= yes +USE_RUBY= yes +NO_BUILD= yes +JAVA_VERSION= 1.7+ + +USERS= puppet +GROUPS= puppet + +SUB_LIST= JAVA_HOME=${JAVA_HOME} +SUB_FILES= pkg-message + +PKGMESSAGE= ${WRKDIR}/pkg-message + +OPTIONS_DEFAULT= RFACTER +OPTIONS_RADIO= FACTER +OPTIONS_RADIO_FACTER= CFACTER RFACTER + +RFACTER_DESC= Use facter 2.x (written in Ruby) +CFACTER_DESC= Use facter 3.x (experimental rewrite in C++) + +RFACTER_BUILD_DEPENDS= rubygem-facter>=2.0:${PORTSDIR}/sysutils/rubygem-facter +RFACTER_RUN_DEPENDS= rubygem-facter>=2.0:${PORTSDIR}/sysutils/rubygem-facter + +CFACTER_BUILD_DEPENDS= facter>=3.0:${PORTSDIR}/sysutils/facter +CFACTER_RUN_DEPENDS= facter>=3.0:${PORTSDIR}/sysutils/facter + +.include <bsd.port.options.mk> + +.include <bsd.port.pre.mk> + +post-patch: +.for file in ext/config/bootstrap.cfg ext/config/logback.xml \ + ext/config/request-logging.xml \ + ext/config/conf.d/global.conf ext/config/conf.d/puppetserver.conf \ + ext/config/conf.d/web-routes.conf ext/config/conf.d/webserver.conf \ + ext/config/conf.d/auth.conf + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/${file} + @${REINPLACE_CMD} -e "s|%%RUBY_SITELIBDIR%%|${RUBY_SITELIBDIR}|" ${WRKSRC}/${file} + @${REINPLACE_CMD} -e "s|%%RUBY_VER%%|${RUBY_VER}|" ${WRKSRC}/${file} +.endfor + +do-install: + ${MKDIR} ${STAGEDIR}${DATADIR} + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${MKDIR} ${STAGEDIR}${ETCDIR}/conf.d + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/puppet/code + ${MKDIR} ${STAGEDIR}/var/log/puppetserver + ${INSTALL_DATA} ${WRKSRC}/puppet-server-release.jar ${STAGEDIR}${DATADIR}/puppetserver.jar + ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/global.conf ${STAGEDIR}${ETCDIR}/conf.d/global.conf + ${INSTALL_DATA} ${WRKSRC}/ext/config/logback.xml ${STAGEDIR}${ETCDIR}/logback.xml + ${INSTALL_DATA} ${WRKSRC}/ext/config/bootstrap.cfg ${STAGEDIR}${ETCDIR}/bootstrap.cfg + ${INSTALL_DATA} ${WRKSRC}/ext/config/request-logging.xml ${STAGEDIR}${ETCDIR}/request-logging.xml + ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/puppetserver.conf ${STAGEDIR}${ETCDIR}/conf.d/puppetserver.conf + ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/web-routes.conf ${STAGEDIR}${ETCDIR}/conf.d/web-routes.conf + ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/webserver.conf ${STAGEDIR}${ETCDIR}/conf.d/webserver.conf + ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/auth.conf ${STAGEDIR}${ETCDIR}/conf.d/auth.conf + +.include <bsd.port.post.mk> Added: head/sysutils/puppetserver/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/distinfo Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,2 @@ +SHA256 (puppetserver-2.2.1.tar.gz) = 583662380b161fc35e0f0c5e7e2964892ec4b7e0cb848cadcd76b29684a85843 +SIZE (puppetserver-2.2.1.tar.gz) = 42665674 Added: head/sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,9 @@ +--- ext/config/conf.d/global.conf.orig 2015-10-27 16:22:06 UTC ++++ ext/config/conf.d/global.conf +@@ -1,5 +1,5 @@ + global: { + # Path to logback logging configuration file; for more + # info, see http://logback.qos.ch/manual/configuration.html +- logging-config: /etc/puppetlabs/puppetserver/logback.xml ++ logging-config: %%PREFIX%%/etc/puppetserver/logback.xml + } Added: head/sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,48 @@ +--- ext/config/conf.d/puppetserver.conf.orig 2015-10-27 17:03:52 UTC ++++ ext/config/conf.d/puppetserver.conf +@@ -2,11 +2,14 @@ + jruby-puppet: { + # Where the puppet-agent dependency places puppet, facter, etc... + # Puppet server expects to load Puppet from this location +- ruby-load-path: [/opt/puppetlabs/puppet/lib/ruby/vendor_ruby] ++ ruby-load-path: [ ++ %%RUBY_SITELIBDIR%%, ++ %%PREFIX%%/lib/ruby/gems/%%RUBY_VER%%/gems/facter-2.4.4/lib/, ++ ] + + # This setting determines where JRuby will look for gems. It is also + # used by the `puppetserver gem` command line tool. +- gem-home: /opt/puppetlabs/server/data/puppetserver/jruby-gems ++ gem-home: /var/puppet/server/data/puppetserver/jruby-gems + + + # PLEASE NOTE: Use caution when modifying the below settings. Modifying +@@ -22,23 +25,23 @@ + + # (optional) path to puppet conf dir; if not specified, will use + # /etc/puppetlabs/puppet +- master-conf-dir: /etc/puppetlabs/puppet ++ master-conf-dir: %%PREFIX%%/etc/puppet + + # (optional) path to puppet code dir; if not specified, will use + # /etc/puppetlabs/code +- master-code-dir: /etc/puppetlabs/code ++ master-code-dir: %%PREFIX%%/etc/puppet/code + + # (optional) path to puppet var dir; if not specified, will use + # /opt/puppetlabs/server/data/puppetserver +- master-var-dir: /opt/puppetlabs/server/data/puppetserver ++ master-var-dir: /var/puppet/server/data/puppetserver + + # (optional) path to puppet run dir; if not specified, will use + # /var/run/puppetlabs/puppetserver +- master-run-dir: /var/run/puppetlabs/puppetserver ++ master-run-dir: /var/run/puppetserver + + # (optional) path to puppet log dir; if not specified, will use + # /var/log/puppetlabs/puppetserver +- master-log-dir: /var/log/puppetlabs/puppetserver ++ master-log-dir: /var/log/puppetserver + + # (optional) maximum number of JRuby instances to allow + #max-active-instances: 1 Added: head/sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,9 @@ +--- ext/config/conf.d/webserver.conf.orig 2015-10-27 16:26:17 UTC ++++ ext/config/conf.d/webserver.conf +@@ -1,5 +1,5 @@ + webserver: { +- access-log-config = /etc/puppetlabs/puppetserver/request-logging.xml ++ access-log-config = %%PREFIX%%/etc/puppetserver/request-logging.xml + client-auth = want + ssl-host = 0.0.0.0 + ssl-port = 8140 Added: head/sysutils/puppetserver/files/patch-ext__config__logback.xml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/patch-ext__config__logback.xml Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,11 @@ +--- ext/config/logback.xml.orig 2015-10-27 16:40:33 UTC ++++ ext/config/logback.xml +@@ -7,7 +7,7 @@ + + <appender name="F1" class="ch.qos.logback.core.FileAppender"> + <!-- TODO: this path should not be hard-coded --> +- <file>/var/log/puppetlabs/puppetserver/puppetserver.log</file> ++ <file>/var/log/puppetserver/puppetserver.log</file> + <append>true</append> + <encoder> + <pattern>%d %-5p [%c{2}] %m%n</pattern> Added: head/sysutils/puppetserver/files/patch-ext__config__request-logging.xml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/patch-ext__config__request-logging.xml Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,10 @@ +--- ext/config/request-logging.xml.orig 2015-10-27 16:40:09 UTC ++++ ext/config/request-logging.xml +@@ -1,6 +1,6 @@ + <configuration debug="false" scan="true"> + <appender name="FILE" class="ch.qos.logback.core.FileAppender"> +- <file>/var/log/puppetlabs/puppetserver/puppetserver-access.log</file> ++ <file>/var/log/puppetserver/puppetserver-access.log</file> + <encoder> + <pattern>%h %l %u %user %date "%r" %s %b %h %a %localPort %D</pattern> + </encoder> Added: head/sysutils/puppetserver/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/pkg-message.in Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1 @@ +Remember to add puppetserver_enable="YES" to rc.conf. Added: head/sysutils/puppetserver/files/puppetserver.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/files/puppetserver.in Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,82 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: puppetserver +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Configuration settings for puppetserver in /etc/rc.conf: +# +# puppetserver_enable (bool): +# Set to "NO" by default. +# Set it to "YES" to enable puppetserver +# +# puppetserver_args (str): +# Extra arguments passed to start command +# +# puppetserver_java_home (str): +# Set to "%%JAVA_HOME%%" by default. +# Set the Java virtual machine to run puppetserver +# +# puppetserver_java_opts (str): +# Set to "" by default. +# Java VM args to use. +# +# puppetserver_user (str): +# Set to "puppet" by default. +# User to run puppetserver as. +# +# puppetserver_group (str): +# Set to "puppet" by default. +# Group for data file ownership. +# +# puppetserver_log_file (str): +# Set to "/var/log/puppetserver/puppetserver.log" by default. +# Log file location. +# + +. /etc/rc.subr + +name="puppetserver" +rcvar=puppetserver_enable + +load_rc_config "${name}" + +: ${puppetserver_enable="NO"} +: ${puppetserver_args="--config %%PREFIX%%/etc/puppetserver/conf.d -b %%PREFIX%%/etc/puppetserver/bootstrap.cfg"} +: ${puppetserver_java_home="%%JAVA_HOME%%"} +: ${puppetserver_user="puppet"} +: ${puppetserver_group="puppet"} +: ${puppetserver_log_file="/var/log/puppetserver/puppetserver.log"} + +pidfile="/var/run/puppetserver/puppetserver.pid" +command="/usr/sbin/daemon" +java_cmd="${puppetserver_java_home}/bin/java" +procname="${java_cmd}" +command_args="-p ${pidfile} ${java_cmd} -cp %%DATADIR%%/puppetserver.jar clojure.main -m puppetlabs.trapperkeeper.main ${puppetserver_args} > ${puppetserver_log_file} 2>&1" + + +required_files="${java_cmd}" + +start_precmd="puppetserver_prestart" + +puppetserver_prestart() { + if [ ! -f "${puppetserver_log_file}" ]; then + touch "${puppetserver_log_file}" + chown "${puppetserver_user}:${puppetserver_group}" "${puppetserver_log_file}" + chmod 640 "${puppetserver_log_file}" + fi + if [ ! -d "/var/run/puppetserver" ]; then + install -d -o "${puppetserver_user}" -g "${puppetserver_group}" -m 750 "/var/run/puppetserver" + fi + + chown -R "root:${puppetserver_group}" "%%PREFIX%%/etc/puppetserver/conf.d" + chmod 0750 "%%PREFIX%%/etc/puppetserver/conf.d" + + chown "root:${puppetserver_group}" "%%PREFIX%%/etc/puppetserver/logback.xml" + chmod 0640 "%%PREFIX%%/etc/puppetserver/logback.xml" +} + +run_rc_command "$1" Added: head/sysutils/puppetserver/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/pkg-descr Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,13 @@ +Puppet master is a Ruby application that compiles configurations +for any number of Puppet agent nodes, using Puppet code and various +other data sources. (For more info, see Overview of Puppet's +Architecture.) + +Puppet Server is an application that runs on the Java Virtual Machine +(JVM) and provides the same services as the classic Puppet master +application. It mostly does this by running the existing Puppet +master code in several JRuby interpreters, but it replaces some +parts of the classic application with new services written in +Clojure. + +WWW: https://docs.puppetlabs.com/puppetserver/latest/services_master_puppetserver.html Added: head/sysutils/puppetserver/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/puppetserver/pkg-plist Sat Mar 12 14:30:00 2016 (r410891) @@ -0,0 +1,14 @@ +%%ETCDIR%%/logback.xml +%%ETCDIR%%/bootstrap.cfg +%%ETCDIR%%/request-logging.xml +%%ETCDIR%%/conf.d/global.conf +%%ETCDIR%%/conf.d/puppetserver.conf +%%ETCDIR%%/conf.d/web-routes.conf +%%ETCDIR%%/conf.d/webserver.conf +%%ETCDIR%%/conf.d/auth.conf +%%DATADIR%%/puppetserver.jar +@mode 0750 +@group puppet +@dir etc/puppet/code +@owner puppet +@dir /var/log/puppetserver
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603121430.u2CEU16P082427>