train-vsphere 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -5
- data/lib/train-vsphere/connection.rb +2 -1
- data/lib/train-vsphere/version.rb +1 -1
- metadata +1 -2
- data/lib/test.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b45bbaca977baab3665dcf82c6bf5bf45eee8395f62a9bed78d90f4c6dd706e
|
4
|
+
data.tar.gz: c8e9860f5ef0f872a4f3cd9b5246a38be4e01453cc220f3d0a4ccce390b2e54f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b37d7d24f7018fc0cf6b341e5b7a1fd0b97be4d9f6258cbdaf4cd32efe65210fb916f5ae2ea6da9a146e6529662d8ef51b178ecbcd6b7f6b571a7f9b9536cf7
|
7
|
+
data.tar.gz: e316a66f1ad78db1ed9ba2e7cb46fe42b5b3bf577b09a6518fd0fa22aebb5f0fcec8790524090fc02426f892712b587de33ab848ade7e90c96aebcff735c42f5
|
data/README.md
CHANGED
@@ -42,21 +42,25 @@ VSphereAutomation::Appliance::AccessConsolecliApi.new(@authtoken).get.value
|
|
42
42
|
|
43
43
|
An example of a resource
|
44
44
|
```ruby
|
45
|
-
|
46
45
|
class Vcsa < Inspec.resource(1)
|
47
46
|
name 'vcsa'
|
48
47
|
supports platform: 'vsphere'
|
49
48
|
desc 'Use the vsphere audit resource to get information from the vSphere API'
|
50
49
|
|
51
50
|
def initialize
|
52
|
-
|
51
|
+
begin
|
52
|
+
@auth_token = inspec.backend.authenticate
|
53
|
+
rescue VSphereAutomation::ApiError => e
|
54
|
+
fail Train::ClientError
|
55
|
+
end
|
53
56
|
end
|
57
|
+
|
54
58
|
def ssh
|
55
59
|
begin
|
56
|
-
|
60
|
+
return VSphereAutomation::Appliance::AccessConsolecliApi.new(@auth_token).get.value
|
57
61
|
|
58
62
|
rescue VSphereAutomation::ApiError => e
|
59
|
-
|
63
|
+
fail Train::ClientError
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
@@ -65,7 +69,8 @@ class Vcsa < Inspec.resource(1)
|
|
65
69
|
end
|
66
70
|
|
67
71
|
def authenticate
|
68
|
-
|
72
|
+
|
73
|
+
|
69
74
|
end
|
70
75
|
end
|
71
76
|
|
@@ -87,6 +92,7 @@ control 'vcenter-appliance-VCSA-001-1' do # A unique ID f
|
|
87
92
|
its('ssh') {should cmp 'false'}
|
88
93
|
end
|
89
94
|
end
|
95
|
+
```
|
90
96
|
|
91
97
|
|
92
98
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: train-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sjors Robroek
|
@@ -47,7 +47,6 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- Gemfile
|
49
49
|
- README.md
|
50
|
-
- lib/test.rb
|
51
50
|
- lib/train-vsphere.rb
|
52
51
|
- lib/train-vsphere/connection.rb
|
53
52
|
- lib/train-vsphere/platform.rb
|
data/lib/test.rb
DELETED