summaryrefslogtreecommitdiffstats
path: root/recipes-support/puppet/puppet/puppet.init
diff options
context:
space:
mode:
authorPablo Saavedra <psaavedra@igalia.com>2018-02-15 23:33:24 +0100
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-02-20 17:05:27 -0500
commitaae8b860aa07b249ec85cfa6031043950df462c7 (patch)
tree103ae91ea58bbc156f62f881880d8be5cce97f61 /recipes-support/puppet/puppet/puppet.init
parent992463503e844fe40f3bb2a56df5db0cb715942e (diff)
downloadmeta-cloud-services-aae8b860aa07b249ec85cfa6031043950df462c7.tar.gz
Puppet upstream upgrade to 5.4.0
* Upstream to 5.4.0 [1][2][3][4][5] * Puppet 5 recipe is the official Puppet agent version with support for Ruby 2.4 [6] * Updated reference versions in the README file * Hiera isn’t separate from Puppet anymore [7]. * Do not install extlookup2hiera, it has been removed upstream * Hiera began as an independent Ruby library that worked with Puppet. Over time, it became a requirement and was even included in the puppet-agent package, but it was limited by its original design. * Removed puppet_3.7.3.bb recipe * Drop the superseded patches * Added init script * Added systemd script Facter 2.5 upstream release * Puppet 5 relays on Facter 3.10. Facter 3.10 reworks Facter 2.X code [8] in native code instead of Ruby gem. Facter 2.5 is still compatible with 5 series to help with Puppet 5 testing. * facter before 2.4.0 uses a deprecated Puppet settings API making `facter --puppet` no longer work with Puppet 4 or higher [9]. * Community, partner, and some of Puppet's internal testing workflows continue to use (ruby) Facter 2.4 [10], instead of native Facter 3, which is not (yet) available as a gem. * To help with Puppet 5 testing, we need to do a maintenance release in the Facter 2 series. [1] https://docs.puppet.com/puppet/5.0/release_notes.html [2] https://docs.puppet.com/puppet/5.1/release_notes.html [3] https://docs.puppet.com/puppet/5.2/release_notes.html [4] https://docs.puppet.com/puppet/5.3/release_notes.html [5] https://docs.puppet.com/puppet/5.4/release_notes.html [6] https://puppet.com/docs/puppet/4.10/hiera_intro.html [7] https://tickets.puppetlabs.com/browse/PA-1107 [8] https://github.com/puppetlabs/facter/tree/3.10.x [9] http://metadata.ftp-master.debian.org/changelogs/main/p/puppet/puppet_5.1.0-1_changelog [10] https://tickets.puppetlabs.com/browse/FACT-1630 Signed-off-by: Pablo Saavedra <psaavedra@igalia.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-support/puppet/puppet/puppet.init')
-rw-r--r--recipes-support/puppet/puppet/puppet.init72
1 files changed, 72 insertions, 0 deletions
diff --git a/recipes-support/puppet/puppet/puppet.init b/recipes-support/puppet/puppet/puppet.init
new file mode 100644
index 0000000..64ab32e
--- /dev/null
+++ b/recipes-support/puppet/puppet/puppet.init
@@ -0,0 +1,72 @@
1#!/bin/bash
2#
3# chkconfig: 35 20 80
4# description: The puppet agent connects to a puppet master, requests a
5# catalog of resources, and configures the local system.
6#
7
8# Get function from functions library
9. /etc/init.d/functions
10
11PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
12DAEMON=/usr/bin/puppet
13DAEMON_OPTS="agent --server master --no-daemonize"
14NAME="agent"
15DESC="puppet agent"
16PIDFILE="/var/run/${NAME}.pid"
17PID=`test -f $PIDFILE && cat $PIDFILE`
18RETVAL=0
19
20test -x $DAEMON || exit 0
21
22[ -r /etc/default/puppet ] && . /etc/default/puppet
23
24reload_puppet_agent() {
25 start-stop-daemon --stop --quiet --signal HUP --pidfile $PIDFILE
26}
27
28start_puppet_agent() {
29 start-stop-daemon --start --quiet --pidfile $PIDFILE \
30 --startas $DAEMON -- $NAME $DAEMON_OPTS
31}
32
33stop_puppet_agent() {
34 start-stop-daemon --stop --retry TERM/10/KILL/5 --quiet --oknodo --pidfile $PIDFILE
35}
36
37status_puppet_agent() {
38 status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
39}
40
41case "$1" in
42 start)
43 echo -n "Starting $DESC"
44 start_puppet_agent
45 log_end_msg $?
46 ;;
47 stop)
48 echo -n "Stopping $DESC"
49 stop_puppet_agent
50 log_end_msg $?
51 ;;
52 reload)
53 echo -n "Reloading $DESC"
54 reload_puppet_agent
55 log_end_msg $?
56 ;;
57 status)
58 status_puppet_agent
59 ;;
60 restart|force-reload)
61 echo -n "Restarting $DESC"
62 stop_puppet_agent
63 start_puppet_agent
64 log_end_msg $?
65 ;;
66*)
67 echo "Usage: $0 {start|stop|status|restart|force-reload|reload}" >&2
68 exit 1
69 ;;
70esac
71
72exit 0