specinfra-cisco 2.40.2 → 2.41.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/command.rb +12 -0
- data/lib/specinfra/command/ios_xr.rb +1 -0
- data/lib/specinfra/command/ios_xr/base.rb +2 -0
- data/lib/specinfra/command/ios_xr/base/file.rb +8 -0
- data/lib/specinfra/command/ios_xr/base/host.rb +2 -0
- data/lib/specinfra/command/ios_xr/base/iptables.rb +2 -0
- data/lib/specinfra/command/ios_xr/base/package.rb +30 -0
- data/lib/specinfra/command/ios_xr/base/port.rb +5 -0
- data/lib/specinfra/command/ios_xr/base/service.rb +2 -0
- data/lib/specinfra/command/ios_xr/base/yumrepo.rb +11 -0
- data/lib/specinfra/command/ios_xr/v7.rb +3 -0
- data/lib/specinfra/helper/detect_os.rb +1 -0
- data/lib/specinfra/helper/detect_os/ios_xr.rb +14 -0
- data/lib/specinfra/version.rb +1 -1
- data/specinfra-cisco.gemspec +1 -1
- metadata +14 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a991ffaf12d256b0704f96f536017f6ef0638a5e
|
4
|
+
data.tar.gz: eff125e85bbaaed2631d31dd1221ef4714278193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 581f33a0c5e989ea93d5eb0d35655e830d8557247e14805d35d2a470ed121a5c64ba7348f09a9bef6b8a3aedca3068b5211c542ebc27e87f7429587c3e660e8e
|
7
|
+
data.tar.gz: 31ff5ea8d56e503a5a53fd30745b8331f9a2a26807018c03178e54548071cf7768378a27dd4d2ba39381f6a75373e27735fc6eb2884f0a24a100dffd47510453
|
data/lib/specinfra/command.rb
CHANGED
@@ -218,6 +218,18 @@ require 'specinfra/command/nexus/base/port'
|
|
218
218
|
require 'specinfra/command/nexus/base/package'
|
219
219
|
require 'specinfra/command/nexus/base/yumrepo'
|
220
220
|
|
221
|
+
# IOS-XR (inherit Linux)
|
222
|
+
require 'specinfra/command/ios_xr'
|
223
|
+
require 'specinfra/command/ios_xr/base'
|
224
|
+
require 'specinfra/command/ios_xr/base/host'
|
225
|
+
require 'specinfra/command/ios_xr/base/file'
|
226
|
+
require 'specinfra/command/ios_xr/base/host'
|
227
|
+
require 'specinfra/command/ios_xr/base/iptables'
|
228
|
+
require 'specinfra/command/ios_xr/base/service'
|
229
|
+
require 'specinfra/command/ios_xr/base/port'
|
230
|
+
require 'specinfra/command/ios_xr/base/package'
|
231
|
+
require 'specinfra/command/ios_xr/base/yumrepo'
|
232
|
+
|
221
233
|
# FreeBSD (inherit Base)
|
222
234
|
require 'specinfra/command/freebsd'
|
223
235
|
require 'specinfra/command/freebsd/base'
|
@@ -0,0 +1 @@
|
|
1
|
+
class Specinfra::Command::Ios_xr;end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class Specinfra::Command::Ios_xr::Base::Package < Specinfra::Command::Linux::Base::Package
|
2
|
+
class << self
|
3
|
+
def check_is_installed(package, version=nil)
|
4
|
+
cmd = "rpm -q #{escape(package)}"
|
5
|
+
if version
|
6
|
+
cmd = "#{cmd} | grep -w -- #{escape(package)}-#{escape(version)}"
|
7
|
+
end
|
8
|
+
cmd
|
9
|
+
end
|
10
|
+
|
11
|
+
alias :check_is_installed_by_rpm :check_is_installed
|
12
|
+
|
13
|
+
def get_version(package, opts=nil)
|
14
|
+
"rpm -qi #{package} | grep Version | awk '{print $3}'"
|
15
|
+
end
|
16
|
+
|
17
|
+
def install(package, version=nil, option='')
|
18
|
+
if version
|
19
|
+
full_package = "#{package}-#{version}"
|
20
|
+
else
|
21
|
+
full_package = package
|
22
|
+
end
|
23
|
+
cmd = "yum -y #{option} install #{full_package}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove(package, option='')
|
27
|
+
"yum -y #{option} remove #{package}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class Specinfra::Command::Ios_xr::Base::Yumrepo < Specinfra::Command::Linux::Base::Yumrepo
|
2
|
+
class << self
|
3
|
+
def check_exists(repository)
|
4
|
+
"yum repolist all -C | grep ^#{escape(repository)}"
|
5
|
+
end
|
6
|
+
|
7
|
+
def check_is_enabled(repository)
|
8
|
+
"yum repolist enabled -C | grep -qs \"^[\\!\\*]\\?#{escape(repository)}\""
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Specinfra::Helper::DetectOs::Ios_xr < Specinfra::Helper::DetectOs
|
2
|
+
def detect
|
3
|
+
# CentOS has a os-release file too, but this should do the right thing
|
4
|
+
if File.exists?('/etc/cisco-release')
|
5
|
+
contents = {}
|
6
|
+
File.read('/etc/cisco-release').split.collect {|x| x.split('=')}.each {|x| contents[x[0]] = x[1]}
|
7
|
+
# This test should only work on a nexus platform in the native OS
|
8
|
+
# It will fail in a guest/container shell, which should be picked up elsewhere
|
9
|
+
if contents['ID'] == "ios_xr" && contents['ID_LIKE'] && contents['ID_LIKE'].include?('wrlinux')
|
10
|
+
{ :family => 'ios_xr', :release => contents['VERSION'] }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/specinfra/version.rb
CHANGED
data/specinfra-cisco.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "specinfra-cisco"
|
5
|
-
spec.version = "2.
|
5
|
+
spec.version = "2.41.0"
|
6
6
|
spec.authors = ["Gosuke Miyashita", "Carl Perry"]
|
7
7
|
spec.email = ["gosukenator@gmail.com", "partnereng@chef.io"]
|
8
8
|
spec.description = %q{Common layer for serverspec and itamae patched for Cisco platforms}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra-cisco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.41.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-scp
|
@@ -269,6 +269,16 @@ files:
|
|
269
269
|
- lib/specinfra/command/gentoo/base.rb
|
270
270
|
- lib/specinfra/command/gentoo/base/package.rb
|
271
271
|
- lib/specinfra/command/gentoo/base/service.rb
|
272
|
+
- lib/specinfra/command/ios_xr.rb
|
273
|
+
- lib/specinfra/command/ios_xr/base.rb
|
274
|
+
- lib/specinfra/command/ios_xr/base/file.rb
|
275
|
+
- lib/specinfra/command/ios_xr/base/host.rb
|
276
|
+
- lib/specinfra/command/ios_xr/base/iptables.rb
|
277
|
+
- lib/specinfra/command/ios_xr/base/package.rb
|
278
|
+
- lib/specinfra/command/ios_xr/base/port.rb
|
279
|
+
- lib/specinfra/command/ios_xr/base/service.rb
|
280
|
+
- lib/specinfra/command/ios_xr/base/yumrepo.rb
|
281
|
+
- lib/specinfra/command/ios_xr/v7.rb
|
272
282
|
- lib/specinfra/command/linux.rb
|
273
283
|
- lib/specinfra/command/linux/base.rb
|
274
284
|
- lib/specinfra/command/linux/base/bond.rb
|
@@ -422,6 +432,7 @@ files:
|
|
422
432
|
- lib/specinfra/helper/detect_os/esxi.rb
|
423
433
|
- lib/specinfra/helper/detect_os/freebsd.rb
|
424
434
|
- lib/specinfra/helper/detect_os/gentoo.rb
|
435
|
+
- lib/specinfra/helper/detect_os/ios_xr.rb
|
425
436
|
- lib/specinfra/helper/detect_os/nexus.rb
|
426
437
|
- lib/specinfra/helper/detect_os/nixos.rb
|
427
438
|
- lib/specinfra/helper/detect_os/openbsd.rb
|
@@ -539,7 +550,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
539
550
|
version: '0'
|
540
551
|
requirements: []
|
541
552
|
rubyforge_project:
|
542
|
-
rubygems_version: 2.4.
|
553
|
+
rubygems_version: 2.4.8
|
543
554
|
signing_key:
|
544
555
|
specification_version: 4
|
545
556
|
summary: Common layer for serverspec and itamae patched for Cisco platforms
|