specinfra 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55cb68343e9c2923e6b49be0ba591f0ec43c02c9
4
- data.tar.gz: fbe502290327c0423a1193ac131a8d5e80f2beae
3
+ metadata.gz: e9ad5b7fca872a23d4b8b7901c803dab42175c82
4
+ data.tar.gz: 6ddb62bc6c82082a48b87c3bb567b47a0b827df9
5
5
  SHA512:
6
- metadata.gz: a135e5273a70a5284f442e275c925e675f095098abebc397434dcaaa3dfcd0e4c9a5b1ed085b09860beed46e305604e4415bf6e70b2d1e398efc53fecc7d2b5f
7
- data.tar.gz: af7c2c0e6d5e20757ba99dc5be709175ab2c981da0561352e4904b53cedea4a5ad9e2761ba3953bce141fa487e5768f86acf8bcc2dea95a16159381005ab3f6e
6
+ metadata.gz: ec293647a82c7c3ff9d5ebb10c6033d01541eb8bcec423e3e73f1e53799bcf2e75eac169c3ea90d3665b64a837ab9f507eb0d5be4d56cc59423929211c3a3d76
7
+ data.tar.gz: 1e0ca4bc2b90bfa54f432fc77d138cc7aa8ecaabad3358900b3bf1e0ee750be18001a4b9212785521fc6a4a80484b899b1e6a1e782ad790964bd13d8839ed300
@@ -7,6 +7,7 @@ require 'specinfra/command/module/zfs'
7
7
 
8
8
  # Base
9
9
  require 'specinfra/command/base'
10
+ require 'specinfra/command/base/bridge'
10
11
  require 'specinfra/command/base/cron'
11
12
  require 'specinfra/command/base/file'
12
13
  require 'specinfra/command/base/group'
@@ -36,6 +37,7 @@ require 'specinfra/command/base/zfs'
36
37
  # Linux (inhefit Base)
37
38
  require 'specinfra/command/linux'
38
39
  require 'specinfra/command/linux/base'
40
+ require 'specinfra/command/linux/base/bridge'
39
41
  require 'specinfra/command/linux/base/file'
40
42
  require 'specinfra/command/linux/base/interface'
41
43
  require 'specinfra/command/linux/base/inventory'
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Base::Bridge < Specinfra::Command::Base
2
+ end
@@ -12,6 +12,10 @@ class Specinfra::Command::Base::File < Specinfra::Command::Base
12
12
  "test -S #{escape(file)}"
13
13
  end
14
14
 
15
+ def check_is_symlink(file)
16
+ "test -L #{escape(file)}"
17
+ end
18
+
15
19
  def check_contains(file, expected_pattern)
16
20
  "#{check_contains_with_regexp(file, expected_pattern)} || #{check_contains_with_fixed_strings(file, expected_pattern)}"
17
21
  end
@@ -0,0 +1,11 @@
1
+ class Specinfra::Command::Linux::Base::Bridge < Specinfra::Command::Base::Bridge
2
+ class << self
3
+ def check_exists(name)
4
+ "ip link show #{name}"
5
+ end
6
+
7
+ def check_has_interface(name, interface)
8
+ "brctl show #{name} | grep -o #{interface}"
9
+ end
10
+ end
11
+ end
@@ -9,7 +9,7 @@ class Specinfra::Command::Linux::Base::Inventory < Specinfra::Command::Base::Inv
9
9
  end
10
10
 
11
11
  def get_domain
12
- 'dnsdomainame'
12
+ 'dnsdomainname'
13
13
  end
14
14
 
15
15
  def get_fqdn
@@ -1,11 +1,11 @@
1
1
  class Specinfra::Command::Ubuntu::Base::Ppa < Specinfra::Command::Debian::Base::Ppa
2
2
  class << self
3
3
  def check_exists(package)
4
- %Q{find /etc/apt/ -name \*.list | xargs grep -o "deb +http://ppa.launchpad.net/#{to_apt_line_uri(package)}"}
4
+ %Q{find /etc/apt/ -name \*.list | xargs grep -o -E "deb +http://ppa.launchpad.net/#{to_apt_line_uri(package)}"}
5
5
  end
6
6
 
7
7
  def check_is_enabled(package)
8
- %Q{find /etc/apt/ -name \*.list | xargs grep -o "^deb +http://ppa.launchpad.net/#{to_apt_line_uri(package)}"}
8
+ %Q{find /etc/apt/ -name \*.list | xargs grep -o -E "^deb +http://ppa.launchpad.net/#{to_apt_line_uri(package)}"}
9
9
  end
