r-train 0.9.5 → 0.9.6

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: 1d0d1580a540541055d89da66ae4d90b97e85162
4
- data.tar.gz: b228d1944aa2b7201223ad47897033ca6e6a531c
3
+ metadata.gz: 7575ec657025aa3a654b3027981d2ced614549be
4
+ data.tar.gz: 667d45c23b863cc86fa69c9adc364af790c320ca
5
5
  SHA512:
6
- metadata.gz: d189e9a16f00e5921e7cdd3c15610c35ccdfa70cc969ec82e59e440b2dae214dd92ae65dbd89f5e9dbdc2b8bbf29cd53aedef8dab73bd6cbbadc2b1f321c9f20
7
- data.tar.gz: 4a78e3f8dd1b22e3405003e882de552bf7c62ee1c70e491dd36c673248859c0aa566f9043248428d99ce0b52b7f65c7f8151b550ed68ea5f3e5b6e51ae39e905
6
+ metadata.gz: e6b12280fcd7d238ed3c0fb7ae9716b4752b07ddcfbadb77bc0d8b2c9fbd7d721caef426e1f37c99a68d119c8b3d1f7e1ae395ef776a72a47419a24d2ebf8508
7
+ data.tar.gz: 589e2fa5193099b0d5f0f4146e3f0a6c19c677607387e01984d1febbeee6a643e6970407dea8e1f7c9caea5fb45c4476c878df772a5a47f05d94f1052f761432
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
1
  # Change Log
2
2
 
