ops_manager_cli 0.4.0 → 0.4.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/.travis.yml +0 -2
- data/CHANGELOG.md +40 -0
- data/{CONTRIBUTION.md → CONTRIBUTING.md} +0 -0
- data/Dockerfile +1 -1
- data/README.md +12 -14
- data/Rakefile +4 -0
- data/lib/ops_manager/director_template_generator.rb +10 -25
- data/lib/ops_manager/product_template_generator.rb +34 -92
- data/lib/ops_manager/version.rb +1 -1
- data/ops_manager.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 726b5d7b7e15a4f5cf99ba65471cf32a91e79f61
|
4
|
+
data.tar.gz: 534134302a6a63bf71492fa3ba1ef3c782ffd046
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bccfac866feed2dcb40443e2eb86144792a5dc47e4b1f3b8f8cc60273f067e4579119528a370b0ef75b9f5d1fdab7d6d0975e2d50ba1042340992b5bfd0bc52a
|
7
|
+
data.tar.gz: b108eb9ccd98112839f5b5d3a8add837efa852965f0d57f335c5e039bfd24a4217c3a341e9e498f1d156b34443677359ac3144cbfd93365eb4680b8807cbd550
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [v0.4.0](https://github.com/compozed/ops_manager_cli/tree/v0.4.0) (2016-10-20)
|
4
|
+
[Full Changelog](https://github.com/compozed/ops_manager_cli/compare/v0.3.0...v0.4.0)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Improve output for appliance deploy/upgrade [\#11](https://github.com/compozed/ops_manager_cli/issues/11)
|
9
|
+
- Improve output for product deploy/upgrade [\#10](https://github.com/compozed/ops_manager_cli/issues/10)
|
10
|
+
- Run errands when applying changes [\#9](https://github.com/compozed/ops_manager_cli/issues/9)
|
11
|
+
- 1.8 support [\#5](https://github.com/compozed/ops_manager_cli/pull/5) ([bonzofenix](https://github.com/bonzofenix))
|
12
|
+
|
13
|
+
**Fixed bugs:**
|
14
|
+
|
15
|
+
- delete-unused-products command not working [\#8](https://github.com/compozed/ops_manager_cli/issues/8)
|
16
|
+
- Hardcoded user name admin when logging agains ops\_manager [\#2](https://github.com/compozed/ops_manager_cli/issues/2)
|
17
|
+
|
18
|
+
**Closed issues:**
|
19
|
+
|
20
|
+
- Link to CLA is broken [\#4](https://github.com/compozed/ops_manager_cli/issues/4)
|
21
|
+
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- Ensures special shell characters are escaped in ovftool command [\#7](https://github.com/compozed/ops_manager_cli/pull/7) ([kpschuck](https://github.com/kpschuck))
|
25
|
+
- Fix issue when collecting errands for applying changes [\#6](https://github.com/compozed/ops_manager_cli/pull/6) ([kpschuck](https://github.com/kpschuck))
|
26
|
+
- Replaces hardcoded 'admin' username with user from login command [\#3](https://github.com/compozed/ops_manager_cli/pull/3) ([kpschuck](https://github.com/kpschuck))
|
27
|
+
|
28
|
+
## [v0.3.0](https://github.com/compozed/ops_manager_cli/tree/v0.3.0) (2016-09-03)
|
29
|
+
[Full Changelog](https://github.com/compozed/ops_manager_cli/compare/v0.2.8...v0.3.0)
|
30
|
+
|
31
|
+
## [v0.2.8](https://github.com/compozed/ops_manager_cli/tree/v0.2.8) (2016-08-09)
|
32
|
+
[Full Changelog](https://github.com/compozed/ops_manager_cli/compare/v0.2.7...v0.2.8)
|
33
|
+
|
34
|
+
## [v0.2.7](https://github.com/compozed/ops_manager_cli/tree/v0.2.7) (2016-07-28)
|
35
|
+
[Full Changelog](https://github.com/compozed/ops_manager_cli/compare/v0.1.1...v0.2.7)
|
36
|
+
|
37
|
+
## [v0.1.1](https://github.com/compozed/ops_manager_cli/tree/v0.1.1) (2016-05-06)
|
38
|
+
|
39
|
+
|
40
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
File without changes
|
data/Dockerfile
CHANGED
data/README.md
CHANGED
@@ -11,32 +11,27 @@ Questions? Pop in our [slack channel](https://cloudfoundry.slack.com/messages/op
|
|
11
11
|
|
12
12
|
### Core features
|
13
13
|
|
14
|
-
- Support
|
14
|
+
- Support vSphere infrastructure (easy to extend to any cloud provider)
|
15
15
|
- Deploy/Upgrade Ops Manager appliance
|
16
16
|
- Deploy/Upgrade product tiles
|
17
17
|
- Generate config settings templates for product tiles deployments
|
18
|
+
- Run errands on deploy/upgrade for ops_manager **< 1.7.x**
|
18
19
|
|
19
20
|
### Other features:
|
20
21
|
|
21
22
|
- Show installation settings
|
22
23
|
- Show installation logs
|
23
|
-
- Get UAA token
|
24
24
|
- Uploads stemcell to Ops Manager
|
25
25
|
- Delete unused products
|
26
|
+
- Curl ops_manager API
|
26
27
|
|
27
|
-
### Limitations:
|
28
28
|
|
29
|
-
|
29
|
+
## Upgrading OpsManager appliance
|
30
30
|
|
31
|
+
To upgrade from **1.7.x** -> **1.8.x** use ops_manager_cli **0.3.1**
|
31
32
|
|
32
|
-
|
33
|
+
Use ops_manager_cli **>=0.4.0** once you are on **1.8.x**.
|
33
34
|
|
34
|
-
- up to 1.8.3.0
|
35
|
-
|
36
|
-
## Upgrading OpsManager appliance from **1.7.x** to **1.8.x**
|
37
|
-
|
38
|
-
On ops_manager_cli **>=0.4.0** support for upgrading to **1.8.x** was removed.
|
39
|
-
Use ops_manager_cli **0.3.1** to upgrade from **1.7.x** -> **1.8.x**.
|
40
35
|
|
41
36
|
## Dependencies
|
42
37
|
|
@@ -86,13 +81,16 @@ The ops_manager_cli tool can be installed in a docker container typically in con
|
|
86
81
|
|
87
82
|
### Building Docker image
|
88
83
|
|
89
|
-
|
90
|
-
|
84
|
+
git co vX.X.X
|
85
|
+
bundle exec rake build
|
86
|
+
docker build \
|
87
|
+
--build-arg DOWNLOAD_URL=http://your_blobstore.com/VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle \
|
88
|
+
-t compozed/ops_manager_cli:vX.X.X
|
91
89
|
|
92
90
|
|
93
91
|
### Provisioning docker image to private registry
|
94
92
|
|
95
|
-
docker tag -f compozed/ops_manager_cli PRI_REGISTRY:PORT/compozed/ops_manager_cli
|
93
|
+
docker tag -f compozed/ops_manager_cli:vX.X.X PRI_REGISTRY:PORT/compozed/ops_manager_cli:vX.X.X
|
96
94
|
docker push PRI_REGISTRY:PORT/compozed/ops_manager_cli
|
97
95
|
|
98
96
|
|
data/Rakefile
CHANGED
@@ -2,11 +2,16 @@ class OpsManager
|
|
2
2
|
class DirectorTemplateGenerator
|
3
3
|
def generate
|
4
4
|
merge_director_template_products
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
|
6
|
+
%w{ installation_schema_version ip_assignments guid }.each do |property_name|
|
7
|
+
installation_settings.delete(property_name)
|
8
|
+
end
|
9
|
+
|
10
|
+
%w{ director_ssl uaa_ssl uaa_credentials uaa_admin_user_credentials
|
11
|
+
uaa_admin_client_credentials }.each do |property_name|
|
12
|
+
product_template["products"][1].delete(property_name)
|
13
|
+
end
|
14
|
+
|
10
15
|
add_merging_strategy_for_networks
|
11
16
|
|
12
17
|
installation_settings.to_h
|
@@ -35,26 +40,6 @@ class OpsManager
|
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
38
|
-
def delete_schema_version
|
39
|
-
installation_settings.delete('installation_schema_version')
|
40
|
-
end
|
41
|
-
|
42
|
-
def delete_ip_assignments
|
43
|
-
installation_settings.delete('ip_assignments')
|
44
|
-
end
|
45
|
-
|
46
|
-
def delete_guid
|
47
|
-
installation_settings.delete('guid')
|
48
|
-
end
|
49
|
-
|
50
|
-
def delete_director_ssl
|
51
|
-
product_template["products"][1].delete("director_ssl")
|
52
|
-
end
|
53
|
-
|
54
|
-
def delete_uaa_ssl
|
55
|
-
product_template["products"][1].delete("uaa_ssl")
|
56
|
-
end
|
57
|
-
|
58
43
|
def product_template
|
59
44
|
@product_template ||= OpsManager::ProductTemplateGenerator.new('p-bosh').generate
|
60
45
|
end
|
@@ -2,7 +2,7 @@ class OpsManager
|
|
2
2
|
class ProductTemplateGenerator
|
3
3
|
OPS_MANAGER_PASSWORD_LENGTH = 32
|
4
4
|
OPS_MANAGER_SECRET_LENGTH = 32
|
5
|
-
OPS_MANAGER_SALT_LENGTH =
|
5
|
+
OPS_MANAGER_SALT_LENGTH = 14
|
6
6
|
|
7
7
|
attr_reader :product_name
|
8
8
|
|
@@ -10,101 +10,35 @@ class OpsManager
|
|
10
10
|
@product_name = product_name
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
13
|
def generate
|
15
|
-
|
16
|
-
|
17
|
-
delete_guid
|
18
|
-
delete_installation_name
|
19
|
-
delete_product_version
|
20
|
-
delete_jobs_guid
|
21
|
-
delete_prepared
|
22
|
-
delete_ops_manager_generated_passwords
|
23
|
-
delete_ops_manager_generated_salts
|
24
|
-
delete_ops_manager_generated_secrets
|
25
|
-
delete_private_key_pem
|
26
|
-
delete_product_version_from_properties
|
27
|
-
add_merging_strategy_for_jobs
|
28
|
-
add_merging_strategy_for_job_properties
|
29
|
-
|
30
|
-
{ 'products' => [ "(( merge on identifier ))" , selected_product ] }
|
31
|
-
end
|
32
|
-
|
33
|
-
def generate_yml
|
34
|
-
generate.to_yaml
|
35
|
-
.gsub('"(( merge on identifier ))"', '(( merge on identifier ))')
|
36
|
-
end
|
37
|
-
|
38
|
-
private
|
39
|
-
def delete_product_version_from_properties
|
40
|
-
delete_value_from_product_properties_if do |property|
|
41
|
-
property['identifier'] == 'product_version'
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def delete_ops_manager_generated_passwords
|
46
|
-
delete_value_from_job_properties_if do |value|
|
47
|
-
value.fetch('password', '').length == OPS_MANAGER_PASSWORD_LENGTH
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def delete_private_key_pem
|
52
|
-
delete_value_from_product_properties_if do |property|
|
53
|
-
property['value'].is_a?(Hash) && property['value'].has_key?('private_key_pem')
|
14
|
+
%w{ prepared guid installation_name product_version stemcell }.each do |property_name|
|
15
|
+
delete_from_product(property_name)
|
54
16
|
end
|
55
17
|
|
56
|
-
|
57
|
-
|
58
|
-
value.has_key?('private_key_pem')
|
18
|
+
%w{ partitions vm_credentials guid }.each do |property_name|
|
19
|
+
delete_from_jobs(property_name)
|
59
20
|
end
|
60
|
-
end
|
61
21
|
|
62
|
-
|
63
|
-
|
64
|
-
value.fetch('salt', '').length == OPS_MANAGER_SALT_LENGTH
|
22
|
+
%w{ password secret salt private_key_pem }.each do |property_name|
|
23
|
+
delete_value_from_job_properties(property_name)
|
65
24
|
end
|
66
|
-
end
|
67
25
|
|
68
|
-
|
69
|
-
|
70
|
-
property['value'].is_a?(Hash) && property['value'].fetch('secret', '').length == OPS_MANAGER_SECRET_LENGTH
|
26
|
+
%w{ secret private_key_pem }.each do |property_name|
|
27
|
+
delete_value_from_product_properties(property_name)
|
71
28
|
end
|
72
29
|
|
73
|
-
|
74
|
-
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def delete_value_from_product_properties_if
|
79
|
-
selected_product.fetch('properties', []).each do |p|
|
80
|
-
p.delete('value') if p.is_a?(Hash) && yield(p)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def delete_value_from_job_properties_if
|
85
|
-
selected_product['jobs'].each do |j|
|
86
|
-
j.fetch('properties', []).each do |p|
|
87
|
-
value = p.fetch('value',{})
|
88
|
-
p.delete('value') if value.is_a?(Hash) && yield(value)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
def delete_prepared
|
94
|
-
selected_product.delete("prepared")
|
95
|
-
end
|
30
|
+
add_merging_strategy_for_jobs
|
31
|
+
add_merging_strategy_for_job_properties
|
96
32
|
|
97
|
-
|
98
|
-
selected_product.delete("guid")
|
33
|
+
{ 'products' => [ "(( merge on identifier ))" , selected_product ] }
|
99
34
|
end
|
100
35
|
|
101
|
-
def
|
102
|
-
|
36
|
+
def generate_yml
|
37
|
+
generate.to_yaml
|
38
|
+
.gsub('"(( merge on identifier ))"', '(( merge on identifier ))')
|
103
39
|
end
|
104
40
|
|
105
|
-
|
106
|
-
selected_product.delete("product_version")
|
107
|
-
end
|
41
|
+
private
|
108
42
|
|
109
43
|
def add_merging_strategy_for_jobs
|
110
44
|
selected_product['jobs'].unshift("(( merge on identifier ))")
|
@@ -116,16 +50,8 @@ class OpsManager
|
|
116
50
|
end
|
117
51
|
end
|
118
52
|
|
119
|
-
def
|
120
|
-
|
121
|
-
end
|
122
|
-
|
123
|
-
def delete_vm_credentials
|
124
|
-
delete_from_jobs('vm_credentials')
|
125
|
-
end
|
126
|
-
|
127
|
-
def delete_jobs_guid
|
128
|
-
delete_from_jobs('guid')
|
53
|
+
def delete_from_product(name)
|
54
|
+
selected_product.delete(name)
|
129
55
|
end
|
130
56
|
|
131
57
|
def selected_product
|
@@ -147,5 +73,21 @@ class OpsManager
|
|
147
73
|
res = OpsManager::Api::Opsman.new(silent: true).get_installation_settings
|
148
74
|
@installation_settings = JSON.parse(res.body)
|
149
75
|
end
|
76
|
+
|
77
|
+
def delete_value_from_product_properties(name)
|
78
|
+
selected_product.fetch('properties', []).each do |p|
|
79
|
+
value = p.fetch('value',{})
|
80
|
+
p.delete('value') if value.is_a?(Hash) && !!value[name]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def delete_value_from_job_properties(name)
|
85
|
+
selected_product['jobs'].each do |j|
|
86
|
+
j.fetch('properties', []).each do |p|
|
87
|
+
value = p.fetch('value',{})
|
88
|
+
p.delete('value') if value.is_a?(Hash) && !!value[name]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
150
92
|
end
|
151
93
|
end
|
data/lib/ops_manager/version.rb
CHANGED
data/ops_manager.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rspec"
|
23
23
|
spec.add_development_dependency "webmock"
|
24
24
|
spec.add_development_dependency "byebug"
|
25
|
+
spec.add_development_dependency "github_changelog_generator"
|
25
26
|
spec.add_dependency "rbvmomi"
|
26
27
|
spec.add_dependency "multipart-post"
|
27
28
|
spec.add_dependency "clamp"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ops_manager_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CompoZed
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: github_changelog_generator
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rbvmomi
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,8 +203,9 @@ files:
|
|
189
203
|
- ".rspec"
|
190
204
|
- ".ruby-version"
|
191
205
|
- ".travis.yml"
|
206
|
+
- CHANGELOG.md
|
192
207
|
- CODE_OF_CONDUCT.md
|
193
|
-
-
|
208
|
+
- CONTRIBUTING.md
|
194
209
|
- Dockerfile
|
195
210
|
- Gemfile
|
196
211
|
- LICENSE.txt
|