10
10
 
11
11
  private
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.8.0"
2
+ VERSION = "2.9.0"
3
3
  end
@@ -6,6 +6,10 @@ describe get_command(:check_file_is_directory, '/tmp') do
6
6
  it { should eq 'test -d /tmp' }
7
7
  end
8
8
 
9
+ describe get_command(:check_file_is_symlink, '/tmp') do
10
+ it { should eq 'test -L /tmp' }
11
+ end
12
+
9
13
  describe get_command(:change_file_mode, '/tmp', '0644') do
10
14
  it { should eq 'chmod 0644 /tmp' }
11
15
  end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, :family => 'linux'
5
+
6
+ describe get_command(:check_bridge_exists, 'br0') do
7
+ it { should eq "ip link show br0" }
8
+ end
9
+
10
+ describe get_command(:check_bridge_has_interface, 'br0', 'eth0') do
11
+ it { should eq "brctl show br0 | grep -o eth0" }
12
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, :family => 'ubuntu'
5
+
6
+ describe get_command(:check_ppa_exists, 'nginx/stable') do
7
+ it { should eq 'find /etc/apt/ -name *.list | xargs grep -o -E "deb +http://ppa.launchpad.net/nginx/stable"' }
8
+ end
9
+
10
+ describe get_command(:check_ppa_is_enabled, 'nginx/stable') do
11
+ it { should eq 'find /etc/apt/ -name *.list | xargs grep -o -E "^deb +http://ppa.launchpad.net/nginx/stable"' }
12
+ end
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: 2.8.0
4
+ version: 2.9.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-11-26 00:00:00.000000000 Z
11
+ date: 2014-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -150,6 +150,7 @@ files:
150
150
  - lib/specinfra/command/arch/base/package.rb
151
151
  - lib/specinfra/command/arch/base/service.rb
152
152
  - lib/specinfra/command/base.rb
153
+ - lib/specinfra/command/base/bridge.rb
153
154
  - lib/specinfra/command/base/cron.rb
154
155
  - lib/specinfra/command/base/file.rb
155
156
  - lib/specinfra/command/base/group.rb
@@ -209,6 +210,7 @@ files:
209
210
  - lib/specinfra/command/gentoo/base/service.rb
210
211
  - lib/specinfra/command/linux.rb
211
212
  - lib/specinfra/command/linux/base.rb
213
+ - lib/specinfra/command/linux/base/bridge.rb
212
214
  - lib/specinfra/command/linux/base/file.rb
213
215
  - lib/specinfra/command/linux/base/interface.rb
214
216
  - lib/specinfra/command/linux/base/inventory.rb
@@ -345,6 +347,7 @@ files:
345
347
  - spec/command/debian/service_spec.rb
346
348
  - spec/command/factory_spec.rb
347
349
  - spec/command/freebsd/file_spec.rb
350
+ - spec/command/linux/bridge_spec.rb
348
351
  - spec/command/linux/interface_spec.rb
349
352
  - spec/command/linux/inventory_spec.rb
350
353
  - spec/command/linux/ip6tables_spec.rb
@@ -353,6 +356,7 @@ files:
353
356
  - spec/command/redhat/package_spec.rb
354
357
  - spec/command/redhat/service_spec.rb
355
358
  - spec/command/redhat7/service_spec.rb
359
+ - spec/command/ubuntu/ppa_spec.rb
356
360
  - spec/configuration_spec.rb
357
361
  - spec/helper/os_spec.rb
358
362
  - spec/helper/properties_spec.rb
@@ -395,6 +399,7 @@ test_files:
395
399
  - spec/command/debian/service_spec.rb
396
400
  - spec/command/factory_spec.rb
397
401
  - spec/command/freebsd/file_spec.rb
402
+ - spec/command/linux/bridge_spec.rb
398
403
  - spec/command/linux/interface_spec.rb
399
404
  - spec/command/linux/inventory_spec.rb
400
405
  - spec/command/linux/ip6tables_spec.rb
@@ -403,6 +408,7 @@ test_files:
403
408
  - spec/command/redhat/package_spec.rb
404
409
  - spec/command/redhat/service_spec.rb
405
410
  - spec/command/redhat7/service_spec.rb
411
+ - spec/command/ubuntu/ppa_spec.rb
406
412
  - spec/configuration_spec.rb
407
413
  - spec/helper/os_spec.rb
408
414
  - spec/helper/properties_spec.rb