lita-puppet 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 424717086cabdb4281ada12708aa42ff8f788bd7
4
- data.tar.gz: 130a80847876000d53c6bffaf27111534b584bd7
3
+ metadata.gz: 74f14f63bbb88c1f79aa44caa0555802f90c3c3c
4
+ data.tar.gz: 37d828c7b031c2a3a6680eda01256fe556e6b435
5
5
  SHA512:
6
- metadata.gz: 12041f29bf1fcb457e4e0222a2f5773186e31d63887e984e6cd2e7d709cd2d658bc8242712fe2407e848bc7c4b13b47e0efd621ce9c127f709d900b754bab877
7
- data.tar.gz: ab24030d11f7ab7352bd07092389a2c2b6bd8d1162f390ed762e8840cbbb0afccdbbd7d2dffb29610a1ca656fbd8bfed1ac75c035ae6af8180ac353ad6d0a0c3
6
+ metadata.gz: e40db9417df26a0640e0b753d917cd215f2d1f8538b4b155df02fca324e84ee22e5c2b2629330a55e43763a24b975ffd9d03424813e91550ced3dd7bafdf2bc4
7
+ data.tar.gz: 17c70bacceb0b49fba1dddee48c5cd81a5185af8f7deb6e0f06b2ddd651acb2c45b94601d31ec35f309b9d8c7d653c4c7b3114b3a2ece5baf3876031a29e3b72
@@ -34,6 +34,8 @@ module Lita
34
34
 
35
35
  ret = nil
36
36
 
37
+ # TODO: better error handling
38
+
37
39
  Timeout::timeout(600) do
38
40
  puppet_master = Rye::Box.new(config.master_hostname, user: user)
39
41
  puppet_master.cd control_repo
@@ -70,6 +72,8 @@ module Lita
70
72
 
71
73
  ret = nil
72
74
 
75
+ # TODO: better error handling
76
+
73
77
  Timeout::timeout(300) do
74
78
  remote = Rye::Box.new(host, user: user)
75
79
  remote.cd '/tmp'
@@ -80,13 +84,21 @@ module Lita
80
84
  # scary...
81
85
  remote.disable_safe_mode
82
86
 
83
- ret = remote.execute 'puppet agent -t'
87
+ # build up the command
88
+ command = 'puppet agent'
89
+ command << ' --verbose --no-daemonize'
90
+ command << ' --no-usecacheonfailure'
91
+ command << ' --no-splay --show_diff'
92
+
93
+ ret = remote.execute command
84
94
  remote.disconnect
85
95
  end
86
96
 
87
97
  # build a reply
88
98
  if ret
89
99
  response.reply "#{username}, that puppet run is complete! It exited with status #{ret.exit_status}."
100
+ # Send the standard out, but strip off the bash color code stuff...
101
+ response.reply "/code " + ret.stdout.join("\n").gsub(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/, '')
90
102
  else
91
103
  response.reply "#{username}, your puppet run is done, but didn't seem to work... I think it may have timed out."
92
104
  end
data/lita-puppet.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-puppet"
3
- spec.version = "0.2.0"
3
+ spec.version = "0.2.1"
4
4
  spec.authors = ["Jonathan Gnagy"]
5
5
  spec.email = ["jgnagy@knuedge.com"]
6
6
  spec.description = "Some basic Puppet interactions for Lita"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy