puppet-pssh 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +17 -3
  2. data/lib/puppet-pssh.rb +8 -2
  3. metadata +1 -1
data/README.md CHANGED
@@ -17,14 +17,28 @@ The command has a built-in help:
17
17
  The run command:
18
18
 
19
19
  puppet-pssh run --puppetmaster 192.168.1.1 \
20
- --match 'openstack|swift|compute' \
20
+ --match 'openstack-compute' \
21
21
  --nameserver 10.0.0.1 \
22
22
  --no-host-key-verify \
23
+ --threads 20 \ # use up to 20 threads
23
24
  puppet agent -t
24
25
 
25
- This will run the command 'puppet agent -t' on every node whose FQDN matches /openstack|swift|compute/ (regexp). It will try to resolve node names using DNS server 10.0.0.1 and use the IP address instead.
26
- Also, SSH host key verification also is disabled.
26
+ This will run the command 'puppet agent -t' on every node whose FQDN matches /openstack-compute/ (regexp). It will try to resolve node names using DNS server 10.0.0.1 and use the IP address instead.
27
+ Also, SSH host key verification has been disabled.
27
28
 
29
+ # Tips
30
+
31
+ Clean node's /var/lib/puppet and revoke node cert on master also:
32
+
33
+ # Clean /var/lib/puppet in node
34
+ puppet-pssh run 'find /var/lib/puppet -type f|xargs rm'
35
+ # Revoke cert (this will run in the node!)
36
+ puppet-pssh run 'curl -k -X PUT -H "Content-Type: text/pson" --data '\''{"desired_state":"revoked"}'\'' https://puppetmaster.devel.bvox.net:8140/development/certificate_status/`hostname -f`'
37
+ puppet-pssh run 'curl -k -X DELETE -H "Accept: pson" https://puppetmaster.devel.bvox.net:8140/development/certificate_status/`hostname -f`'
38
+
39
+ Your puppet master's auth.conf will need some rules for this to work. See:
40
+
41
+ http://www.mail-archive.com/puppet-users@googlegroups.com/msg35412.html
28
42
 
29
43
  # Copyright
30
44
 
data/lib/puppet-pssh.rb CHANGED
@@ -7,7 +7,7 @@ require 'colored'
7
7
 
8
8
  module PuppetPSSH
9
9
 
10
- VERSION = "0.1.1"
10
+ VERSION = "0.1.2"
11
11
 
12
12
  if !defined? Log or Log.nil?
13
13
  Log = Logger.new($stdout)
@@ -17,7 +17,7 @@ module PuppetPSSH
17
17
  else
18
18
  severity = severity.red.bold if severity == 'ERROR'
19
19
  severity = severity.yellow.bold if severity == 'WARN'
20
- "#{Time.now.to_i} #{severity}: #{msg}\n"
20
+ "*".bold.cyan + " #{severity}: #{msg}\n"
21
21
  end
22
22
  end
23
23
  Log.level = Logger::INFO unless (ENV["DEBUG"].eql? "yes" or ENV["DEBUG"].eql? 'true')
@@ -85,6 +85,7 @@ module PuppetPSSH
85
85
  option ["-o", "--node-output-path"], "NODE_OUTPUT_PATH", "Save host list to path", :default => '/tmp/'
86
86
  option "--[no-]host-key-verify", :flag, "Verify SSH host key", :default => true
87
87
  option "--threads", "THREADS", "Use up to N threads", :default => 40
88
+ option "--cached-hostlist", :flag, "Use cached hostlist", :default => false
88
89
 
89
90
  def execute
90
91
  unless File.exist?(pssh_path)
@@ -101,6 +102,11 @@ module PuppetPSSH
101
102
  exit 1
102
103
  end
103
104
 
105
+ # Delete previous hostlist unless specified otherwise
106
+ unless cached_hostlist?
107
+ File.delete hostlist_path if File.exist?(hostlist_path)
108
+ end
109
+
104
110
  unless File.exist?(hostlist_path)
105
111
  Log.info "Generating hostlist..."
106
112
  Log.debug "Hostlist path: #{hostlist_path}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-pssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: