lita-puppet 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/puppet.rb +13 -1
- data/lita-puppet.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74f14f63bbb88c1f79aa44caa0555802f90c3c3c
|
4
|
+
data.tar.gz: 37d828c7b031c2a3a6680eda01256fe556e6b435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e40db9417df26a0640e0b753d917cd215f2d1f8538b4b155df02fca324e84ee22e5c2b2629330a55e43763a24b975ffd9d03424813e91550ced3dd7bafdf2bc4
|
7
|
+
data.tar.gz: 17c70bacceb0b49fba1dddee48c5cd81a5185af8f7deb6e0f06b2ddd651acb2c45b94601d31ec35f309b9d8c7d653c4c7b3114b3a2ece5baf3876031a29e3b72
|
data/lib/lita/handlers/puppet.rb
CHANGED
@@ -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
|
-
|
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