specinfra 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/exec.rb +14 -2
- data/lib/specinfra/command/fedora.rb +29 -0
- data/lib/specinfra/command/redhat7.rb +9 -0
- data/lib/specinfra/command.rb +2 -0
- data/lib/specinfra/helper/os.rb +2 -0
- data/lib/specinfra/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70f7556e9dcace36186080224bef836c802b3fcf
|
4
|
+
data.tar.gz: ae8e0d6ece4a05af3cf412d192e2037f2d2560c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 407b914ed6cac6229abef08620af2f46e03742bc8ff3ea4a06710b6576af9a64f77844ac31ab51787b7e77d65b9b37f0d0849ec24fa52004bcab03f41b131188
|
7
|
+
data.tar.gz: 48b97124a501b9b53b1ea54f6713b6414aef318da473a2fa09d090a09744e8c5a9165963c063620ee5d841bd6557abd890c16a46e01c41b2e75134e8c82cfce1
|
@@ -181,12 +181,24 @@ module SpecInfra
|
|
181
181
|
|
182
182
|
def check_os
|
183
183
|
return SpecInfra.configuration.os if SpecInfra.configuration.os
|
184
|
-
|
184
|
+
# Fedora also has an /etc/redhat-release so the Fedora check must
|
185
|
+
# come before the RedHat check
|
186
|
+
if run_command('ls /etc/fedora-release').success?
|
187
|
+
line = run_command('cat /etc/redhat-release').stdout
|
188
|
+
if line =~ /release (\d[\d]*)/
|
189
|
+
release = $1
|
190
|
+
end
|
191
|
+
{ :family => 'Fedora', :release => release }
|
192
|
+
elsif run_command('ls /etc/redhat-release').success?
|
185
193
|
line = run_command('cat /etc/redhat-release').stdout
|
186
194
|
if line =~ /release (\d[\d.]*)/
|
187
195
|
release = $1
|
188
196
|
end
|
189
|
-
|
197
|
+
if release =~ /7./
|
198
|
+
{ :family => 'RedHat7', :release => release }
|
199
|
+
else
|
200
|
+
{ :family => 'RedHat', :release => release }
|
201
|
+
end
|
190
202
|
elsif run_command('ls /etc/system-release').success?
|
191
203
|
{ :family => 'RedHat', :release => nil } # Amazon Linux
|
192
204
|
elsif run_command('ls /etc/SuSE-release').success?
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SpecInfra
|
2
|
+
module Command
|
3
|
+
class Fedora < RedHat
|
4
|
+
def check_enabled(service, target="multi-user.target")
|
5
|
+
host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
|
6
|
+
if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
|
7
|
+
super
|
8
|
+
else
|
9
|
+
# Fedora 15+ uses systemd which no longer has runlevels but targets
|
10
|
+
# For backwards compatibility, Fedora provides pseudo targets for
|
11
|
+
# runlevels
|
12
|
+
if target.is_a? Integer
|
13
|
+
target = "runlevel#{target}.target"
|
14
|
+
end
|
15
|
+
"systemctl --plain list-dependencies #{target} | grep '^#{escape(service)}.service$'"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def check_running(service)
|
20
|
+
host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
|
21
|
+
if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
|
22
|
+
super
|
23
|
+
else
|
24
|
+
"systemctl is-active #{escape(service)}.service"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/specinfra/command.rb
CHANGED
@@ -8,7 +8,9 @@ require "specinfra/command/ubuntu"
|
|
8
8
|
require "specinfra/command/gentoo"
|
9
9
|
require "specinfra/command/plamo"
|
10
10
|
require "specinfra/command/redhat"
|
11
|
+
require "specinfra/command/redhat7"
|
11
12
|
require "specinfra/command/suse"
|
13
|
+
require "specinfra/command/fedora"
|
12
14
|
|
13
15
|
# Solaris
|
14
16
|
require "specinfra/command/solaris"
|
data/lib/specinfra/helper/os.rb
CHANGED
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- lib/specinfra/command/base.rb
|
126
126
|
- lib/specinfra/command/darwin.rb
|
127
127
|
- lib/specinfra/command/debian.rb
|
128
|
+
- lib/specinfra/command/fedora.rb
|
128
129
|
- lib/specinfra/command/freebsd.rb
|
129
130
|
- lib/specinfra/command/freebsd10.rb
|
130
131
|
- lib/specinfra/command/gentoo.rb
|
@@ -132,6 +133,7 @@ files:
|
|
132
133
|
- lib/specinfra/command/openbsd.rb
|
133
134
|
- lib/specinfra/command/plamo.rb
|
134
135
|
- lib/specinfra/command/redhat.rb
|
136
|
+
- lib/specinfra/command/redhat7.rb
|
135
137
|
- lib/specinfra/command/smartos.rb
|
136
138
|
- lib/specinfra/command/solaris.rb
|
137
139
|
- lib/specinfra/command/solaris10.rb
|