3
- ## [0.9.5](https://github.com/chef/train/tree/0.9.5) (2016-01-25)
4
- [Full Changelog](https://github.com/chef/train/compare/v0.9.4...0.9.5)
3
+ ## [0.9.5](https://github.com/chef/train/tree/0.9.5) (2016-01-29)
4
+ [Full Changelog](https://github.com/chef/train/compare/v0.9.5...0.9.5)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - add solaris support [\#61](https://github.com/chef/train/pull/61) ([chris-rock](https://github.com/chris-rock))
9
+
10
+ ## [v0.9.5](https://github.com/chef/train/tree/v0.9.5) (2016-01-25)
11
+ [Full Changelog](https://github.com/chef/train/compare/v0.9.4...v0.9.5)
5
12
 
6
13
  **Implemented enhancements:**
7
14
 
@@ -17,6 +24,10 @@
17
24
  - Properly wrap commands in powershell for local backend [\#57](https://github.com/chef/train/pull/57) ([chris-rock](https://github.com/chris-rock))
18
25
  - Copying https://github.com/test-kitchen/test-kitchen/pull/919 to this repo [\#52](https://github.com/chef/train/pull/52) ([tyler-ball](https://github.com/tyler-ball))
19
26
 
27
+ **Merged pull requests:**
28
+
29
+ - 0.9.5 [\#58](https://github.com/chef/train/pull/58) ([chris-rock](https://github.com/chris-rock))
30
+
20
31
  ## [v0.9.4](https://github.com/chef/train/tree/v0.9.4) (2016-01-15)
21
32
  [Full Changelog](https://github.com/chef/train/compare/v0.9.3...v0.9.4)
22
33
 
data/lib/train/extras.rb CHANGED
@@ -5,9 +5,10 @@
5
5
  module Train::Extras
6
6
  autoload :CommandWrapper, 'train/extras/command_wrapper'
7
7
  autoload :FileCommon, 'train/extras/file_common'
8
- autoload :LinuxFile, 'train/extras/linux_file'
9
- autoload :AixFile, 'train/extras/aix_file'
10
- autoload :WindowsFile, 'train/extras/windows_file'
8
+ autoload :AixFile, 'train/extras/file_aix'
9
+ autoload :UnixFile, 'train/extras/file_unix'
10
+ autoload :LinuxFile, 'train/extras/file_linux'
11
+ autoload :WindowsFile, 'train/extras/file_windows'
11
12
  autoload :OSCommon, 'train/extras/os_common'
12
13
  autoload :Stat, 'train/extras/stat'
13
14
 
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+
3
+ require 'shellwords'
4
+ require 'train/extras/stat'
5
+
6
+ module Train::Extras
7
+ class AixFile < UnixFile
8
+ def link_path
9
+ return nil unless symlink?
10
+ @link_path ||= (
11
+ @backend.run_command("perl -e 'print readlink shift' #{@spath}").stdout.chomp
12
+ )
13
+ end
14
+
15
+ def mounted
16
+ @mounted ||= (
17
+ @backend.run_command("lsfs -c #{@spath}")
18
+ )
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ # author: Dominik Richter
3
+ # author: Christoph Hartmann
4
+
5
+ module Train::Extras
6
+ class LinuxFile < UnixFile
7
+ def content
8
+ return @content if defined?(@content)
9
+ @content = @backend.run_command(
10
+ "cat #{@spath} || echo -n").stdout
11
+ return @content unless @content.empty?
12
+ @content = nil if directory? or size.nil? or size > 0
13
+ @content
14
+ end
15
+ end
16
+ end
@@ -6,7 +6,7 @@ require 'shellwords'
6
6
  require 'train/extras/stat'
7
7
 
8
8
  module Train::Extras
9
- class LinuxFile < FileCommon
9
+ class UnixFile < FileCommon
10
10
  attr_reader :path
11
11
  def initialize(backend, path)
12
12
  @backend = backend
@@ -15,12 +15,14 @@ module Train::Extras
15
15
  end
16
16
 
17
17
  def content
18
- return @content if defined?(@content)
19
- @content = @backend.run_command(
20
- "cat #{@spath} || echo -n").stdout
21
- return @content unless @content.empty?
22
- @content = nil if directory? or size.nil? or size > 0
23
- @content
18
+ @content ||= case
19
+ when !exist?, directory?
20
+ nil
21
+ when size.nil?, size == 0
22
+ ''
23
+ else
24
+ @backend.run_command("cat #{@spath}").stdout || ''
25
+ end
24
26
  end
25
27
 
26
28
  def exist?
@@ -48,7 +48,7 @@ module Train::Extras
48
48
  freebsd netbsd openbsd darwin
49
49
  },
50
50
  'solaris' => %w{
51
- solaris smartos openindiana opensolaris solaris2 nexentacore
51
+ solaris smartos omnios openindiana opensolaris nexentacore
52
52
  },
53
53
  'windows' => %w{
54
54
  windows
@@ -10,7 +10,7 @@
10
10
 
11
11
  module Train::Extras
12
12
  module DetectUnix
13
- def detect_via_uname # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
13
+ def detect_via_uname # rubocop:disable Metrics/AbcSize
14
14
  case uname_s.downcase
15
15
  when /aix/
16
16
  @platform[:family] = 'aix'
@@ -37,35 +37,7 @@ module Train::Extras
37
37
  @platform[:release] = uname_r.lines[0].chomp
38
38
 
39
39
  when /sunos/
40
- @platform[:family] = 'solaris'
41
- if uname_r =~ /5\.10/
42
- # TODO: should be string!
43
- @platform[:release] = 10
44
- else
45
- rel = get_config('/etc/release')
46
- case rel
47
- when /^.*(SmartOS).*$/
48
- @platform[:family] = 'smartos'
49
- when !(m = /^\s*(OmniOS).*r(\d+).*$/).nil?
50
- @platform[:family] = 'omnios'
51
- @platform[:release] = m[2]
52
- when !(m = /^\s*(OpenIndiana).*oi_(\d+).*$/).nil?
53
- @platform[:family] = 'openindiana'
54
- @platform[:release] = m[2]
55
- when /^\s*(OpenSolaris).*snv_(\d+).*$/
56
- @platform[:family] = 'opensolaris'
57
- @platform[:release] = m[2]
58
- when !(m = /Oracle Solaris (\d+)/).nil?
59
- # TODO: should be string!
60
- @platform[:release] = m[1].to_i
61
- @platform[:family] = 'solaris2'
62
- when /^\s*(Solaris)\s.*$/
63
- @platform[:family] = 'solaris2'
64
- when /^\s*(NexentaCore)\s.*$/
65
- @platform[:family] = 'nexentacore'
66
- end
67
- end
68
-
40
+ detect_solaris
69
41
  else
70
42
  # in all other cases we didn't detect it
71
43
  return false
@@ -73,5 +45,51 @@ module Train::Extras
73
45
  # when we get here the detection returned a result
74
46
  true
75
47
  end
48
+
49
+ def detect_solaris # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
50
+ # read specific os name
51
+ # DEPRECATED: os[:family] is going to be deprecated, use os.solaris?
52
+ rel = get_config('/etc/release')
53
+ if /^.*(SmartOS).*$/.match(rel)
54
+ @platform[:name] = 'smartos'
55
+ @platform[:family] = 'smartos'
56
+ elsif !(m = /^\s*(OmniOS).*r(\d+).*$/.match(rel)).nil?
57
+ @platform[:name] = 'omnios'
58
+ @platform[:family] = 'omnios'
59
+ @platform[:release] = m[2]
60
+ elsif !(m = /^\s*(OpenIndiana).*oi_(\d+).*$/.match(rel)).nil?
61
+ @platform[:name] = 'openindiana'
62
+ @platform[:family] = 'openindiana'
63
+ @platform[:release] = m[2]
64
+ elsif /^\s*(OpenSolaris).*snv_(\d+).*$/.match(rel)
65
+ @platform[:name] = 'opensolaris'
66
+ @platform[:family] = 'opensolaris'
67
+ @platform[:release] = m[2]
68
+ elsif !(m = /Oracle Solaris (\d+)/.match(rel)).nil?
69
+ # TODO: should be string!
70
+ @platform[:release] = m[1]
71
+ @platform[:name] = 'solaris'
72
+ @platform[:family] = 'solaris'
73
+ elsif /^\s*(Solaris)\s.*$/.match(rel)
74
+ @platform[:name] = 'solaris'
75
+ @platform[:family] = 'solaris'
76
+ elsif /^\s*(NexentaCore)\s.*$/.match(rel)
77
+ @platform[:name] = 'nexentacore'
78
+ @platform[:family] = 'nexentacore'
79
+ else
80
+ # unknown solaris
81
+ @platform[:name] = 'solaris_distro'
82
+ @platform[:family] = 'solaris'
83
+ end
84
+
85
+ # read release version
86
+ unless (version = /^5\.(?<release>\d+)$/.match(uname_r)).nil?
87
+ @platform[:release] = version['release']
88
+ end
89
+
90
+ # read architecture
91
+ arch = @backend.run_command('uname -p')
92
+ @platform[:arch] = arch.stdout.chomp if arch.exit_status == 0
93
+ end
76
94
  end
77
95
  end
@@ -20,8 +20,12 @@ module Train::Extras
20
20
  end
21
21
 
22
22
  def self.stat(shell_escaped_path, backend)
23
- return aix_stat(shell_escaped_path, backend) if backend.os.aix?
23
+ # use perl scripts for aix and solaris 10
24
+ if backend.os.aix? || (backend.os.solaris? && backend.os[:release].to_i < 11)
25
+ return aix_stat(shell_escaped_path, backend)
26
+ end
24
27
  return bsd_stat(shell_escaped_path, backend) if backend.os.bsd?
28
+ # linux and solaris 11 will use standard linux stats
25
29
  return linux_stat(shell_escaped_path, backend) if backend.os.unix?
26
30
  # all other cases we don't handle
27
31
  # TODO: print an error if we get here, as it shouldn't be invoked
@@ -60,9 +60,10 @@ class Train::Transports::SSH
60
60
 
61
61
  def file(path)
62
62
  @files[path] ||= \
63
- case os[:family]
64
- when 'aix'
63
+ if os.aix?
65
64
  AixFile.new(self, path)
65
+ elsif os.solaris?
66
+ UnixFile.new(self, path)
66
67
  else
67
68
  LinuxFile.new(self, path)
68
69
  end
data/lib/train/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '0.9.5'
6
+ VERSION = '0.9.6'
7
7
  end
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+ #
4
+ # Author:: Christoph Hartmann (<chris@lollyrock.com>)
5
+
6
+ require 'train'
7
+ require 'json'
8
+
9
+ def get_os(backend)
10
+ train = Train.create(backend)
11
+
12
+ # start or reuse a connection
13
+ conn = train.connection
14
+ os = conn.os
15
+
16
+ # get OS info
17
+ conf = {
18
+ name: os[:name],
19
+ family: os[:family],
20
+ release: os[:release],
21
+ arch: os[:arch],
22
+ }
23
+
24
+ # close the connection
25
+ conn.close
26
+ conf
27
+ end
28
+
29
+ def print(data)
30
+ puts JSON.dump(data)
31
+ end
32
+
33
+ # check local
34
+ local = get_os('local')
35
+ print(local)
36
+
37
+ # winrm over http
38
+ winrm = get_os('winrm', {
39
+ target: ENV['train_target']
40
+ password: ENV['winrm_pass']
41
+ ssl: ENV['train_ssl']
42
+ self_signed: true
43
+ }))
44
+ print(winrm)
@@ -1,356 +0,0 @@
1
- I, [2016-01-15T13:54:02.957131 #64433] INFO -- default-centos-71: -----> Creating <default-centos-71>...
2
- I, [2016-01-15T13:54:04.145453 #64433] INFO -- default-centos-71: Bringing machine 'default' up with 'virtualbox' provider...
3
- I, [2016-01-15T13:54:04.340852 #64433] INFO -- default-centos-71: ==> default: Importing base box 'opscode-centos-7.1'...
4
- I, [2016-01-15T13:54:10.240589 #64433] INFO -- default-centos-71:
5
- I, [2016-01-15T13:54:10.985940 #64433] INFO -- default-centos-71: ==> default: Setting the name of the VM: kitchen-integration-default-centos-71_default_1452884050943_75448
6
- I, [2016-01-15T13:54:11.923978 #64433] INFO -- default-centos-71: ==> default: Fixed port collision for 22 => 2222. Now on port 2201.
7
- I, [2016-01-15T13:54:11.989424 #64433] INFO -- default-centos-71: ==> default: Clearing any previously set network interfaces...
8
- I, [2016-01-15T13:54:12.033954 #64433] INFO -- default-centos-71: ==> default: Preparing network interfaces based on configuration...
9
- I, [2016-01-15T13:54:12.034818 #64433] INFO -- default-centos-71: default: Adapter 1: nat
10
- I, [2016-01-15T13:54:12.078217 #64433] INFO -- default-centos-71: ==> default: Forwarding ports...
11
- I, [2016-01-15T13:54:12.139096 #64433] INFO -- default-centos-71: default: 22 => 2201 (adapter 1)
12
- I, [2016-01-15T13:54:12.290299 #64433] INFO -- default-centos-71: ==> default: Booting VM...
13
- I, [2016-01-15T13:54:12.496798 #64433] INFO -- default-centos-71: ==> default: Waiting for machine to boot. This may take a few minutes...
14
- I, [2016-01-15T13:54:12.814657 #64433] INFO -- default-centos-71: default: SSH address: 127.0.0.1:2201
15
- I, [2016-01-15T13:54:12.815177 #64433] INFO -- default-centos-71: default: SSH username: vagrant
16
- I, [2016-01-15T13:54:12.815251 #64433] INFO -- default-centos-71: default: SSH auth method: private key
17
- I, [2016-01-15T13:54:27.938556 #64433] INFO -- default-centos-71: default: Warning: Connection timeout. Retrying...
18
- I, [2016-01-15T13:54:28.625706 #64433] INFO -- default-centos-71: default:
19
- I, [2016-01-15T13:54:28.625764 #64433] INFO -- default-centos-71: default: Vagrant insecure key detected. Vagrant will automatically replace
20
- I, [2016-01-15T13:54:28.625796 #64433] INFO -- default-centos-71: default: this with a newly generated keypair for better security.
21
- I, [2016-01-15T13:54:30.776851 #64433] INFO -- default-centos-71: default:
22
- I, [2016-01-15T13:54:30.776917 #64433] INFO -- default-centos-71: default: Inserting generated public key within guest...
23
- I, [2016-01-15T13:54:31.209118 #64433] INFO -- default-centos-71: default: Removing insecure key from the guest if it's present...
24
- I, [2016-01-15T13:54:31.493347 #64433] INFO -- default-centos-71: default: Key inserted! Disconnecting and reconnecting using new SSH key...
25
- I, [2016-01-15T13:54:32.568867 #64433] INFO -- default-centos-71: ==> default: Machine booted and ready!
26
- I, [2016-01-15T13:54:32.569211 #64433] INFO -- default-centos-71: ==> default: Checking for guest additions in VM...
27
- I, [2016-01-15T13:54:32.609366 #64433] INFO -- default-centos-71: ==> default: Setting hostname...
28
- I, [2016-01-15T13:54:33.169196 #64433] INFO -- default-centos-71: ==> default: Machine not provisioned because `--no-provision` is specified.
29
- I, [2016-01-15T13:54:35.228909 #64433] INFO -- default-centos-71: [SSH] Established
30
- I, [2016-01-15T13:54:35.229644 #64433] INFO -- default-centos-71: Vagrant instance <default-centos-71> created.
31
- I, [2016-01-15T13:54:35.233475 #64433] INFO -- default-centos-71: Finished creating <default-centos-71> (0m32.27s).
32
- I, [2016-01-15T13:54:35.235159 #64433] INFO -- default-centos-71: -----> Converging <default-centos-71>...
33
- I, [2016-01-15T13:54:35.237101 #64433] INFO -- default-centos-71: Preparing files for transfer
34
- I, [2016-01-15T13:54:35.237332 #64433] INFO -- default-centos-71: Preparing dna.json
35
- I, [2016-01-15T13:54:35.238359 #64433] INFO -- default-centos-71: Resolving cookbook dependencies with Berkshelf 4.0.1...
36
- I, [2016-01-15T13:54:36.542060 #64433] INFO -- default-centos-71: Removing non-cookbook files before transfer
37
- I, [2016-01-15T13:54:36.544313 #64433] INFO -- default-centos-71: Preparing data
38
- I, [2016-01-15T13:54:36.600386 #64433] INFO -- default-centos-71: Preparing solo.rb
39
- I, [2016-01-15T13:54:36.829171 #64433] INFO -- default-centos-71: -----> Installing Chef Omnibus (install only if missing)
40
- I, [2016-01-15T13:54:36.870081 #64433] INFO -- default-centos-71: Downloading https://www.chef.io/chef/install.sh to file /tmp/install.sh
41
- I, [2016-01-15T13:54:36.870146 #64433] INFO -- default-centos-71: Trying wget...
42
- I, [2016-01-15T13:54:37.191399 #64433] INFO -- default-centos-71: Download complete.
43
- I, [2016-01-15T13:54:37.366947 #64433] INFO -- default-centos-71: Getting information for chef stable for el...
44
- I, [2016-01-15T13:54:37.367002 #64433] INFO -- default-centos-71: downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=&p=el&pv=7&m=x86_64
45
- I, [2016-01-15T13:54:37.367019 #64433] INFO -- default-centos-71: to file /tmp/install.sh.9193/metadata.txt
46
- I, [2016-01-15T13:54:37.378698 #64433] INFO -- default-centos-71: trying wget...
47
- I, [2016-01-15T13:54:37.915706 #64433] INFO -- default-centos-71: url https://opscode-omnibus-packages.s3.amazonaws.com/el/7/x86_64/chef-12.6.0-1.el7.x86_64.rpm
48
- I, [2016-01-15T13:54:37.915770 #64433] INFO -- default-centos-71: md5 fe1ae43e8839a85a644305817004a21c
49
- I, [2016-01-15T13:54:37.915784 #64433] INFO -- default-centos-71: sha256 14557b1db3ee9bfc6072395de8d60bb8054c6cbdab9f2791e1ec9417970b6470
50
- I, [2016-01-15T13:54:37.953464 #64433] INFO -- default-centos-71: downloaded metadata file looks valid...
51
- I, [2016-01-15T13:54:38.082428 #64433] INFO -- default-centos-71: downloading https://opscode-omnibus-packages.s3.amazonaws.com/el/7/x86_64/chef-12.6.0-1.el7.x86_64.rpm
52
- I, [2016-01-15T13:54:38.082503 #64433] INFO -- default-centos-71: to file /tmp/install.sh.9193/chef-12.6.0-1.el7.x86_64.rpm
53
- I, [2016-01-15T13:54:38.095482 #64433] INFO -- default-centos-71: trying wget...
54
- I, [2016-01-15T13:56:41.136448 #64433] INFO -- default-centos-71: Comparing checksum with sha256sum...
55
- I, [2016-01-15T13:56:41.312810 #64433] INFO -- default-centos-71:
56
- I, [2016-01-15T13:56:41.312864 #64433] INFO -- default-centos-71: WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
57
- I, [2016-01-15T13:56:41.312881 #64433] INFO -- default-centos-71:
58
- I, [2016-01-15T13:56:41.312921 #64433] INFO -- default-centos-71: You are installing an omnibus package without a version pin. If you are installing
59
- I, [2016-01-15T13:56:41.312935 #64433] INFO -- default-centos-71: on production servers via an automated process this is DANGEROUS and you will
60
- I, [2016-01-15T13:56:41.312951 #64433] INFO -- default-centos-71: be upgraded without warning on new releases, even to new major releases.
61
- I, [2016-01-15T13:56:41.312963 #64433] INFO -- default-centos-71: Letting the version float is only appropriate in desktop, test, development or
62
- I, [2016-01-15T13:56:41.312974 #64433] INFO -- default-centos-71: CI/CD environments.
63
- I, [2016-01-15T13:56:41.312984 #64433] INFO -- default-centos-71:
64
- I, [2016-01-15T13:56:41.312994 #64433] INFO -- default-centos-71: WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
65
- I, [2016-01-15T13:56:41.313004 #64433] INFO -- default-centos-71:
66
- I, [2016-01-15T13:56:41.313014 #64433] INFO -- default-centos-71: Installing chef
67
- I, [2016-01-15T13:56:41.313024 #64433] INFO -- default-centos-71: installing with rpm...
68
- I, [2016-01-15T13:56:41.364021 #64433] INFO -- default-centos-71: warning: /tmp/install.sh.9193/chef-12.6.0-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
69
- I, [2016-01-15T13:56:41.524367 #64433] INFO -- default-centos-71: Preparing... (100%)# (100%)## (100%)### (100%)#### (100%)##### (100%)###### (100%)####### (100%)######## (100%)######### (100%)########## (100%)########### (100%)############ (100%)############# (100%)############## (100%)############### (100%)################ (100%)################# (100%)################## (100%)################### (100%)#################### (100%)##################### (100%)###################### (100%)####################### (100%)######################## (100%)######################### (100%)########################## (100%)########################### (100%)############################ (100%)############################# (100%)############################## (100%)############################### (100%)################################ (100%)################################# (100%)################################# [100%]
70
- I, [2016-01-15T13:56:41.533779 #64433] INFO -- default-centos-71: Updating / installing...
71
- I, [2016-01-15T13:56:44.929337 #64433] INFO -- default-centos-71: ( 1%)# ( 4%)## ( 7%)### ( 10%)#### ( 13%)##### ( 16%)###### ( 19%)####### ( 22%)######## ( 25%)######### ( 28%)########## ( 31%)########### ( 34%)############ ( 37%)############# ( 40%)############## ( 43%)############### ( 46%)################ ( 49%)################# ( 51%)################## ( 54%)################### ( 57%)#################### ( 60%)##################### ( 63%)###################### ( 66%)####################### ( 69%)######################## ( 72%)######################### ( 75%)########################## ( 78%)########################### ( 81%)############################ ( 84%)############################# ( 87%)############################## ( 90%)############################### ( 93%)################################ ( 96%)################################# ( 99%)################################# [100%]
72
- I, [2016-01-15T13:56:45.543959 #64433] INFO -- default-centos-71: Thank you for installing Chef!
73
- I, [2016-01-15T13:56:45.675668 #64433] INFO -- default-centos-71: Transferring files to <default-centos-71>
74
- I, [2016-01-15T13:56:46.763265 #64433] INFO -- default-centos-71: Starting Chef Client, version 12.6.0
75
- I, [2016-01-15T13:56:47.708352 #64433] INFO -- default-centos-71: Compiling Cookbooks...
76
- I, [2016-01-15T13:56:47.715764 #64433] INFO -- default-centos-71: Converging 23 resources
77
- I, [2016-01-15T13:56:47.715813 #64433] INFO -- default-centos-71: Recipe: sudo::default
78
- I, [2016-01-15T13:56:47.736708 #64433] INFO -- default-centos-71: (skipped due to not_if)
79
- I, [2016-01-15T13:56:47.736765 #64433] INFO -- default-centos-71: * directory[/etc/sudoers.d] action create
80
- I, [2016-01-15T13:56:47.794226 #64433] INFO -- default-centos-71:
81
- I, [2016-01-15T13:56:47.794279 #64433] INFO -- default-centos-71: - restore selinux security context
82
- I, [2016-01-15T13:56:47.794293 #64433] INFO -- default-centos-71: * cookbook_file[/etc/sudoers.d/README] action create
83
- I, [2016-01-15T13:56:47.794307 #64433] INFO -- default-centos-71: - create new file /etc/sudoers.d/README
84
- I, [2016-01-15T13:56:47.794317 #64433] INFO -- default-centos-71: - update content in file /etc/sudoers.d/README from none to 9ded17
85
- I, [2016-01-15T13:56:47.794331 #64433] INFO -- default-centos-71: --- /etc/sudoers.d/README 2016-01-15 18:56:46.241232839 +0000
86
- I, [2016-01-15T13:56:47.794341 #64433] INFO -- default-centos-71: +++ /etc/sudoers.d/.README20160115-12508-1jrnxoi 2016-01-15 18:56:46.241232839 +0000
87
- I, [2016-01-15T13:56:47.794351 #64433] INFO -- default-centos-71: @@ -1 +1,18 @@
88
- I, [2016-01-15T13:56:47.794360 #64433] INFO -- default-centos-71: +#
89
- I, [2016-01-15T13:56:47.794374 #64433] INFO -- default-centos-71: +# As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
90
- I, [2016-01-15T13:56:47.794388 #64433] INFO -- default-centos-71: +# installation of the package now includes the directive:
91
- I, [2016-01-15T13:56:47.794398 #64433] INFO -- default-centos-71: +#
92
- I, [2016-01-15T13:56:47.794410 #64433] INFO -- default-centos-71: +# #includedir /etc/sudoers.d
93
- I, [2016-01-15T13:56:47.794425 #64433] INFO -- default-centos-71: +#
94
- I, [2016-01-15T13:56:47.794435 #64433] INFO -- default-centos-71: +# This will cause sudo to read and parse any files in the /etc/sudoers.d
95
- I, [2016-01-15T13:56:47.794445 #64433] INFO -- default-centos-71: +# directory that do not end in '~' or contain a '.' character.
96
- I, [2016-01-15T13:56:47.794455 #64433] INFO -- default-centos-71: +#
97
- I, [2016-01-15T13:56:47.794464 #64433] INFO -- default-centos-71: +# Note that there must be at least one file in the sudoers.d directory (this
98
- I, [2016-01-15T13:56:47.794492 #64433] INFO -- default-centos-71: +# one will do), and all files in this directory should be mode 0440.
99
- I, [2016-01-15T13:56:47.794504 #64433] INFO -- default-centos-71: +#
100
- I, [2016-01-15T13:56:47.794520 #64433] INFO -- default-centos-71: +# Note also, that because sudoers contents can vary widely, no attempt is
101
- I, [2016-01-15T13:56:47.794531 #64433] INFO -- default-centos-71: +# made to add this directive to existing sudoers files on upgrade. Feel free
102
- I, [2016-01-15T13:56:47.794541 #64433] INFO -- default-centos-71: +# to add the above directive to the end of your /etc/sudoers file to enable
103
- I, [2016-01-15T13:56:47.794550 #64433] INFO -- default-centos-71: +# this functionality for existing installations if you wish!
104
- I, [2016-01-15T13:56:47.794560 #64433] INFO -- default-centos-71: +#
105
- I, [2016-01-15T13:56:47.794569 #64433] INFO -- default-centos-71: - change mode from '' to '0440'
106
- I, [2016-01-15T13:56:47.794579 #64433] INFO -- default-centos-71: - change owner from '' to 'root'
107
- I, [2016-01-15T13:56:47.820691 #64433] INFO -- default-centos-71:
108
- I, [2016-01-15T13:56:47.820745 #64433] INFO -- default-centos-71: - restore selinux security context
109
- I, [2016-01-15T13:56:47.823506 #64433] INFO -- default-centos-71:
110
- I, [2016-01-15T13:56:47.823543 #64433] INFO -- default-centos-71: - update content in file /etc/sudoers from 3d87b1 to 742f7a
111
- I, [2016-01-15T13:56:47.823559 #64433] INFO -- default-centos-71: --- /etc/sudoers 2015-04-04 08:01:37.444806767 +0000
112
- I, [2016-01-15T13:56:47.823580 #64433] INFO -- default-centos-71: +++ /etc/.sudoers20160115-12508-nej8iq 2016-01-15 18:56:46.267245837 +0000
113
- I, [2016-01-15T13:56:47.823592 #64433] INFO -- default-centos-71: @@ -1,119 +1,15 @@
114
- I, [2016-01-15T13:56:47.823603 #64433] INFO -- default-centos-71: -## Sudoers allows particular users to run various commands as
115
- I, [2016-01-15T13:56:47.823614 #64433] INFO -- default-centos-71: -## the root user, without needing the root password.
116
- I, [2016-01-15T13:56:47.823624 #64433] INFO -- default-centos-71: -##
117
- I, [2016-01-15T13:56:47.823635 #64433] INFO -- default-centos-71: -## Examples are provided at the bottom of the file for collections
118
- I, [2016-01-15T13:56:47.823647 #64433] INFO -- default-centos-71: -## of related commands, which can then be delegated out to particular
119
- I, [2016-01-15T13:56:47.823662 #64433] INFO -- default-centos-71: -## users or groups.
120
- I, [2016-01-15T13:56:47.823695 #64433] INFO -- default-centos-71: -##
121
- I, [2016-01-15T13:56:47.823729 #64433] INFO -- default-centos-71: -## This file must be edited with the 'visudo' command.
122
- I, [2016-01-15T13:56:47.823745 #64433] INFO -- default-centos-71: +# This file is managed by Chef.
123
- I, [2016-01-15T13:56:47.823758 #64433] INFO -- default-centos-71: +# Do NOT modify this file directly.
124
- I, [2016-01-15T13:56:47.823769 #64433] INFO -- default-centos-71:
125
- I, [2016-01-15T13:56:47.823784 #64433] INFO -- default-centos-71: -## Host Aliases
126
- I, [2016-01-15T13:56:47.823795 #64433] INFO -- default-centos-71: -## Groups of machines. You may prefer to use hostnames (perhaps using
127
- I, [2016-01-15T13:56:47.823806 #64433] INFO -- default-centos-71: -## wildcards for entire domains) or IP addresses instead.
128
- I, [2016-01-15T13:56:47.823818 #64433] INFO -- default-centos-71: -# Host_Alias FILESERVERS = fs1, fs2
129
- I, [2016-01-15T13:56:47.823830 #64433] INFO -- default-centos-71: -# Host_Alias MAILSERVERS = smtp, smtp2
130
- I, [2016-01-15T13:56:47.823844 #64433] INFO -- default-centos-71: +Defaults !lecture,tty_tickets,!fqdn
131
- I, [2016-01-15T13:56:47.823856 #64433] INFO -- default-centos-71:
132
- I, [2016-01-15T13:56:47.823866 #64433] INFO -- default-centos-71: -## User Aliases
133
- I, [2016-01-15T13:56:47.823883 #64433] INFO -- default-centos-71: -## These aren't often necessary, as you can use regular groups
134
- I, [2016-01-15T13:56:47.823894 #64433] INFO -- default-centos-71: -## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
135
- I, [2016-01-15T13:56:47.823922 #64433] INFO -- default-centos-71: -## rather than USERALIAS
136
- I, [2016-01-15T13:56:47.823935 #64433] INFO -- default-centos-71: -# User_Alias ADMINS = jsmith, mikem
137
- I, [2016-01-15T13:56:47.823945 #64433] INFO -- default-centos-71: +# User privilege specification
138
- I, [2016-01-15T13:56:47.823956 #64433] INFO -- default-centos-71: +root ALL=(ALL) ALL
139
- I, [2016-01-15T13:56:47.823966 #64433] INFO -- default-centos-71:
140
- I, [2016-01-15T13:56:47.823981 #64433] INFO -- default-centos-71:
141
- I, [2016-01-15T13:56:47.823992 #64433] INFO -- default-centos-71: -## Command Aliases
142
- I, [2016-01-15T13:56:47.824002 #64433] INFO -- default-centos-71: -## These are groups of related commands...
143
- I, [2016-01-15T13:56:47.824011 #64433] INFO -- default-centos-71:
144
- I, [2016-01-15T13:56:47.824021 #64433] INFO -- default-centos-71: -## Networking
145
- I, [2016-01-15T13:56:47.824040 #64433] INFO -- default-centos-71: -# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool
146
- I, [2016-01-15T13:56:47.824061 #64433] INFO -- default-centos-71: +# Members of the group 'sysadmin' may gain root privileges
147
- I, [2016-01-15T13:56:47.824072 #64433] INFO -- default-centos-71: +%sysadmin ALL=(ALL) ALL
148
- I, [2016-01-15T13:56:47.824081 #64433] INFO -- default-centos-71:
149
- I, [2016-01-15T13:56:47.824091 #64433] INFO -- default-centos-71: -## Installation and management of software
150
- I, [2016-01-15T13:56:47.824100 #64433] INFO -- default-centos-71: -# Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum
151
- I, [2016-01-15T13:56:47.824110 #64433] INFO -- default-centos-71: -
152
- I, [2016-01-15T13:56:47.824119 #64433] INFO -- default-centos-71: -## Services
153
- I, [2016-01-15T13:56:47.824136 #64433] INFO -- default-centos-71: -# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig
154
- I, [2016-01-15T13:56:47.824147 #64433] INFO -- default-centos-71: -
155
- I, [2016-01-15T13:56:47.824156 #64433] INFO -- default-centos-71: -## Updating the locate database
156
- I, [2016-01-15T13:56:47.824165 #64433] INFO -- default-centos-71: -# Cmnd_Alias LOCATE = /usr/bin/updatedb
157
- I, [2016-01-15T13:56:47.824174 #64433] INFO -- default-centos-71: -
158
- I, [2016-01-15T13:56:47.824184 #64433] INFO -- default-centos-71: -## Storage
159
- I, [2016-01-15T13:56:47.824194 #64433] INFO -- default-centos-71: -# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount
160
- I, [2016-01-15T13:56:47.824203 #64433] INFO -- default-centos-71: -
161
- I, [2016-01-15T13:56:47.824213 #64433] INFO -- default-centos-71: -## Delegating permissions
162
- I, [2016-01-15T13:56:47.824222 #64433] INFO -- default-centos-71: -# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp
163
- I, [2016-01-15T13:56:47.824237 #64433] INFO -- default-centos-71: -
164
- I, [2016-01-15T13:56:47.824246 #64433] INFO -- default-centos-71: -## Processes
165
- I, [2016-01-15T13:56:47.824255 #64433] INFO -- default-centos-71: -# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall
166
- I, [2016-01-15T13:56:47.824265 #64433] INFO -- default-centos-71: -
167
- I, [2016-01-15T13:56:47.824279 #64433] INFO -- default-centos-71: -## Drivers
168
- I, [2016-01-15T13:56:47.824288 #64433] INFO -- default-centos-71: -# Cmnd_Alias DRIVERS = /sbin/modprobe
169
- I, [2016-01-15T13:56:47.824300 #64433] INFO -- default-centos-71: -
170
- I, [2016-01-15T13:56:47.824309 #64433] INFO -- default-centos-71: -# Defaults specification
171
- I, [2016-01-15T13:56:47.824324 #64433] INFO -- default-centos-71: -
172
- I, [2016-01-15T13:56:47.824333 #64433] INFO -- default-centos-71: -#
173
- I, [2016-01-15T13:56:47.824343 #64433] INFO -- default-centos-71: -# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
174
- I, [2016-01-15T13:56:47.824363 #64433] INFO -- default-centos-71: -# You have to run "ssh -t hostname sudo <cmd>".
175
- I, [2016-01-15T13:56:47.824374 #64433] INFO -- default-centos-71: -#
176
- I, [2016-01-15T13:56:47.824384 #64433] INFO -- default-centos-71: -#Defaults requiretty
177
- I, [2016-01-15T13:56:47.824397 #64433] INFO -- default-centos-71: -
178
- I, [2016-01-15T13:56:47.824407 #64433] INFO -- default-centos-71: -#
179
- I, [2016-01-15T13:56:47.824416 #64433] INFO -- default-centos-71: -# Refuse to run if unable to disable echo on the tty. This setting should also be
180
- I, [2016-01-15T13:56:47.824427 #64433] INFO -- default-centos-71: -#Defaults requiretty above.
181
- I, [2016-01-15T13:56:47.824449 #64433] INFO -- default-centos-71: -#
182
- I, [2016-01-15T13:56:47.824459 #64433] INFO -- default-centos-71: -Defaults !visiblepw
183
- I, [2016-01-15T13:56:47.824468 #64433] INFO -- default-centos-71: -
184
- I, [2016-01-15T13:56:47.824481 #64433] INFO -- default-centos-71: -#
185
- I, [2016-01-15T13:56:47.824490 #64433] INFO -- default-centos-71: -# Preserving HOME has security implications since many programs
186
- I, [2016-01-15T13:56:47.824501 #64433] INFO -- default-centos-71: -# use it when searching for configuration files. Note that HOME
187
- I, [2016-01-15T13:56:47.824511 #64433] INFO -- default-centos-71: -# is already set when the the env_reset option is enabled, so
188
- I, [2016-01-15T13:56:47.824521 #64433] INFO -- default-centos-71: -# this option is only effective for configurations where either
189
- I, [2016-01-15T13:56:47.824535 #64433] INFO -- default-centos-71: -# env_reset is disabled or HOME is present in the env_keep list.
190
- I, [2016-01-15T13:56:47.824545 #64433] INFO -- default-centos-71: -#
191
- I, [2016-01-15T13:56:47.824557 #64433] INFO -- default-centos-71: -Defaults always_set_home
192
- I, [2016-01-15T13:56:47.824570 #64433] INFO -- default-centos-71: -
193
- I, [2016-01-15T13:56:47.824579 #64433] INFO -- default-centos-71: -Defaults env_reset
194
- I, [2016-01-15T13:56:47.824594 #64433] INFO -- default-centos-71: -Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
195
- I, [2016-01-15T13:56:47.824604 #64433] INFO -- default-centos-71: -Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
196
- I, [2016-01-15T13:56:47.824614 #64433] INFO -- default-centos-71: -Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
197
- I, [2016-01-15T13:56:47.824626 #64433] INFO -- default-centos-71: -Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
198
- I, [2016-01-15T13:56:47.824641 #64433] INFO -- default-centos-71: -Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
199
- I, [2016-01-15T13:56:47.824651 #64433] INFO -- default-centos-71: -
200
- I, [2016-01-15T13:56:47.824660 #64433] INFO -- default-centos-71: -#
201
- I, [2016-01-15T13:56:47.824669 #64433] INFO -- default-centos-71: -# Adding HOME to env_keep may enable a user to run unrestricted
202
- I, [2016-01-15T13:56:47.824682 #64433] INFO -- default-centos-71: -# commands via sudo.
203
- I, [2016-01-15T13:56:47.824691 #64433] INFO -- default-centos-71: -#
204
- I, [2016-01-15T13:56:47.824710 #64433] INFO -- default-centos-71: -# Defaults env_keep += "HOME"
205
- I, [2016-01-15T13:56:47.824719 #64433] INFO -- default-centos-71: -
206
- I, [2016-01-15T13:56:47.824729 #64433] INFO -- default-centos-71: -Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
207
- I, [2016-01-15T13:56:47.824739 #64433] INFO -- default-centos-71: -
208
- I, [2016-01-15T13:56:47.824748 #64433] INFO -- default-centos-71: -## Next comes the main part: which users can run what software on
209
- I, [2016-01-15T13:56:47.825913 #64433] INFO -- default-centos-71: can be shared between multiple
210
- I, [2016-01-15T13:56:47.825953 #64433] INFO -- default-centos-71: -## systems).
211
- I, [2016-01-15T13:56:47.825966 #64433] INFO -- default-centos-71: -## Syntax:
212
- I, [2016-01-15T13:56:47.825976 #64433] INFO -- default-centos-71: -##
213
- I, [2016-01-15T13:56:47.826000 #64433] INFO -- default-centos-71: -## user MACHINE=COMMANDS
214
- I, [2016-01-15T13:56:47.826012 #64433] INFO -- default-centos-71: -##
215
- I, [2016-01-15T13:56:47.826025 #64433] INFO -- default-centos-71: -## The COMMANDS section may have other options added to it.
216
- I, [2016-01-15T13:56:47.826036 #64433] INFO -- default-centos-71: -##
217
- I, [2016-01-15T13:56:47.826046 #64433] INFO -- default-centos-71: -## Allow root to run any commands anywhere
218
- I, [2016-01-15T13:56:47.826056 #64433] INFO -- default-centos-71: -root ALL=(ALL) ALL
219
- I, [2016-01-15T13:56:47.826065 #64433] INFO -- default-centos-71: -
220
- I, [2016-01-15T13:56:47.826075 #64433] INFO -- default-centos-71: -## Allows members of the 'sys' group to run networking, software,
221
- I, [2016-01-15T13:56:47.826085 #64433] INFO -- default-centos-71: -## service management apps and more.
222
- I, [2016-01-15T13:56:47.826095 #64433] INFO -- default-centos-71: -# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
223
- I, [2016-01-15T13:56:47.826106 #64433] INFO -- default-centos-71: -
224
- I, [2016-01-15T13:56:47.826115 #64433] INFO -- default-centos-71: -## Allows people in group wheel to run all commands
225
- I, [2016-01-15T13:56:47.826125 #64433] INFO -- default-centos-71: -%wheel ALL=(ALL) ALL
226
- I, [2016-01-15T13:56:47.826135 #64433] INFO -- default-centos-71: -
227
- I, [2016-01-15T13:56:47.826147 #64433] INFO -- default-centos-71: -## Same thing without a password
228
- I, [2016-01-15T13:56:47.826157 #64433] INFO -- default-centos-71: -# %wheel ALL=(ALL) NOPASSWD: ALL
229
- I, [2016-01-15T13:56:47.826166 #64433] INFO -- default-centos-71: -
230
- I, [2016-01-15T13:56:47.826176 #64433] INFO -- default-centos-71: -## Allows members of the users group to mount and unmount the
231
- I, [2016-01-15T13:56:47.826185 #64433] INFO -- default-centos-71: -## cdrom as root
232
- I, [2016-01-15T13:56:47.826195 #64433] INFO -- default-centos-71: -# %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom
233
- I, [2016-01-15T13:56:47.826205 #64433] INFO -- default-centos-71: -
234
- I, [2016-01-15T13:56:47.826214 #64433] INFO -- default-centos-71: -## Allows members of the users group to shutdown this system
235
- I, [2016-01-15T13:56:47.826224 #64433] INFO -- default-centos-71: -# %users localhost=/sbin/shutdown -h now
236
- I, [2016-01-15T13:56:47.826234 #64433] INFO -- default-centos-71: -
237
- I, [2016-01-15T13:56:47.826243 #64433] INFO -- default-centos-71: -## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
238
- I, [2016-01-15T13:56:47.849147 #64433] INFO -- default-centos-71:
239
- I, [2016-01-15T13:56:47.849204 #64433] INFO -- default-centos-71: - restore selinux security context
240
- I, [2016-01-15T13:56:47.849221 #64433] INFO -- default-centos-71: Recipe: test::prep_files
241
- I, [2016-01-15T13:56:47.849243 #64433] INFO -- default-centos-71: * file[/tmp/file] action create
242
- I, [2016-01-15T13:56:47.849256 #64433] INFO -- default-centos-71: - create new file /tmp/file
243
- I, [2016-01-15T13:56:47.849268 #64433] INFO -- default-centos-71: - update content in file /tmp/file from none to b94d27
244
- I, [2016-01-15T13:56:47.849281 #64433] INFO -- default-centos-71: --- /tmp/file 2016-01-15 18:56:46.296260336 +0000
245
- I, [2016-01-15T13:56:47.849294 #64433] INFO -- default-centos-71: +++ /tmp/.file20160115-12508-j696go 2016-01-15 18:56:46.296260336 +0000
246
- I, [2016-01-15T13:56:47.849307 #64433] INFO -- default-centos-71: @@ -1 +1,2 @@
247
- I, [2016-01-15T13:56:47.849319 #64433] INFO -- default-centos-71: +hello world
248
- I, [2016-01-15T13:56:47.851062 #64433] INFO -- default-centos-71: - change mode from '' to '0765'
249
- I, [2016-01-15T13:56:47.851082 #64433] INFO -- default-centos-71: - change owner from '' to 'root'
250
- I, [2016-01-15T13:56:47.874494 #64433] INFO -- default-centos-71:
251
- I, [2016-01-15T13:56:47.874554 #64433] INFO -- default-centos-71: - restore selinux security context
252
- I, [2016-01-15T13:56:47.874572 #64433] INFO -- default-centos-71: * directory[/tmp/folder] action create
253
- I, [2016-01-15T13:56:47.874607 #64433] INFO -- default-centos-71: - create new directory /tmp/folder
254
- I, [2016-01-15T13:56:47.874624 #64433] INFO -- default-centos-71: - change mode from '' to '0567'
255
- I, [2016-01-15T13:56:47.874637 #64433] INFO -- default-centos-71: - change owner from '' to 'root'
256
- I, [2016-01-15T13:56:47.899896 #64433] INFO -- default-centos-71:
257
- I, [2016-01-15T13:56:47.899952 #64433] INFO -- default-centos-71: - restore selinux security context
258
- I, [2016-01-15T13:56:47.899969 #64433] INFO -- default-centos-71: * link[/tmp/symlink] action create
259
- I, [2016-01-15T13:56:47.899982 #64433] INFO -- default-centos-71: - create symlink at /tmp/symlink to /tmp/file[2016-01-15T18:56:46+00:00] WARN: /tmp/symlink mode not changed: File.lchmod is unimplemented on this OS and Ruby version
260
- I, [2016-01-15T13:56:47.899996 #64433] INFO -- default-centos-71:
261
- I, [2016-01-15T13:56:47.900008 #64433] INFO -- default-centos-71: - change mode from '' to '0777'
262
- I, [2016-01-15T13:56:47.900020 #64433] INFO -- default-centos-71: - change owner from '' to 'root'
263
- I, [2016-01-15T13:56:47.900031 #64433] INFO -- default-centos-71: - change group from '' to 'root'
264
- I, [2016-01-15T13:56:47.934847 #64433] INFO -- default-centos-71:
265
- I, [2016-01-15T13:56:47.934917 #64433] INFO -- default-centos-71: - execute mkfifo /tmp/pipe
266
- I, [2016-01-15T13:56:47.970742 #64433] INFO -- default-centos-71:
267
- I, [2016-01-15T13:56:47.970803 #64433] INFO -- default-centos-71: - execute mknod /tmp/block_device b 7 7 && chmod 0666 /tmp/block_device && chown root:root /tmp/block_device
268
- I, [2016-01-15T13:56:47.970825 #64433] INFO -- default-centos-71: Recipe: test::default
269
- I, [2016-01-15T13:56:48.114369 #64433] INFO -- default-centos-71:
270
- I, [2016-01-15T13:56:48.114431 #64433] INFO -- default-centos-71: - execute ssh-keygen -t rsa -b 2048 -f /root/.ssh/id_rsa -N ""
271
- I, [2016-01-15T13:56:48.135046 #64433] INFO -- default-centos-71:
272
- I, [2016-01-15T13:56:48.135108 #64433] INFO -- default-centos-71: - execute cat /root/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys
273
- I, [2016-01-15T13:56:48.356414 #64433] INFO -- default-centos-71:
274
- I, [2016-01-15T13:56:48.356467 #64433] INFO -- default-centos-71: - execute ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa vagrant@localhost "echo 1"
275
- I, [2016-01-15T13:56:48.418276 #64433] INFO -- default-centos-71:
276
- I, [2016-01-15T13:56:48.418336 #64433] INFO -- default-centos-71: - create user nopasswd
277
- I, [2016-01-15T13:56:48.453298 #64433] INFO -- default-centos-71:
278
- I, [2016-01-15T13:56:48.453356 #64433] INFO -- default-centos-71: - create user passwd
279
- I, [2016-01-15T13:56:48.489658 #64433] INFO -- default-centos-71:
280
- I, [2016-01-15T13:56:48.489715 #64433] INFO -- default-centos-71: - create user nosudo
281
- I, [2016-01-15T13:56:48.512078 #64433] INFO -- default-centos-71:
282
- I, [2016-01-15T13:56:48.512141 #64433] INFO -- default-centos-71: * template[/etc/sudoers.d/nopasswd] action create
283
- I, [2016-01-15T13:56:48.512162 #64433] INFO -- default-centos-71: - create new file /etc/sudoers.d/nopasswd
284
- I, [2016-01-15T13:56:48.512177 #64433] INFO -- default-centos-71: - update content in file /etc/sudoers.d/nopasswd from none to cfe219
285
- I, [2016-01-15T13:56:48.512192 #64433] INFO -- default-centos-71: --- /etc/sudoers.d/nopasswd 2016-01-15 18:56:46.955589802 +0000
286
- I, [2016-01-15T13:56:48.512207 #64433] INFO -- default-centos-71: +++ /etc/sudoers.d/.nopasswd20160115-12508-3pz574 2016-01-15 18:56:46.955589802 +0000
287
- I, [2016-01-15T13:56:48.512221 #64433] INFO -- default-centos-71: @@ -1 +1,9 @@
288
- I, [2016-01-15T13:56:48.512235 #64433] INFO -- default-centos-71: +# This file is managed by Chef.
289
- I, [2016-01-15T13:56:48.512249 #64433] INFO -- default-centos-71: +# Do NOT modify this file directly.
290
- I, [2016-01-15T13:56:48.512262 #64433] INFO -- default-centos-71: +
291
- I, [2016-01-15T13:56:48.512297 #64433] INFO -- default-centos-71: +
292
- I, [2016-01-15T13:56:48.512330 #64433] INFO -- default-centos-71: +
293
- I, [2016-01-15T13:56:48.512352 #64433] INFO -- default-centos-71: +
294
- I, [2016-01-15T13:56:48.512365 #64433] INFO -- default-centos-71: +%nopasswd ALL=(ALL) NOPASSWD:ALL
295
- I, [2016-01-15T13:56:48.512376 #64433] INFO -- default-centos-71: +
296
- I, [2016-01-15T13:56:48.512389 #64433] INFO -- default-centos-71: - change mode from '' to '0440'
297
- I, [2016-01-15T13:56:48.512401 #64433] INFO -- default-centos-71: - change owner from '' to 'root'
298
- I, [2016-01-15T13:56:48.541101 #64433] INFO -- default-centos-71:
299
- I, [2016-01-15T13:56:48.541164 #64433] INFO -- default-centos-71: - restore selinux security context
300
- I, [2016-01-15T13:56:48.541184 #64433] INFO -- default-centos-71:
301
- I, [2016-01-15T13:56:48.541199 #64433] INFO -- default-centos-71: * template[/etc/sudoers.d/nopasswd] action nothing (skipped due to action :nothing)
302
- I, [2016-01-15T13:56:48.562247 #64433] INFO -- default-centos-71:
303
- I, [2016-01-15T13:56:48.562337 #64433] INFO -- default-centos-71: * template[/etc/sudoers.d/vagrant] action create
304
- I, [2016-01-15T13:56:48.562356 #64433] INFO -- default-centos-71: - update content in file /etc/sudoers.d/vagrant from ce99b2 to dea54e
305
- I, [2016-01-15T13:56:48.562371 #64433] INFO -- default-centos-71: --- /etc/sudoers.d/vagrant 2015-04-04 08:01:37.442806840 +0000
306
- I, [2016-01-15T13:56:48.562384 #64433] INFO -- default-centos-71: +++ /etc/sudoers.d/.vagrant20160115-12508-1tdgnpw 2016-01-15 18:56:47.005614800 +0000
307
- I, [2016-01-15T13:56:48.562397 #64433] INFO -- default-centos-71: @@ -1,2 +1,9 @@
308
- I, [2016-01-15T13:56:48.562415 #64433] INFO -- default-centos-71: -%vagrant ALL=(ALL) NOPASSWD: ALL
309
- I, [2016-01-15T13:56:48.562428 #64433] INFO -- default-centos-71: +# This file is managed by Chef.
310
- I, [2016-01-15T13:56:48.562440 #64433] INFO -- default-centos-71: +# Do NOT modify this file directly.
311
- I, [2016-01-15T13:56:48.562453 #64433] INFO -- default-centos-71: +
312
- I, [2016-01-15T13:56:48.562467 #64433] INFO -- default-centos-71: +
313
- I, [2016-01-15T13:56:48.562479 #64433] INFO -- default-centos-71: +
314
- I, [2016-01-15T13:56:48.562491 #64433] INFO -- default-centos-71: +
315
- I, [2016-01-15T13:56:48.562504 #64433] INFO -- default-centos-71: +%vagrant ALL=(ALL) NOPASSWD:ALL
316
- I, [2016-01-15T13:56:48.562519 #64433] INFO -- default-centos-71: +
317
- I, [2016-01-15T13:56:48.588055 #64433] INFO -- default-centos-71:
318
- I, [2016-01-15T13:56:48.588123 #64433] INFO -- default-centos-71: - restore selinux security context
319
- I, [2016-01-15T13:56:48.588144 #64433] INFO -- default-centos-71:
320
- I, [2016-01-15T13:56:48.588159 #64433] INFO -- default-centos-71: * template[/etc/sudoers.d/vagrant] action nothing (skipped due to action :nothing)
321
- I, [2016-01-15T13:56:48.612217 #64433] INFO -- default-centos-71:
322
- I, [2016-01-15T13:56:48.612277 #64433] INFO -- default-centos-71: * template[/etc/sudoers.d/passwd] action create
323
- I, [2016-01-15T13:56:48.612295 #64433] INFO -- default-centos-71: - create new file /etc/sudoers.d/passwd
324
- I, [2016-01-15T13:56:48.612310 #64433] INFO -- default-centos-71: - update content in file /etc/sudoers.d/passwd from none to 4d27b2
325
- I, [2016-01-15T13:56:48.612353 #64433] INFO -- default-centos-71: --- /etc/sudoers.d/passwd 2016-01-15 18:56:47.058641297 +0000
326
- I, [2016-01-15T13:56:48.612367 #64433] INFO -- default-centos-71: +++ /etc/sudoers.d/.passwd20160115-12508-g5cfj9 2016-01-15 18:56:47.057640797 +0000
327
- I, [2016-01-15T13:56:48.612380 #64433] INFO -- default-centos-71: @@ -1 +1,9 @@
328
- I, [2016-01-15T13:56:48.612392 #64433] INFO -- default-centos-71: +# This file is managed by Chef.
329
- I, [2016-01-15T13:56:48.612407 #64433] INFO -- default-centos-71: +# Do NOT modify this file directly.
330
- I, [2016-01-15T13:56:48.612419 #64433] INFO -- default-centos-71: +
331
- I, [2016-01-15T13:56:48.612431 #64433] INFO -- default-centos-71: +
332
- I, [2016-01-15T13:56:48.612442 #64433] INFO -- default-centos-71: +
333
- I, [2016-01-15T13:56:48.612474 #64433] INFO -- default-centos-71: +
334
- I, [2016-01-15T13:56:48.612488 #64433] INFO -- default-centos-71: +passwd ALL=(ALL) ALL
335
- I, [2016-01-15T13:56:48.612500 #64433] INFO -- default-centos-71: +
336
- I, [2016-01-15T13:56:48.612512 #64433] INFO -- default-centos-71: - change mode from '' to '0440'
337
- I, [2016-01-15T13:56:48.612523 #64433] INFO -- default-centos-71: - change owner from '' to 'root'
338
- I, [2016-01-15T13:56:48.636112 #64433] INFO -- default-centos-71:
339
- I, [2016-01-15T13:56:48.636166 #64433] INFO -- default-centos-71: - restore selinux security context
340
- I, [2016-01-15T13:56:48.636182 #64433] INFO -- default-centos-71:
341
- I, [2016-01-15T13:56:48.636196 #64433] INFO -- default-centos-71: * template[/etc/sudoers.d/passwd] action nothing (skipped due to action :nothing)
342
- I, [2016-01-15T13:57:14.397617 #64433] INFO -- default-centos-71:
343
- I, [2016-01-15T13:57:14.397872 #64433] INFO -- default-centos-71: - execute /opt/chef/embedded/bin/bundle install --without integration tools
344
- I, [2016-01-15T13:57:29.247482 #64433] INFO -- default-centos-71:
345
- I, [2016-01-15T13:57:29.247546 #64433] INFO -- default-centos-71: - execute /opt/chef/embedded/bin/ruby -I lib test/integration/test_local.rb test/integration/tests/*_test.rb
346
- I, [2016-01-15T13:58:01.660067 #64433] INFO -- default-centos-71:
347
- I, [2016-01-15T13:58:01.660123 #64433] INFO -- default-centos-71: - execute /opt/chef/embedded/bin/ruby -I lib test/integration/test_ssh.rb test/integration/tests/*_test.rb
348
- I, [2016-01-15T13:58:02.468712 #64433] INFO -- default-centos-71:
349
- I, [2016-01-15T13:58:02.468775 #64433] INFO -- default-centos-71: - execute /opt/chef/embedded/bin/ruby -I lib test/integration/sudo/passwd.rb
350
- I, [2016-01-15T13:58:03.091545 #64433] INFO -- default-centos-71:
351
- I, [2016-01-15T13:58:03.091622 #64433] INFO -- default-centos-71: - execute /opt/chef/embedded/bin/ruby -I lib test/integration/sudo/nopasswd.rb
352
- I, [2016-01-15T13:58:03.091652 #64433] INFO -- default-centos-71:
353
- I, [2016-01-15T13:58:03.091675 #64433] INFO -- default-centos-71: Running handlers:
354
- I, [2016-01-15T13:58:03.091721 #64433] INFO -- default-centos-71: Running handlers complete
355
- I, [2016-01-15T13:58:03.102531 #64433] INFO -- default-centos-71: Chef Client finished, 25/29 resources updated in 01 minutes 16 seconds
356
- I, [2016-01-15T13:58:03.185455 #64433] INFO -- default-centos-71: Finished converging <default-centos-71> (3m27.95s).
@@ -1,4 +0,0 @@
1
- I, [2016-01-15T13:54:02.405340 #64433] INFO -- Kitchen: -----> Starting Kitchen (v1.4.2)
2
- I, [2016-01-15T13:54:02.957067 #64433] INFO -- Kitchen: -----> Creating <default-centos-71>...
3
- I, [2016-01-15T13:54:35.233653 #64433] INFO -- Kitchen: -----> Converging <default-centos-71>...
4
- I, [2016-01-15T13:58:03.185593 #64433] INFO -- Kitchen: -----> Kitchen is finished. (4m0.79s)
data/test/tools/os.rb ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require 'train'
5
+
6
+ train = Train.create('local')
7
+
8
+ # start or reuse a connection
9
+ conn = train.connection
10
+ os = conn.os
11
+
12
+ # get OS info
13
+ conf = {
14
+ name: os[:name],
15
+ family: os[:family],
16
+ release: os[:release],
17
+ arch: os[:arch],
18
+ }
19
+ puts JSON.dump(conf)
20
+
21
+ # close the connection
22
+ conn.close
@@ -243,13 +243,6 @@ describe 'os common plugin' do
243
243
  it { os.unix?.must_equal(true) }
244
244
  end
245
245
 
246
- describe 'with platform set to solaris2' do
247
- let(:os) { mock_platform('solaris2') }
248
- it { os.solaris?.must_equal(true) }
249
- it { os.linux?.must_equal(false) }
250
- it { os.unix?.must_equal(true) }
251
- end
252
-
253
246
  describe 'with platform set to nexentacore' do
254
247
  let(:os) { mock_platform('nexentacore') }
255
248
  it { os.solaris?.must_equal(true) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r-train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -186,10 +186,12 @@ files:
186
186
  - lib/train.rb
187
187
  - lib/train/errors.rb
188
188
  - lib/train/extras.rb
189
- - lib/train/extras/aix_file.rb
190
189
  - lib/train/extras/command_wrapper.rb
190
+ - lib/train/extras/file_aix.rb
191
191
  - lib/train/extras/file_common.rb
192
- - lib/train/extras/linux_file.rb
192
+ - lib/train/extras/file_linux.rb
193
+ - lib/train/extras/file_unix.rb
194
+ - lib/train/extras/file_windows.rb
193
195
  - lib/train/extras/linux_lsb.rb
194
196
  - lib/train/extras/os_common.rb
195
197
  - lib/train/extras/os_detect_darwin.rb
@@ -197,7 +199,6 @@ files:
197
199
  - lib/train/extras/os_detect_unix.rb
198
200
  - lib/train/extras/os_detect_windows.rb
199
201
  - lib/train/extras/stat.rb
200
- - lib/train/extras/windows_file.rb
201
202
  - lib/train/options.rb
202
203
  - lib/train/plugins.rb
203
204
  - lib/train/plugins/base_connection.rb
@@ -212,6 +213,7 @@ files:
212
213
  - lib/train/transports/winrm.rb
213
214
  - lib/train/transports/winrm_connection.rb
214
215
  - lib/train/version.rb
216
+ - test/appveyor/windows.rb
215
217
  - test/integration/.kitchen.yml
216
218
  - test/integration/.kitchen/default-centos-71.yml
217
219
  - test/integration/.kitchen/default-ubuntu-1204.yml
@@ -286,6 +288,7 @@ files:
286
288
  - test/integration/tests/path_pipe_test.rb
287
289
  - test/integration/tests/path_symlink_test.rb
288
290
  - test/integration/tests/run_command_test.rb
291
+ - test/tools/os.rb
289
292
  - test/unit/extras/command_wrapper_test.rb
290
293
  - test/unit/extras/file_common_test.rb
291
294
  - test/unit/extras/linux_file_test.rb
@@ -330,6 +333,7 @@ signing_key:
330
333
  specification_version: 4
331
334
  summary: Transport interface to talk to different backends.
332
335
  test_files:
336
+ - test/appveyor/windows.rb
333
337
  - test/integration/.kitchen.yml
334
338
  - test/integration/.kitchen/default-centos-71.yml
335
339
  - test/integration/.kitchen/default-ubuntu-1204.yml
@@ -404,6 +408,7 @@ test_files:
404
408
  - test/integration/tests/path_pipe_test.rb
405
409
  - test/integration/tests/path_symlink_test.rb
406
410
  - test/integration/tests/run_command_test.rb
411
+ - test/tools/os.rb
407
412
  - test/unit/extras/command_wrapper_test.rb
408
413
  - test/unit/extras/file_common_test.rb
409
414
  - test/unit/extras/linux_file_test.rb
@@ -1,37 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'shellwords'
4
- require 'train/extras/stat'
5
-
6
- module Train::Extras
7
- class AixFile < LinuxFile
8
- def initialize(backend, path)
9
- super(backend, path)
10
- end
11
-
12
- def content
13
- return @content if defined?(@content)
14
- @content = case
15
- when !exist?, directory?
16
- nil
17
- when size.nil?, size == 0
18
- ''
19
- else
20
- @backend.run_command("cat #{@spath}").stdout || ''
21
- end
22
- end
23
-
24
- def link_path
25
- return nil unless symlink?
26
- @link_path ||= (
27
- @backend.run_command("perl -e 'print readlink shift' #{@spath}").stdout.chomp
28
- )
29
- end
30
-
31
- def mounted
32
- @mounted ||= (
33
- @backend.run_command("lsfs -c #{@spath}")
34
- )
35
- end
36
- end
37
- end