Commit d0c50029 authored by mh's avatar mh
Browse files

initial release of extensions repo

parents
BUILD*
*RPMS
# configuration for the JRuby interpreters
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]
# 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
# PLEASE NOTE: Use caution when modifying the below settings. Modifying
# these settings will change the value of the corresponding Puppet settings
# for Puppet Server, but not for the Puppet CLI tools. This likely will not
# be a problem with master-var-dir, master-run-dir, or master-log-dir unless
# some critical setting in puppet.conf is interpolating the value of one
# of the corresponding settings, but it is important that any changes made to
# master-conf-dir and master-code-dir are also made to the corresponding Puppet
# settings when running the Puppet CLI tools. See
# https://docs.puppetlabs.com/puppetserver/latest/puppet_conf_setting_diffs.html#overriding-puppet-settings-in-puppet-server
# for more information.
# (optional) path to puppet conf dir; if not specified, will use
# /etc/puppetlabs/puppet
master-conf-dir: ./puppet
# (optional) path to puppet code dir; if not specified, will use
# /etc/puppetlabs/code
master-code-dir: ./code
# (optional) path to puppet var dir; if not specified, will use
# /opt/puppetlabs/server/data/puppetserver
master-var-dir: ./data-puppetserver
# (optional) path to puppet run dir; if not specified, will use
# /var/run/puppetlabs/puppetserver
master-run-dir: ./run-puppetserver
# (optional) path to puppet log dir; if not specified, will use
# /var/log/puppetlabs/puppetserver
master-log-dir: ./log-puppetserver
# (optional) maximum number of JRuby instances to allow
#max-active-instances: 1
# (optional) Authorize access to Puppet master endpoints via rules specified
# in the legacy Puppet auth.conf file (if true or not specified) or via rules
# specified in the Puppet Server HOCON-formatted auth.conf (if false).
#use-legacy-auth-conf: false
}
# settings related to HTTP client requests made by Puppet Server
http-client: {
# A list of acceptable protocols for making HTTP requests
#ssl-protocols: [TLSv1, TLSv1.1, TLSv1.2]
# A list of acceptable cipher suites for making HTTP requests
#cipher-suites: [TLS_RSA_WITH_AES_256_CBC_SHA256,
# TLS_RSA_WITH_AES_256_CBC_SHA,
# TLS_RSA_WITH_AES_128_CBC_SHA256,
# TLS_RSA_WITH_AES_128_CBC_SHA]
}
# settings related to profiling the puppet Ruby code
profiler: {
# enable or disable profiling for the Ruby code; defaults to 'false'.
#enabled: true
}
%if 0%{?_version:1}
%define _verstr %{_version}
%else
%define _verstr 0.0.1
%endif
%define checkout %(date +%Y%m%d)
%define agentdir /opt/puppetlabs/puppet
%define agentgemdir %{agentdir}/lib/ruby/gems/2.4.0/
%define servergemdir /opt/puppetlabs/server/data/puppetserver/jruby-gems
Name: puppet-extensions
Version: %{_verstr}
Release: 1
Summary: Extension for the puppet-agent or puppetserver.
License: GPLv3
Source0: puppetserver.conf
BuildRequires: puppet-agent >= 5.0
BuildRequires: puppetserver >= 5.0
%description
A set of gems for puppet agent & server
Requires: puppet-agent >= 5.0
%filter_requires_in %agentgemdir
%filter_setup
%package -n puppet-agent-extensions
Summary: Extension for the puppet-agent.
Requires: puppet-agent >= 5.0
%description -n puppet-agent-extensions
A set of gem extensions packaged for the puppet-agent.
%package -n puppetserver-extensions
Summary: Extension for the puppetserver.
Requires: puppetserver >= 5.0
%description -n puppetserver-extensions
A set of gem extensions packaged for the puppetserver.
%prep
mkdir server_config
cp %{SOURCE0} server_config
mkdir -p ~/.puppetlabs/etc/puppet
echo -e "[master]\nconfdir=~/puppet\ncodedir=~/puppetcode" > ~/.puppetlabs/etc/puppet/puppet.conf
%build
/opt/puppetlabs/puppet/bin/gem install --lock --install-dir ./agent_gems --no-ri --no-rdoc -N trocla iuid
# so it picks up the right config
export JAVA_BIN=/usr/bin/java
export JAVA_ARGS='-Xms2g -Xmx2g -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger'
export USER=puppet
export GROUP=puppet
export INSTALL_DIR=/opt/puppetlabs/server/apps/puppetserver
export SERVICE_STOP_RETRIES=60
export START_TIMEOUT=300
export RELOAD_TIMEOUT=120
export CLASSPATH=${INSTALL_DIR}/puppet-server-release.jar
export JRUBY_JAR="${JRUBY_JAR:-${INSTALL_DIR}/jruby-1_7.jar}"
export CLASSPATH="${CLASSPATH}:${JRUBY_JAR}"
export CONFIG=./server_config
"${JAVA_BIN}" $JAVA_ARGS_CLI -Djava.security.egd=/dev/urandom \
-cp "$CLASSPATH" \
clojure.main -m puppetlabs.puppetserver.cli.gem \
--config ./server_config -- install --lock --install-dir ./server_gems --no-ri --no-rdoc -N trocla iuid
%install
mkdir -p %{buildroot}%{agentgemdir}
for d in specifications gems extensions; do
mv ./agent_gems/${d} %{buildroot}%{agentgemdir}/
done
mv ./agent_gems/bin %{buildroot}%{agentdir}/bin
mkdir -p %{buildroot}%{servergemdir}
for d in bin specifications gems; do
mv ./server_gems/${d} %{buildroot}%{servergemdir}/
done
%files -n puppet-agent-extensions
%defattr(-,root,root,-)
%{agentdir}/bin/trocla
%{agentdir}/bin/iuid
%{agentgemdir}/specifications/*
%{agentgemdir}/extensions/*
%{agentgemdir}/gems/*
%files -n puppetserver-extensions
%defattr(-,root,root,-)
%{servergemdir}/*
%changelog
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment