amiral 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
1
+ require 'popen4'
2
+
3
+ module Amiral
4
+ module Providers
5
+ class PuppetUpdate
6
+ def execute message
7
+ out = err = short = nil
8
+
9
+ module = ""
10
+ if message['command']['args'].length > 0
11
+ module = message['command']['args'][0]
12
+ end
13
+
14
+ Dir.chdir '/etc/puppet' do
15
+ status = POpen4::popen4("git pull && librarian-puppet update #{module}"){|stdout,stderr,stdin,pid|
16
+ out = stdout.read
17
+ err = stderr.read
18
+ }
19
+ short = "unknown status"
20
+ end
21
+ if status.exitstatus == 0
22
+ short = "updated puppet and modules"
23
+ else
24
+ short = "encountered errors while updating puppet"
25
+ end
26
+ {
27
+ :exit => status.exitstatus,
28
+ :status => status,
29
+ :short => short,
30
+ :out => out,
31
+ :err => err
32
+ }
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,5 +1,6 @@
1
1
  require 'amiral/providers/uptime'
2
2
  require 'amiral/providers/puppet-agent'
3
+ require 'amiral/providers/puppet-update'
3
4
  require 'amiral/providers/service'
4
5
  require 'amiral/providers/apt-update'
5
6
  require 'amiral/providers/ping'
@@ -16,6 +17,7 @@ module Amiral
16
17
  "provider-list" => Amiral::Providers::ProviderList,
17
18
  "ping" => Amiral::Providers::Ping,
18
19
  "puppet-agent" => Amiral::Providers::PuppetAgent,
20
+ "puppet-update" => Amiral::Providers::PuppetUpdate,
19
21
  "apt-update" => Amiral::Providers::AptGetUpdate,
20
22
  "service" => Amiral::Providers::Service,
21
23
  "last-line" => Amiral::Providers::LastLine,
@@ -1,3 +1,3 @@
1
1
  module Amiral
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amiral
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-30 00:00:00.000000000 Z
12
+ date: 2013-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -135,6 +135,7 @@ files:
135
135
  - lib/amiral/providers/ping.rb
136
136
  - lib/amiral/providers/provider-list.rb
137
137
  - lib/amiral/providers/puppet-agent.rb
138
+ - lib/amiral/providers/puppet-update.rb
138
139
  - lib/amiral/providers/service.rb
139
140
  - lib/amiral/providers/uptime.rb
140
141
  - lib/amiral/version.rb