[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585
James Turnbull
james at lovedthanlost.net
Fri Jan 23 14:20:48 UTC 2009
The following commit has been merged in the master branch:
commit b1ad596ec0aa3158d70f84d5b1e002f972d3ec71
Author: AJ Christensen <aj at junglist.gen.nz>
Date: Fri Aug 8 21:48:18 2008 +1200
Add the -P/--ping option to puppetrun, fixes #1501
Turns on the ICMP echo testing against the target host. Defaults to off.
111111111
diff --git a/CHANGELOG b/CHANGELOG
index 454f314..f1284ae 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
0.24.x
+ Add the -P/--ping option to puppetrun, fixes #1501
+
Fixed #1394 - Added stored configuration clearing script to /ext
Fixed #1442 - replaced use of Facter for report titling with certname
diff --git a/bin/puppetrun b/bin/puppetrun
index f1e3024..f33c7f8 100755
--- a/bin/puppetrun
+++ b/bin/puppetrun
@@ -9,7 +9,7 @@
#
# puppetrun [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground]
# [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules]
-# [-t|--tag <tag>] [--test]
+# [-t|--tag <tag>] [--test] [-p|--ping]
#
# = Description
#
@@ -108,6 +108,10 @@
# Print the hosts you would connect to but do not actually connect. This
# option requires LDAP support at this point.
#
+# ping::
+#
+# Do a ICMP echo against the target host. Skip hosts that don't respond to ping.
+#
# = Example
#
# sudo puppetrun -p 10 --host host1 --host host2 -t remotefile -t webserver
@@ -154,6 +158,7 @@ flags = [
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--host", GetoptLong::REQUIRED_ARGUMENT ],
[ "--parallel", "-p", GetoptLong::REQUIRED_ARGUMENT ],
+ [ "--ping", "-P", GetoptLong::NO_ARGUMENT ],
[ "--no-fqdn", "-n", GetoptLong::NO_ARGUMENT ],
[ "--test", GetoptLong::NO_ARGUMENT ],
[ "--version", "-V", GetoptLong::NO_ARGUMENT ]
@@ -168,6 +173,7 @@ options = {
:ignoreschedules => false,
:foreground => false,
:parallel => 1,
+ :ping => false,
:debug => false,
:test => false,
:all => false,
@@ -215,6 +221,8 @@ begin
$stderr.puts "Could not convert %s to an integer" % arg.inspect
exit(23)
end
+ when "--ping"
+ options[:ping] = true
when "--foreground"
options[:foreground] = true
when "--debug"
@@ -294,12 +302,12 @@ while go
if children.length < options[:parallel] and ! todo.empty?
host = todo.shift
pid = fork do
- # First make sure the client is up
- out = %x{ping -c 1 #{host}}
-
- unless $? == 0
- $stderr.print "Could not contact %s\n" % host
- next
+ if options[:ping]
+ out = %x{ping -c 1 #{host}}
+ unless $? == 0
+ $stderr.print "Could not contact %s\n" % host
+ next
+ end
end
client = Puppet::Network::Client.runner.new(
:Server => host,
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list