Compare commits

...

116 commits
1.3.0 ... main

Author SHA1 Message Date
Jake Spain
3c7bd24fa4
Merge pull request #61 from puppetlabs/fix-release-prep-param
(maint) Fix missing param in auto_release_prep
2024-01-19 16:48:30 -05:00
Jake Spain
ed03dc54fa
Remove interactive option from release prep script 2024-01-19 15:33:34 -05:00
Jake Spain
d6127f92de
Fix missing param in auto_release_prep 2024-01-15 09:25:02 -05:00
Jake Spain
3eff725eee
Merge pull request #60 from puppetlabs/dependabot/github_actions/actions/github-script-7
Bump actions/github-script from 6 to 7
2023-12-07 08:52:15 -05:00
Jake Spain
d1d4c936c8
Merge pull request #59 from puppetlabs/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-12-07 08:51:59 -05:00
Jake Spain
eed45279f7
Merge pull request #58 from puppetlabs/dependabot/github_actions/actions/setup-java-4
Bump actions/setup-java from 3 to 4
2023-12-07 08:51:39 -05:00
dependabot[bot]
15cd166f9d
Bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 13:49:11 +00:00
dependabot[bot]
71bcf16ee8
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 13:49:05 +00:00
dependabot[bot]
29d3d29fee
Bump actions/setup-java from 3 to 4
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 13:49:00 +00:00
Jake Spain
ee6e01f601
Merge pull request #57 from puppetlabs/repo-sync
Add dependabot, release prep, and label reusable workflows from release-engineering-repo-standards
2023-12-07 08:48:26 -05:00
Jake Spain
f04162f421
syncing files from release-engineering-repo-standards 2023-12-06 17:17:25 -05:00
isaac-hammes
c91e62150a
Merge pull request #53 from puppetlabs/RE-15750
(RE-15750) Handle vm no longer existing when attempting to migrate.
2023-09-07 15:07:44 -07:00
isaac-hammes
a223bf4d61 (RE-15750) Handle vm no longer existing when attempting to migrate. 2023-09-07 12:47:58 -07:00
isaac-hammes
93b43ed99d
Merge pull request #52 from puppetlabs/3.3.4-release-prep
(maint) Release prep for version 3.3.4
2023-08-30 09:39:07 -07:00
isaac-hammes
7a6685927a (maint) Release prep for version 3.3.4 2023-08-30 09:32:36 -07:00
isaac-hammes
24204421c6
Merge pull request #51 from puppetlabs/fix_redis_commands
(maint) Convert booleans and Time objects to strings when being added to redis
2023-08-30 09:07:20 -07:00
isaac-hammes
9fa1072a32 (maint) Convert booleans and Time objects to strings when being added to redis 2023-08-30 08:57:07 -07:00
isaac-hammes
47176e6b5b
Merge pull request #50 from puppetlabs/3.3.3-release-prep
(maint) Release prep for version 3.3.3
2023-08-28 08:25:38 -07:00
isaac-hammes
1dc1d8e568 (maint) Release prep for version 3.3.3 2023-08-28 08:04:27 -07:00
isaac-hammes
b4819f2d39
Merge pull request #49 from puppetlabs/update_for_redis_5
(maint) Update Gemfile.lock and use block for transaction.
2023-08-28 07:48:31 -07:00
isaac-hammes
81f5192ded (maint) Update Gemfile.lock and use block for transaction. 2023-08-28 07:39:11 -07:00
isaac-hammes
18068ecacf
Merge pull request #48 from puppetlabs/3.3.2-release-prep
(maint) Release prep for version 3.3.2
2023-08-23 06:15:20 -07:00
isaac-hammes
69629e1019 (maint) Release prep for version 3.3.2 2023-08-23 06:03:47 -07:00
isaac-hammes
d538eb200e
Merge pull request #47 from puppetlabs/increase_timeout_to_obtain_ip
(maint) Increase timeout for cloned vms to obtain IPs.
2023-08-23 05:59:20 -07:00
isaac-hammes
978fc0031a (maint) Increase timeout for cloned vms to obtain IPs. 2023-08-23 05:46:49 -07:00
Jake Spain
c70920a56e
Merge pull request #45 from puppetlabs/3.3.1-release-prep
3.3.1 release prep
2023-08-22 08:26:27 -04:00
Jake Spain
f0c7d377d1
3.3.1 release prep 2023-08-22 08:23:04 -04:00
Jake Spain
9971e84186
Merge pull request #44 from puppetlabs/fix-returning-ip
(RE-15710) Fix IP address that is returned and increase timeout
2023-08-22 08:16:17 -04:00
Jake Spain
7316431f78
Increase timeout for getting an IP 2023-08-21 23:27:12 -04:00
Jake Spain
f02e0eb19a
Fix getting IP by not returning a bad address 2023-08-21 23:27:03 -04:00
isaac-hammes
7822b2182e
Merge pull request #43 from puppetlabs/3.3.0-release
(maint) Release prep for version 3.3.0
2023-08-18 09:01:19 -07:00
isaac-hammes
506e874dad (maint) Release prep for version 3.3.0 2023-08-18 08:41:54 -07:00
isaac-hammes
c11a783980
Merge pull request #42 from puppetlabs/POD-10
(POD-10) Log reason for failed VM checks.
2023-08-18 06:27:48 -07:00
isaac-hammes
5ca0555a52 (POD-10) Log reason for failed VM checks. 2023-08-17 13:18:33 -07:00
Jake Spain
b2f7907618
Merge pull request #41 from puppetlabs/3.2.0-release-prep
3.2.0 release prep
2023-08-10 12:56:10 -04:00
Jake Spain
677226e83b
3.2.0 release prep 2023-08-10 12:22:00 -04:00
Jake Spain
4ba64b942a
Merge pull request #40 from puppetlabs/bump-jruby
Bump jruby to 9.4.3.0 and update lockfile
2023-08-10 11:39:07 -04:00
Jake Spain
bf46ca2642
Bump jruby to 9.4.3.0 and update lockfile 2023-08-10 10:10:23 -04:00
Jake Spain
5d79042a10
Merge pull request #39 from puppetlabs/revert_issue_management
Revert issue management change
2023-07-11 07:14:20 -04:00
Jake Spain
1e4719e670
Revert "Comment changelog validation until jira support is added"
This reverts commit 9bb978e702.
2023-07-10 15:57:04 -04:00
Jake Spain
9e31ed815f
Revert "Migrate issue management to Jira"
This reverts commit 2f0e817b7c.
2023-07-10 15:56:57 -04:00
Jake Spain
801aaa743c
Merge pull request #37 from puppetlabs/dependabot/bundler/vmpooler-3.1.0
Bump vmpooler from 3.0.0 to 3.1.0
2023-05-16 07:33:19 -04:00
Jake Spain
b1871fdab8
Merge pull request #38 from puppetlabs/dependabot/bundler/thor-1.2.2
Bump thor from 1.2.1 to 1.2.2
2023-05-16 07:32:03 -04:00
dependabot[bot]
922e994017
Bump thor from 1.2.1 to 1.2.2
Bumps [thor](https://github.com/rails/thor) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/rails/thor/releases)
- [Commits](https://github.com/rails/thor/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: thor
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 21:58:13 +00:00
dependabot[bot]
21417260da
Bump vmpooler from 3.0.0 to 3.1.0
Bumps [vmpooler](https://github.com/puppetlabs/vmpooler) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/puppetlabs/vmpooler/releases)
- [Changelog](https://github.com/puppetlabs/vmpooler/blob/main/CHANGELOG.md)
- [Commits](https://github.com/puppetlabs/vmpooler/compare/3.0.0...3.1.0)

---
updated-dependencies:
- dependency-name: vmpooler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 18:37:07 +00:00
Jake Spain
f2525c54af
Merge pull request #36 from puppetlabs/dependabot/bundler/rack-test-2.1.0
Bump rack-test from 2.0.2 to 2.1.0
2023-05-09 14:02:36 -04:00
dependabot[bot]
3f34008795
Bump rack-test from 2.0.2 to 2.1.0
Bumps [rack-test](https://github.com/rack/rack-test) from 2.0.2 to 2.1.0.
- [Release notes](https://github.com/rack/rack-test/releases)
- [Changelog](https://github.com/rack/rack-test/blob/main/History.md)
- [Commits](https://github.com/rack/rack-test/compare/v2.0.2...v2.1.0)

---
updated-dependencies:
- dependency-name: rack-test
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 21:58:18 +00:00
Jake Spain
6b440d4142
Merge pull request #35 from puppetlabs/3.1.0-release-prep
3.1.0 release prep
2023-05-01 09:03:45 -04:00
Jake Spain
9bb978e702
Comment changelog validation until jira support is added 2023-05-01 08:34:18 -04:00
Jake Spain
a6633d81d7
3.1.0 release prep 2023-05-01 08:34:10 -04:00
Jake Spain
03adf195a8
Merge pull request #34 from puppetlabs/migrate-issues
Migrate issue management to Jira
2023-04-20 09:56:08 -04:00
Jake Spain
2f0e817b7c
Migrate issue management to Jira 2023-04-20 08:51:12 -04:00
Jake Spain
1d4d931a10
Merge pull request #33 from puppetlabs/bump-jruby
Bump jruby to 9.4.2.0
2023-04-20 08:22:20 -04:00
Jake Spain
473381b0a0
Bump jruby to 9.4.2.0 2023-04-19 16:57:48 -04:00
Jake Spain
92b1b82c45
Merge pull request #32 from puppetlabs/3.0.0-release
3.0.0 release prep
2023-04-19 09:22:17 -04:00
Jake Spain
09c80138ca
3.0.0 release prep 2023-04-19 08:25:59 -04:00
Jake Spain
98b5fb1841
Merge pull request #29 from puppetlabs/vmpooler-dns-gcp
(RE-15124) Collect VMs IP for use with DNS Plugins
2023-04-18 13:05:53 -04:00
Jake Spain
69e501b93e
Bump vmpooler requirement and add install gemfile script 2023-04-17 09:07:49 -04:00
Jake Spain
08bc1ed814
Added mock info for guest ip address, fix existing tests, add dns config 2023-04-17 09:07:49 -04:00
Jake Spain
c0a23ff0d0
Remove redundant pool_manager spec as it's part of vmpooler core 2023-04-17 09:07:49 -04:00
Jake Spain
0579f15a4b
Fix rubocops 2023-04-17 09:07:18 -04:00
Jake Spain
c0e59a0347
Refactor obtaining and saving ip address 2023-04-17 09:07:18 -04:00
Jake Spain
130736fa9d
Use domain provided by pool's dns_config 2023-04-17 09:07:18 -04:00
Jake Spain
daa49dd1c9
Collect the ip address of created VM for use with dns plugins 2023-03-07 12:01:02 -05:00
Jake Spain
26ad5a7a74
Merge pull request #31 from puppetlabs/release_prep
2.1.0 release prep
2023-03-06 15:03:33 -05:00
Jake Spain
aba2bb3f08
2.1.0 release prep 2023-03-06 14:53:16 -05:00
Jake Spain
32faed5f17
Update and consolidate release prep step 2023-03-06 14:51:39 -05:00
Jake Spain
f7c797a4f4
Merge pull request #30 from puppetlabs/update_timeout_method
(maint) Use timeout builtin to TCPSocket when opening sockets.
2023-03-06 13:59:21 -05:00
Jake Spain
abeabe5a42
Bump to java 11 2023-03-03 22:01:40 -05:00
isaac-hammes
0fb77b917d (maint) Update spec tests for timeout change. 2023-03-02 11:50:06 -08:00
isaac-hammes
5e1891b990 (maint) Update to jruby-9.4.1.0. 2023-03-02 11:38:53 -08:00
isaac-hammes
713a4a2c9d (maint) Use timeout builtin to TCPSocket when opening sockets. 2023-03-02 11:27:55 -08:00
Jake Spain
87274a2d51
Merge pull request #28 from puppetlabs/fix-release-action-again
Fix another bad copy/paste in release action
2023-01-30 10:01:58 -05:00
Jake Spain
e5aa4f9dfa
Fix another bad copy/paste in release action 2023-01-30 09:57:57 -05:00
Jake Spain
956847ecfe
Merge pull request #27 from puppetlabs/fix-release-action
Fix bad copy/paste in release action
2023-01-30 09:53:15 -05:00
Jake Spain
444ef7a729
Fix bad copy/paste in release action 2023-01-30 09:51:11 -05:00
Jake Spain
c7b2ea80ea
Merge pull request #26 from puppetlabs/release_prep
2.0.0 release prep
2023-01-30 09:46:31 -05:00
Jake Spain
c31dda9b1a
2.0.0 release prep 2023-01-30 09:31:43 -05:00
Jake Spain
7cfbf78534
Merge pull request #25 from puppetlabs/use-rbvmomi2
Migrate to rbvmomi2
2023-01-30 09:09:08 -05:00
Jake Spain
960ebc8cc2
Fix more deprecated actions 2023-01-27 16:58:26 -05:00
Jake Spain
68673939f8
Add next version of jruby to testing 2023-01-27 16:47:06 -05:00
Jake Spain
89b1ce67b8
Update gemfile.lock 2023-01-27 16:47:06 -05:00
Jake Spain
8a58862663
Migrate to rbvmomi2, a community fork of the original project 2023-01-27 16:44:56 -05:00
Jake Spain
3c973eee1e
vmpooler should be a dependency 2023-01-27 16:44:56 -05:00
Jake Spain
9f9d8c3486
Merge pull request #24 from puppetlabs/fix_workflow_deprecations
Fix workflow deprecations, changelog, and add docs
2023-01-27 16:44:16 -05:00
Jake Spain
e87b425573
Add changelog generation and release instructions 2023-01-27 15:33:56 -05:00
Jake Spain
c7d24001c5
Add custom VM attribute information to the docs 2023-01-27 14:08:34 -05:00
Jake Spain
0485e2ba61
Fix deprecated method of setting output 2023-01-27 13:55:01 -05:00
Jake Spain
ddf33e26e6
Merge pull request #22 from puppetlabs/add-mend
(RE-15111) Migrate Snyk to Mend Scanning
2023-01-20 14:49:34 -05:00
Jake Spain
070577e542
Migrate Snyk to Mend Scanning 2023-01-20 12:45:58 -05:00
Jake Spain
d2eba9f021
Change dependabot to weekly 2023-01-19 21:24:52 -05:00
Jake Spain
a12e5aac2b
Merge pull request #21 from puppetlabs/update_codeowners
(RE-14811) Remove DIO as codeowners
2022-08-26 10:35:43 -04:00
Jake Spain
ff61a2e1f6
Remove DIO as codeowners 2022-08-26 09:47:20 -04:00
Jake Spain
eee8905bd9
Merge pull request #20 from puppetlabs/migrate_snyk
Add Snyk action
2022-08-18 10:12:56 -04:00
Jake Spain
c0a04b2572
Add Snyk action 2022-08-16 17:31:17 -04:00
Jake Spain
f09818b4f0
Merge pull request #19 from puppetlabs/update-codeowners
Add release-engineering to codeowners
2022-08-08 15:03:24 -04:00
Jake Spain
b74a1b1146
Add release-engineering to codeowners 2022-08-08 14:35:56 -04:00
Samuel
9c938e5ff2
Merge pull request #17 from puppetlabs/dependabot/bundler/rubocop-1.28.2
Update rubocop requirement from ~> 1.1.0 to ~> 1.28.2
2022-07-27 09:04:04 -05:00
Samuel
774e1fdab1
Merge branch 'main' into dependabot/bundler/rubocop-1.28.2 2022-07-27 08:59:50 -05:00
Jake Spain
82e35dfb54
Merge pull request #18 from puppetlabs/bump-vmpooler-2.4
pin to vmpooler 2.4
2022-07-25 16:01:07 -04:00
Samuel Beaulieu
7c096dd3a2
remove upstream spec tests
removed spec tests that did not exercise vsphere code paths
2022-07-25 14:47:51 -05:00
Samuel Beaulieu
fe62c4987a
refresh Gemfile.lock 2022-07-25 13:52:28 -05:00
Samuel Beaulieu
122fc68776
also update github workflows 2022-07-25 13:50:07 -05:00
Samuel Beaulieu
70e2b03cde
pin to vmpooler 2.4 2022-07-25 13:00:26 -05:00
dependabot[bot]
6f641e2f23
Update rubocop requirement from ~> 1.1.0 to ~> 1.28.2
Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.1.0...v1.28.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 13:29:08 +00:00
Tanisha Payne
a9662622d5
Merge pull request #5 from puppetlabs/release-prep-1.5.0
Bump version to 1.5.0, require vmpooler >= 2.1
2021-12-13 11:10:13 -05:00
6f76c536ea
Bump version to 1.5.0, require vmpooler >= 2.1 2021-12-13 10:42:52 -05:00
89be29b5e2
Merge pull request #4 from puppetlabs/fix-purge
Move vsphere specific methods out of vmpooler
2021-12-13 10:24:41 -05:00
Samuel Beaulieu
81d71b8a13
Move vSphere specific methods out of VMPooler
VMPooler has the vSphere provider taken out, moving some vSphere related
methods to the provider:

1) pool_folders
2) get_base_folders

And the related spec tests.
At the same time renaming some configuration and code items
to remove harmful terminology.
Note this version of the vsphere provider needs to run on vmpooler
that also contain the renaming changes (version >2.1)
2021-12-13 10:20:09 -05:00
9b452472f0
Merge pull request #3 from puppetlabs/release-prep
Prep for initial standalone release: v1.4.0
2021-12-08 10:13:54 -05:00
b1b0abb6c2
Require VMPooler 2.0 or greater
VMPooler 2.0.0 was the first release without the code contained in this
respository.
2021-12-08 10:03:18 -05:00
ceb5cda184
Use credentials file for Rubygems auth 2021-12-08 09:43:41 -05:00
Jake Spain
4fa14cc94f
Merge pull request #2 from puppetlabs/add-release-workflow
Add GH Action for releasing gems
2021-12-03 11:53:11 -05:00
3407e500f1
Add GH Action for releasing gems 2021-12-03 10:54:08 -05:00
4d5a040629
Merge pull request #1 from puppetlabs/renaming-and-docs
Fix naming, add docs, add missing test file
2021-12-01 16:00:27 -05:00
90e6ae1a3f
Fix naming, add docs, add missing test file 2021-12-01 15:59:03 -05:00
26 changed files with 1425 additions and 5243 deletions

View file

@ -3,6 +3,11 @@ updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "13:00"
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10

12
.github/workflows/auto_release_prep.yml vendored Normal file
View file

@ -0,0 +1,12 @@
name: Automated release prep
on:
workflow_dispatch:
jobs:
auto_release_prep:
uses: puppetlabs/release-engineering-repo-standards/.github/workflows/auto_release_prep.yml@v1
secrets: inherit
with:
project-type: ruby
version-file-path: lib/vmpooler-provider-vsphere/version.rb

View file

@ -0,0 +1,8 @@
name: Dependabot auto-merge
on: pull_request
jobs:
dependabot_merge:
uses: puppetlabs/release-engineering-repo-standards/.github/workflows/dependabot_merge.yml@v1
secrets: inherit

8
.github/workflows/ensure_label.yml vendored Normal file
View file

@ -0,0 +1,8 @@
name: Ensure label
on: pull_request
jobs:
ensure_label:
uses: puppetlabs/release-engineering-repo-standards/.github/workflows/ensure_label.yml@v1
secrets: inherit

89
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,89 @@
name: Release Gem
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/vmpooler-provider-vsphere'
steps:
- uses: actions/checkout@v4
- name: Get Current Version
uses: actions/github-script@v7
id: cv
with:
script: |
const { data: response } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
})
console.log(`The latest release is ${response.tag_name}`)
return response.tag_name
result-encoding: string
- name: Get Next Version
id: nv
run: |
version=$(grep VERSION lib/vmpooler-provider-vsphere/version.rb |rev |cut -d "'" -f2 |rev)
echo "version=$version" >> $GITHUB_OUTPUT
echo "Found version $version from lib/vmpooler-provider-vsphere/version.rb"
- name: Generate Changelog
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
with:
args: >-
--future-release ${{ steps.nv.outputs.version }}
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Changelog
run : |
set -e
if [[ -n $(git status --porcelain) ]]; then
echo "Here is the current git status:"
git status
echo
echo "The following changes were detected:"
git --no-pager diff
echo "Uncommitted PRs found in the changelog. Please submit a release prep PR of changes after running `./update-changelog`"
exit 1
fi
- name: Generate Release Notes
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
with:
args: >-
--since-tag ${{ steps.cv.outputs.result }}
--future-release ${{ steps.nv.outputs.version }}
--output release-notes.md
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.nv.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
bodyfile: release-notes.md
draft: false
prerelease: false
# This step should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
- name: Install Ruby jruby-9.3.6.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 'jruby-9.4.3.0'
- name: Build gem
run: gem build *.gemspec
- name: Publish gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'

39
.github/workflows/security.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Security
on:
workflow_dispatch:
push:
branches:
- main
jobs:
scan:
name: Mend Scanning
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# setup a package lock if one doesn't exist, otherwise do nothing
- name: check lock
run: '[ -f "Gemfile.lock" ] && echo "package lock file exists, skipping" || bundle lock'
# install java
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
# download mend
- name: download_mend
run: curl -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
- name: run mend
run: java -jar wss-unified-agent.jar
env:
WS_APIKEY: ${{ secrets.MEND_API_KEY }}
WS_WSS_URL: https://saas-eu.whitesourcesoftware.com/agent
WS_USERKEY: ${{ secrets.MEND_TOKEN }}
WS_PRODUCTNAME: RE
WS_PROJECTNAME: ${{ github.event.repository.name }}

View file

@ -18,9 +18,9 @@ jobs:
strategy:
matrix:
ruby-version:
- '2.5.8'
- 'jruby-9.4.3.0'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
@ -34,10 +34,9 @@ jobs:
strategy:
matrix:
ruby-version:
- '2.5.8'
- 'jruby-9.2.12.0'
- 'jruby-9.4.3.0'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:

View file

@ -0,0 +1,3 @@
project=vmpooler-provider-vsphere
user=puppetlabs
exclude_labels=maintenance

98
.rubocop.yml Normal file
View file

@ -0,0 +1,98 @@
inherit_from: .rubocop_todo.yml
AllCops:
Include:
- 'lib/**/*.rb'
Exclude:
- 'scripts/**/*'
- 'spec/**/*'
- 'vendor/**/*'
- Gemfile
- Rakefile
- Vagrantfile
Style/Documentation:
Enabled: false
# Line length is not useful
Layout/LineLength:
Enabled: false
# Empty method definitions over more than one line is ok
Style/EmptyMethod:
Enabled: false
# Due to legacy codebase
# - Globals are used liberally
Style/GlobalVars:
Enabled: false
# - A lot of complexity
Metrics/AbcSize:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/BlockNesting:
Enabled: false
# - Long Methods, Classes, Blocks, and Modules
Metrics/MethodLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
# WordArray is crashing rubocop in lib/vmpooler/api/helpers.rb
Style/WordArray:
Enabled: false
# RedundantBegin is causing lib/pool_manager & vsphere.rb to fail in Ruby 2.5+
Style/RedundantBegin:
Enabled: false
# Either sytnax for regex is ok
Style/RegexpLiteral:
Enabled: false
# In some cases readability is better without these cops enabled
Style/ConditionalAssignment:
Enabled: false
Style/Next:
Enabled: false
Metrics/ParameterLists:
Max: 10
Style/GuardClause:
Enabled: false
# Enforce LF line endings, even when on Windows
Layout/EndOfLine:
EnforcedStyle: lf
# Added in 0.80, don't really care about the change
Style/HashEachMethods:
Enabled: false
# Added in 0.80, don't really care about the change
Style/HashTransformKeys:
Enabled: false
# Added in 0.80, don't really care about the change
Style/HashTransformValues:
Enabled: false
# These short variable names make sense as exceptions to the rule, but generally I think short variable names do hurt readability
Naming/MethodParameterName:
AllowedNames:
- vm
- dc
- s
- x
- f
# Standard comparisons seem more readable
Style/NumericPredicate:
Enabled: true
EnforcedStyle: comparison

286
.rubocop_todo.yml Normal file
View file

@ -0,0 +1,286 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-07-18 15:25:35 -0700 using RuboCop version 0.49.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: with_first_parameter, with_fixed_indentation
Layout/ParameterAlignment:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentOneStep, IndentationWidth.
# SupportedStyles: case, end
Layout/CaseIndentation:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/ClosingParenthesisIndentation:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundClassBody:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundModuleBody:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/FirstHashElementIndentation:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Width, IgnoredPatterns.
Layout/IndentationWidth:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Layout/SpaceAroundEqualsInParameterDefault:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/SpaceAroundKeyword:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceAroundOperators:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/SpaceInsideParens:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 2
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 2
Lint/SuppressedException:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
# Offense count: 1
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 6
Lint/UselessAssignment:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: always, conditionals
Style/AndOr:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
Style/CaseEquality:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: for, each
Style/For:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
# Offense count: 24
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
Style/IfUnlessModifier:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: both, prefix, postfix
Style/NegatedIf:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 3
# Cop supports --auto-correct.
Style/Not:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/vmpooler/api/v1.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowSafeAssignment.
Style/ParenthesesAroundCondition:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/PerlBackrefs:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 5
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'lib/vmpooler/api.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment.
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
Style/TernaryParentheses:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 2
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'lib/vmpooler/api/v1.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/YodaCondition:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:
Exclude:
- 'lib/vmpooler/api/helpers.rb'

136
CHANGELOG.md Normal file
View file

@ -0,0 +1,136 @@
# Changelog
## [3.3.4](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.3.4) (2023-08-30)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.3.3...3.3.4)
**Fixed bugs:**
- \(maint\) Convert booleans and Time objects to strings when being added to redis [\#51](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/51) ([isaac-hammes](https://github.com/isaac-hammes))
## [3.3.3](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.3.3) (2023-08-28)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.3.2...3.3.3)
**Fixed bugs:**
- \(maint\) Update Gemfile.lock and use block for transaction. [\#49](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/49) ([isaac-hammes](https://github.com/isaac-hammes))
## [3.3.2](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.3.2) (2023-08-23)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.3.1...3.3.2)
**Fixed bugs:**
- \(maint\) Increase timeout for cloned vms to obtain IPs. [\#47](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/47) ([isaac-hammes](https://github.com/isaac-hammes))
## [3.3.1](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.3.1) (2023-08-22)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.3.0...3.3.1)
**Fixed bugs:**
- \(RE-15710\) Fix IP address that is returned and increase timeout [\#44](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/44) ([yachub](https://github.com/yachub))
## [3.3.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.3.0) (2023-08-18)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.2.0...3.3.0)
**Implemented enhancements:**
- \(POD-10\) Log reason for failed VM checks. [\#42](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/42) ([isaac-hammes](https://github.com/isaac-hammes))
## [3.2.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.2.0) (2023-08-10)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.1.0...3.2.0)
**Implemented enhancements:**
- Bump jruby to 9.4.3.0 and update lockfile [\#40](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/40) ([yachub](https://github.com/yachub))
**Merged pull requests:**
- Bump thor from 1.2.1 to 1.2.2 [\#38](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/38) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump vmpooler from 3.0.0 to 3.1.0 [\#37](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/37) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump rack-test from 2.0.2 to 2.1.0 [\#36](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/36) ([dependabot[bot]](https://github.com/apps/dependabot))
## [3.1.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.1.0) (2023-05-01)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/3.0.0...3.1.0)
**Merged pull requests:**
- Migrate issue management to Jira [\#34](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/34) ([yachub](https://github.com/yachub))
- Bump jruby to 9.4.2.0 [\#33](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/33) ([yachub](https://github.com/yachub))
## [3.0.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/3.0.0) (2023-04-19)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/2.1.0...3.0.0)
**Breaking changes:**
- \(RE-15124\) Collect VMs IP for use with DNS Plugins [\#29](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/29) ([yachub](https://github.com/yachub))
## [2.1.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/2.1.0) (2023-03-06)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/2.0.0...2.1.0)
**Implemented enhancements:**
- \(RE-15161\) Use timeout builtin to TCPSocket when opening sockets. [\#30](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/30) ([isaac-hammes](https://github.com/isaac-hammes))
## [2.0.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/2.0.0) (2023-01-30)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/1.6.0...2.0.0)
**Implemented enhancements:**
- Migrate to rbvmomi2 [\#25](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/25) ([yachub](https://github.com/yachub))
**Closed issues:**
- Document Custom VM Attribute [\#23](https://github.com/puppetlabs/vmpooler-provider-vsphere/issues/23)
**Merged pull requests:**
- Fix workflow deprecations, changelog, and add docs [\#24](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/24) ([yachub](https://github.com/yachub))
- \(RE-15111\) Migrate Snyk to Mend Scanning [\#22](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/22) ([yachub](https://github.com/yachub))
- \(RE-14811\) Remove DIO as codeowners [\#21](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/21) ([yachub](https://github.com/yachub))
- Add Snyk action [\#20](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/20) ([yachub](https://github.com/yachub))
- Add release-engineering to codeowners [\#19](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/19) ([yachub](https://github.com/yachub))
- Update rubocop requirement from ~\> 1.1.0 to ~\> 1.28.2 [\#17](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/17) ([dependabot[bot]](https://github.com/apps/dependabot))
## [1.6.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/1.6.0) (2022-07-25)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/1.5.0...1.6.0)
**Merged pull requests:**
- pin to vmpooler 2.4 [\#18](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/18) ([sbeaulie](https://github.com/sbeaulie))
## [1.5.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/1.5.0) (2021-12-13)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/1.4.0...1.5.0)
**Merged pull requests:**
- Bump version to 1.5.0, require vmpooler \>= 2.1 [\#5](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/5) ([genebean](https://github.com/genebean))
- Move vsphere specific methods out of vmpooler [\#4](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/4) ([sbeaulie](https://github.com/sbeaulie))
## [1.4.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/1.4.0) (2021-12-08)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/1.3.0...1.4.0)
**Merged pull requests:**
- Prep for initial standalone release: v1.4.0 [\#3](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/3) ([genebean](https://github.com/genebean))
- Add GH Action for releasing gems [\#2](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/2) ([genebean](https://github.com/genebean))
- Fix naming, add docs, add missing test file [\#1](https://github.com/puppetlabs/vmpooler-provider-vsphere/pull/1) ([genebean](https://github.com/genebean))
## [1.3.0](https://github.com/puppetlabs/vmpooler-provider-vsphere/tree/1.3.0) (2021-11-29)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-vsphere/compare/a08cba099f867b1db01a50940ec3ae9239245db5...1.3.0)
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

View file

@ -1,10 +1,10 @@
# This will cause DIO to be assigned review of any opened PRs against
# This will cause RE to be assigned review of any opened PRs against
# the branches containing this file.
# See https://help.github.com/en/articles/about-code-owners for info on how to
# take ownership of parts of the code base that should be reviewed by another
# team.
# DIO will be the default owners for everything in the repo.
* @puppetlabs/dio
# RE will be the default owners for everything in the repo.
* @puppetlabs/release-engineering

View file

@ -1,170 +1,190 @@
PATH
remote: .
specs:
vmpooler-vsphere-provider (1.3.0)
rbvmomi (>= 2.1, < 4.0)
vmpooler-provider-vsphere (3.3.4)
rbvmomi2 (>= 3.1, < 4.0)
vmpooler (~> 3.0)
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
bindata (2.4.10)
bindata (2.4.15)
builder (3.2.4)
climate_control (1.0.1)
climate_control (1.2.0)
coderay (1.1.3)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
diff-lcs (1.4.4)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
deep_merge (1.2.2)
diff-lcs (1.5.0)
docile (1.4.0)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
faraday (2.7.10)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
json (2.6.1)
faraday-net_http (3.0.2)
ffi (1.15.5-java)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
json (2.6.3)
json (2.6.3-java)
method_source (1.0.0)
mock_redis (0.29.0)
ruby2_keywords
multipart-post (2.1.1)
mustermann (1.1.1)
mock_redis (0.37.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
net-ldap (0.17.0)
nio4r (2.5.8)
nokogiri (1.12.5-x86_64-linux)
net-ldap (0.18.0)
nio4r (2.5.9)
nio4r (2.5.9-java)
nokogiri (1.15.4-java)
racc (~> 1.4)
opentelemetry-api (0.17.0)
opentelemetry-common (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-exporter-jaeger (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-common (~> 0.17.0)
opentelemetry-sdk (~> 0.17.0)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
opentelemetry-api (1.2.2)
opentelemetry-common (0.20.0)
opentelemetry-api (~> 1.0)
opentelemetry-exporter-jaeger (0.23.0)
opentelemetry-api (~> 1.1)
opentelemetry-common (~> 0.20)
opentelemetry-sdk (~> 1.2)
opentelemetry-semantic_conventions
thrift
opentelemetry-instrumentation-base (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-instrumentation-concurrent_ruby (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-instrumentation-base (~> 0.17.0)
opentelemetry-instrumentation-redis (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-common (~> 0.17.0)
opentelemetry-instrumentation-base (~> 0.17.0)
opentelemetry-instrumentation-sinatra (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-instrumentation-base (~> 0.17.0)
opentelemetry-resource_detectors (0.17.0)
opentelemetry-instrumentation-base (0.22.2)
opentelemetry-api (~> 1.0)
opentelemetry-registry (~> 0.1)
opentelemetry-instrumentation-concurrent_ruby (0.21.1)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-http_client (0.22.2)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.20.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rack (0.23.4)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.20.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-redis (0.25.3)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.20.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-sinatra (0.23.2)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.20.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rack (~> 0.21)
opentelemetry-registry (0.3.0)
opentelemetry-api (~> 1.1)
opentelemetry-resource_detectors (0.24.1)
google-cloud-env
opentelemetry-sdk
opentelemetry-sdk (0.17.0)
opentelemetry-api (~> 0.17.0)
opentelemetry-common (~> 0.17.0)
opentelemetry-instrumentation-base (~> 0.17.0)
optimist (3.0.1)
parallel (1.21.0)
parser (3.0.3.1)
opentelemetry-sdk (~> 1.0)
opentelemetry-sdk (1.3.0)
opentelemetry-api (~> 1.1)
opentelemetry-common (~> 0.20)
opentelemetry-registry (~> 0.2)
opentelemetry-semantic_conventions
opentelemetry-semantic_conventions (1.10.0)
opentelemetry-api (~> 1.0)
optimist (3.1.0)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pickup (0.0.11)
prometheus-client (2.1.0)
pry (0.14.1)
prometheus-client (4.2.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
puma (5.5.2)
pry (0.14.2-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
puma (6.3.1)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
rack-protection (2.1.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
puma (6.3.1-java)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.1-java)
rack (2.2.8)
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.0.6)
rbvmomi (3.0.0)
rbvmomi2 (3.6.1)
builder (~> 3.2)
json (~> 2.3)
nokogiri (~> 1.10)
nokogiri (~> 1.12, >= 1.12.5)
optimist (~> 3.0)
redis (4.5.1)
regexp_parser (2.1.1)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
redis (5.0.7)
redis-client (>= 0.9.0)
redis-client (0.16.0)
connection_pool
regexp_parser (2.8.1)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rubocop (1.1.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.28.2)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.0.1)
rubocop-ast (>= 1.17.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.13.0)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.21.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
simplecov_json_formatter (0.1.4)
sinatra (3.1.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.1.0)
tilt (~> 2.0)
spicy-proton (2.1.13)
spicy-proton (2.1.15)
bindata (~> 2.3)
spoon (0.0.6)
ffi
statsd-ruby (1.5.0)
thor (1.1.0)
thrift (0.15.0)
tilt (2.0.10)
unicode-display_width (1.8.0)
vmpooler (1.3.0)
thor (1.2.2)
thrift (0.18.1)
tilt (2.2.0)
unicode-display_width (2.4.2)
vmpooler (3.5.1)
concurrent-ruby (~> 1.1)
connection_pool (~> 2.2)
connection_pool (~> 2.4)
deep_merge (~> 1.2)
net-ldap (~> 0.16)
nokogiri (~> 1.10)
opentelemetry-exporter-jaeger (= 0.17.0)
opentelemetry-instrumentation-concurrent_ruby (= 0.17.0)
opentelemetry-instrumentation-redis (= 0.17.0)
opentelemetry-instrumentation-sinatra (= 0.17.0)
opentelemetry-resource_detectors (= 0.17.0)
opentelemetry-sdk (= 0.17.0)
opentelemetry-exporter-jaeger (= 0.23.0)
opentelemetry-instrumentation-concurrent_ruby (= 0.21.1)
opentelemetry-instrumentation-http_client (= 0.22.2)
opentelemetry-instrumentation-redis (= 0.25.3)
opentelemetry-instrumentation-sinatra (= 0.23.2)
opentelemetry-resource_detectors (= 0.24.1)
opentelemetry-sdk (~> 1.3, >= 1.3.0)
pickup (~> 0.0.11)
prometheus-client (~> 2.0)
puma (~> 5.0, >= 5.0.4)
rack (~> 2.2)
prometheus-client (>= 2, < 5)
puma (>= 5.0.4, < 7)
rack (>= 2.2, < 4.0)
rake (~> 13.0)
rbvmomi (>= 2.1, < 4.0)
redis (~> 4.1)
sinatra (~> 2.0)
redis (~> 5.0)
sinatra (>= 2, < 4)
spicy-proton (~> 2.1)
statsd-ruby (~> 1.4)
yarjuf (2.0.0)
@ -172,6 +192,7 @@ GEM
rspec (~> 3)
PLATFORMS
universal-java-11
x86_64-linux
DEPENDENCIES
@ -180,12 +201,11 @@ DEPENDENCIES
pry
rack-test (>= 0.6)
rspec (>= 3.2)
rubocop (~> 1.1.0)
rubocop (~> 1.28.2)
simplecov (>= 0.11.2)
thor (~> 1.0, >= 1.0.1)
vmpooler (~> 1.3, >= 1.3.0)
vmpooler-vsphere-provider!
vmpooler-provider-vsphere!
yarjuf (>= 2.0)
BUNDLED WITH
2.2.22
2.4.10

201
LICENSE Normal file
View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -1,3 +1,44 @@
# vmpooler-vsphere-provider
# vmpooler-provider-vsphere
This is a WIP - do not use yet. The goal is to extract the vSphere provider from the main VMPooler codebase. Force pushes to this repo may happen while initial development is happening.
- [vmpooler-provider-vsphere](#vmpooler-provider-vsphere)
- [Usage](#usage)
- [Custom VM Config Attribute](#custom-vm-config-attribute)
- [Update the Gemfile Lock](#update-the-gemfile-lock)
- [Releasing](#releasing)
- [License](#license)
This is a provider for [VMPooler](https://github.com/puppetlabs/vmpooler) allows using vSphere as a source of machines. This provider was originally part of the main VMPooler code base but was extracted to be a standalone gem so that development could be done independently of VMPooler itself.
## Usage
Include this gem in the same Gemfile that you use to install VMPooler itself and then define one or more pools with the `provider` key set to `vsphere`. VMPooler will take care of the rest.
Examples of deploying VMPooler with this provider can be found in the [puppetlabs/vmpooler-deployment](https://github.com/puppetlabs/vmpooler-deployment) repository.
### Custom VM Config Attribute
This provider sets a custom attribute on the VM called `guestinfo.hostname` to the name of the generated VM, which can be queried from inside the guest OS if VMware Tools is isntalled. For example:
macOS: `"/Library/Application Support/VMware Tools/vmware-tools-daemon" --cmd "info-get guestinfo.hostname"`
Linux or Windows Guest: `vmtoolsd --cmd "info-get guestinfo.hostname"`
See the [VMware Tools Administration docs](https://docs.vmware.com/en/VMware-Tools/12.1.0/com.vmware.vsphere.vmwaretools.doc/GUID-D026777B-606D-4442-957A-B953C2049659.html) for more information about querying information from the GuestInfo variable.
## Update the Gemfile Lock
To update the `Gemfile.lock` run `./update-gemfile-lock`.
Verify, and update if needed, that the docker tag in the script and GitHub action workflows matches what is used in the [vmpooler-deployment Dockerfile](https://github.com/puppetlabs/vmpooler-deployment/blob/main/docker/Dockerfile).
## Releasing
Follow these steps to publish a new GitHub release, and build and push the gem to <https://rubygems.org>.
1. Bump the "VERSION" in `lib/vmpooler-provider-vsphere/version.rb` appropriately based on changes in `CHANGELOG.md` since the last release.
2. Run `./release-prep` to update `Gemfile.lock` and `CHANGELOG.md`.
3. Commit and push changes to a new branch, then open a pull request against `main` and be sure to add the "maintenance" label.
4. After the pull request is approved and merged, then navigate to Actions --> Release Gem --> run workflow --> Branch: main --> Run workflow.
## License
vmpooler-provider-vsphere is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). See the [LICENSE](LICENSE) file for more details.

7
install-gemfile-lock Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# The container tag should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
docker run -it --rm \
-v $(pwd):/app \
jruby:9.4.3.0-jdk11 \
/bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends make git netbase && cd /app && gem install bundler && bundle install --jobs 3; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"'

View file

@ -0,0 +1,5 @@
# frozen_string_literal: true
module VmpoolerProviderVsphere
VERSION = '3.3.4'
end

View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
module VmpoolerVsphereProvider
VERSION = '1.3.0'
end

View file

@ -51,8 +51,13 @@ module Vmpooler
'vsphere'
end
def folder_configured?(folder_title, base_folder, configured_folders, whitelist)
return true if whitelist&.include?(folder_title)
def domain(pool_name)
dns_plugin_name = pool_config(pool_name)['dns_plugin']
dns_config(dns_plugin_name)
end
def folder_configured?(folder_title, base_folder, configured_folders, allowlist)
return true if allowlist&.include?(folder_title)
return false unless configured_folders.keys.include?(folder_title)
return false unless configured_folders[folder_title] == base_folder
@ -63,14 +68,14 @@ module Vmpooler
try = 0 if try.nil?
max_tries = 3
@redis.with_metrics do |redis|
redis.multi
redis.srem("vmpooler__completed__#{pool}", vm_name)
redis.hdel("vmpooler__active__#{pool}", vm_name)
redis.hset("vmpooler__vm__#{vm_name}", 'destroy', Time.now)
redis.multi do |transaction|
transaction.srem("vmpooler__completed__#{pool}", vm_name)
transaction.hdel("vmpooler__active__#{pool}", vm_name)
transaction.hset("vmpooler__vm__#{vm_name}", 'destroy', Time.now.to_s)
# Auto-expire metadata key
redis.expire("vmpooler__vm__#{vm_name}", (data_ttl * 60 * 60))
redis.exec
transaction.expire("vmpooler__vm__#{vm_name}", (data_ttl * 60 * 60))
end
end
start = Time.now
@ -119,7 +124,30 @@ module Vmpooler
try >= max_tries ? raise : retry
end
def purge_unconfigured_folders(base_folders, configured_folders, whitelist)
# Return a list of pool folders
def pool_folders(provider_name)
folders = {}
$config[:pools].each do |pool|
next unless pool['provider'] == provider_name.to_s
folder_parts = pool['folder'].split('/')
datacenter = get_target_datacenter_from_config(pool['name'])
folders[folder_parts.pop] = "#{datacenter}/vm/#{folder_parts.join('/')}"
end
folders
end
def get_base_folders(folders)
base = []
folders.each do |_key, value|
base << value
end
base.uniq
end
def purge_unconfigured_resources(allowlist)
configured_folders = pool_folders(name)
base_folders = get_base_folders(configured_folders)
@connection_pool.with_metrics do |pool_object|
connection = ensured_vsphere_connection(pool_object)
@ -129,7 +157,7 @@ module Vmpooler
folder_children.each do |folder_hash|
folder_hash.each do |folder_title, folder_object|
destroy_folder_and_children(folder_object) unless folder_configured?(folder_title, base_folder, configured_folders, whitelist)
destroy_folder_and_children(folder_object) unless folder_configured?(folder_title, base_folder, configured_folders, allowlist)
end
end
end
@ -364,6 +392,16 @@ module Vmpooler
vm_hash
end
# The inner method requires vmware tools running in the guest os
def get_vm_ip_address(vm_name, pool_name)
@connection_pool.with_metrics do |pool_object|
connection = ensured_vsphere_connection(pool_object)
vm_object = find_vm(pool_name, vm_name, connection)
vm_hash = generate_vm_hash(vm_object, pool_name)
return vm_hash['ip']
end
end
def create_config_spec(vm_name, template_name, extra_config)
RbVmomi::VIM.VirtualMachineConfigSpec(
annotation: JSON.pretty_generate(
@ -517,13 +555,15 @@ module Vmpooler
true
end
def vm_ready?(_pool_name, vm_name)
def vm_ready?(pool_name, vm_name, redis)
begin
open_socket(vm_name, global_config[:config]['domain'])
rescue StandardError => _e
domain = domain(pool_name)
open_socket(vm_name, domain)
rescue StandardError => e
redis.hset("vmpooler__vm__#{vm_name}", 'open_socket_error', e.to_s)
return false
end
redis.hdel("vmpooler__vm__#{vm_name}", 'open_socket_error')
true
end
@ -559,13 +599,30 @@ module Vmpooler
boottime = vm_object.runtime.bootTime if vm_object.runtime&.bootTime
powerstate = vm_object.runtime.powerState if vm_object.runtime&.powerState
ip_maxloop = 240
ip_loop_delay = 1
ip_loop_count = 1
ip = nil
invalid_addresses = /(0|169)\.(0|254)\.\d+\.\d+/
while ip.nil?
sleep(ip_loop_delay)
ip = vm_object.guest_ip
ip = nil if !ip.nil? && ip.match?(invalid_addresses)
unless ip_maxloop == 0
break if ip_loop_count >= ip_maxloop
ip_loop_count += 1
end
end
{
'name' => vm_object.name,
'hostname' => hostname,
'template' => pool_configuration['template'],
'poolname' => pool_name,
'boottime' => boottime,
'powerstate' => powerstate
'powerstate' => powerstate,
'ip' => ip
}
end
@ -609,17 +666,15 @@ module Vmpooler
# This should supercede the open_socket method in the Pool Manager
def open_socket(host, domain = nil, timeout = 5, port = 22, &_block)
Timeout.timeout(timeout) do
target_host = host
target_host = "#{host}.#{domain}" if domain
sock = TCPSocket.new target_host, port
sock = TCPSocket.new(target_host, port, connect_timeout: timeout)
begin
yield sock if block_given?
ensure
sock.close
end
end
end
def get_vm_folder_path(vm_object)
# This gives an array starting from the root Datacenters folder all the way to the VM
@ -1048,6 +1103,9 @@ module Vmpooler
begin
connection = ensured_vsphere_connection(pool_object)
vm_hash = get_vm_details(pool_name, vm_name, connection)
raise StandardError, 'failed to get vm details. vm is unreachable or no longer exists' if vm_hash.nil?
@redis.with_metrics do |redis|
redis.hset("vmpooler__vm__#{vm_name}", 'host', vm_hash['host_name'])
migration_count = redis.scard('vmpooler__migration')
@ -1082,10 +1140,10 @@ module Vmpooler
target_host_object = find_host_by_dnsname(connection, target_host_name)
finish = migrate_vm_and_record_timing(pool_name, vm_name, vm_hash, target_host_object, target_host_name)
@redis.with_metrics do |redis|
redis.multi
redis.hset("vmpooler__vm__#{vm_name}", 'host', target_host_name)
redis.hset("vmpooler__vm__#{vm_name}", 'migrated', true)
redis.exec
redis.multi do |transaction|
transaction.hset("vmpooler__vm__#{vm_name}", 'host', target_host_name)
transaction.hset("vmpooler__vm__#{vm_name}", 'migrated', 'true')
end
end
logger.log('s', "[>] [#{pool_name}] '#{vm_name}' migrated from #{vm_hash['host_name']} to #{target_host_name} in #{finish} seconds")
ensure
@ -1103,10 +1161,10 @@ module Vmpooler
metrics.increment("migrate_to.#{dest_host_name}")
@redis.with_metrics do |redis|
checkout_to_migration = format('%<time>.2f', time: Time.now - Time.parse(redis.hget("vmpooler__vm__#{vm_name}", 'checkout')))
redis.multi
redis.hset("vmpooler__vm__#{vm_name}", 'migration_time', finish)
redis.hset("vmpooler__vm__#{vm_name}", 'checkout_to_migration', checkout_to_migration)
redis.exec
redis.multi do |transaction|
transaction.hset("vmpooler__vm__#{vm_name}", 'migration_time', finish)
transaction.hset("vmpooler__vm__#{vm_name}", 'checkout_to_migration', checkout_to_migration)
end
end
finish
end

15
release-prep Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# The container tag should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
#
# Update Gemfile.lock
docker run -t --rm \
-v $(pwd):/app \
jruby:9.4.3.0-jdk11 \
/bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends git make netbase && cd /app && gem install bundler && bundle install --jobs 3; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"'
# Update Changelog
docker run -t --rm -e CHANGELOG_GITHUB_TOKEN -v $(pwd):/usr/local/src/your-app \
githubchangeloggenerator/github-changelog-generator:1.16.2 \
github_changelog_generator --future-release $(grep VERSION lib/vmpooler-provider-vsphere/version.rb |rev |cut -d "'" -f2 |rev)

View file

@ -198,13 +198,24 @@ MockVirtualDiskManager = Object
MockVirtualMachine = Struct.new(
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.VirtualMachine.html
# From VirtualMachine
:config, :runtime, :snapshot, :summary,
:config, :runtime, :snapshot, :summary, :guest,
# From ManagedEntity
:name,
# From RbVmomi::VIM::ManagedEntity
# https://github.com/vmware/rbvmomi/blob/master/lib/rbvmomi/vim/ManagedEntity.rb
:path
)
) do
# From RbVmomi::VIM::VirtualMachine
# https://github.com/ManageIQ/rbvmomi2/blob/59a5904031a0d7558f306e8d2a05001f9b6822de/lib/rbvmomi/vim/VirtualMachine.rb#L20
def guest_ip
g = self.guest
if g.ipAddress
g.ipAddress
else
nil
end
end
end
MockVirtualMachineSnapshot = Struct.new(
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.Snapshot.html
@ -347,6 +358,12 @@ MockVirtualMachineGuestSummary = Struct.new(
:hostName
)
MockVirtualMachineGuestInfo = Struct.new(
# https://developer.vmware.com/apis/1311/vsphere
# From Data Object - GuestInfo(vim.vm.GuestInfo)
:ipAddress
)
MockVirtualMachineRuntimeInfo = Struct.new(
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.RuntimeInfo.html
# From VirtualMachineRuntimeInfo
@ -801,6 +818,7 @@ end
def mock_RbVmomi_VIM_VirtualMachine(options = {})
options[:snapshot_tree] = nil if options[:snapshot_tree].nil?
options[:name] = 'VM' + rand(65536).to_s if options[:name].nil?
options[:ip] = '192.168.0.2' if options[:ip].nil?
options[:path] = [] if options[:path].nil?
mock = MockVirtualMachine.new()
@ -810,11 +828,13 @@ def mock_RbVmomi_VIM_VirtualMachine(options = {})
mock.summary.runtime = MockVirtualMachineRuntimeInfo.new()
mock.summary.guest = MockVirtualMachineGuestSummary.new()
mock.runtime = mock.summary.runtime
mock.guest = MockVirtualMachineGuestInfo.new()
mock.name = options[:name]
mock.summary.guest.hostName = options[:hostname]
mock.runtime.bootTime = options[:boottime]
mock.runtime.powerState = options[:powerstate]
mock.guest.ipAddress = options[:ip]
unless options[:snapshot_tree].nil?
mock.snapshot = MockVirtualMachineSnapshotInfo.new()

File diff suppressed because it is too large Load diff

View file

@ -50,6 +50,11 @@ describe 'Vmpooler::PoolManager::Provider::VSphere' do
:config:
max_tries: 3
retry_factor: 10
:dns_configs:
:gcp-clouddns:
project: vmpooler-test
domain: vmpooler.example.com
dns_zone_resource_name: vmpooler-example-com
:providers:
:vsphere:
server: "vcenter.domain.local"
@ -71,6 +76,7 @@ describe 'Vmpooler::PoolManager::Provider::VSphere' do
ready_ttl: 1440
clone_target: 'cluster1'
provider: 'vsphere'
dns_config: 'gcp-clouddns'
EOT
)
}
@ -104,36 +110,36 @@ EOT
let(:other_folder) { 'folder2' }
let(:base_folder) { 'dc1/vm/base' }
let(:configured_folders) { { folder_title => base_folder } }
let(:whitelist) { nil }
let(:allowlist) { nil }
it 'should return true when configured_folders includes the folder_title' do
expect(subject.folder_configured?(folder_title, base_folder, configured_folders, whitelist)).to be true
expect(subject.folder_configured?(folder_title, base_folder, configured_folders, allowlist)).to be true
end
it 'should return false when title is not in configured_folders' do
expect(subject.folder_configured?(other_folder, base_folder, configured_folders, whitelist)).to be false
expect(subject.folder_configured?(other_folder, base_folder, configured_folders, allowlist)).to be false
end
context 'with another base folder' do
let(:base_folder) { 'dc2/vm/base' }
let(:configured_folders) { { folder_title => 'dc1/vm/base' } }
it 'should return false' do
expect(subject.folder_configured?(folder_title, base_folder, configured_folders, whitelist)).to be false
expect(subject.folder_configured?(folder_title, base_folder, configured_folders, allowlist)).to be false
end
end
context 'with a whitelist set' do
let(:whitelist) { [ other_folder ] }
context 'with a allowlist set' do
let(:allowlist) { [ other_folder ] }
it 'should return true' do
expect(subject.folder_configured?(other_folder, base_folder, configured_folders, whitelist)).to be true
expect(subject.folder_configured?(other_folder, base_folder, configured_folders, allowlist)).to be true
end
end
context 'with string whitelist value' do
let(:whitelist) { 'whitelist' }
context 'with string allowlist value' do
let(:allowlist) { 'allowlist' }
it 'should raise an error' do
expect(whitelist).to receive(:include?).and_raise('mockerror')
expect(allowlist).to receive(:include?).and_raise('mockerror')
expect{ subject.folder_configured?(other_folder, base_folder, configured_folders, whitelist) }.to raise_error(RuntimeError, 'mockerror')
expect{ subject.folder_configured?(other_folder, base_folder, configured_folders, allowlist) }.to raise_error(RuntimeError, 'mockerror')
end
end
end
@ -297,12 +303,61 @@ EOT
end
end
describe '#purge_unconfigured_folders' do
describe '#pool_folders' do
let(:pool) { 'pool1' }
let(:folder_name) { 'myinstance' }
let(:folder_base) { 'vmpooler' }
let(:folder) { [folder_base,folder_name].join('/') }
let(:datacenter) { 'dc1' }
let(:provider_name) { 'mock_provider' }
let(:expected_response) {
{
folder_name => "#{datacenter}/vm/#{folder_base}"
}
}
context 'when evaluating pool folders' do
before do
expect(subject).not_to be_nil
#replace top-level global config
$config = YAML.load(<<-EOT
---
:providers:
:mock:
:pools:
- name: '#{pool}'
folder: '#{folder}'
size: 1
datacenter: '#{datacenter}'
provider: '#{provider_name}'
- name: '#{pool}2'
folder: '#{folder}'
size: 1
datacenter: '#{datacenter}'
provider: '#{provider_name}2'
EOT
)
end
it 'should return a list of pool folders' do
expect(subject).to receive(:get_target_datacenter_from_config).with(pool).and_return(datacenter)
expect(subject.pool_folders(provider_name)).to eq(expected_response)
end
it 'should raise an error when the provider fails to get the datacenter' do
expect(subject).to receive(:get_target_datacenter_from_config).with(pool).and_raise('mockerror')
expect{ subject.pool_folders(provider_name) }.to raise_error(RuntimeError, 'mockerror')
end
end
end
describe '#purge_unconfigured_resources' do
let(:folder_title) { 'folder1' }
let(:base_folder) { 'dc1/vm/base' }
let(:folder_object) { mock_RbVmomi_VIM_Folder({ :name => base_folder }) }
let(:child_folder) { mock_RbVmomi_VIM_Folder({ :name => folder_title }) }
let(:whitelist) { nil }
let(:allowlist) { nil }
let(:base_folders) { [ base_folder ] }
let(:configured_folders) { { folder_title => base_folder } }
let(:folder_children) { [ folder_title => child_folder ] }
@ -310,6 +365,7 @@ EOT
before(:each) do
allow(subject).to receive(:connect_to_vsphere).and_return(connection)
allow(subject).to receive(:pool_folders).and_return(configured_folders)
end
context 'with an empty folder' do
@ -317,7 +373,7 @@ EOT
expect(subject).to receive(:get_folder_children).with(base_folder, connection).and_return(empty_list)
expect(subject).to_not receive(:destroy_folder_and_children)
subject.purge_unconfigured_folders(base_folders, configured_folders, whitelist)
subject.purge_unconfigured_resources(allowlist)
end
end
@ -325,7 +381,7 @@ EOT
expect(subject).to receive(:get_folder_children).with(base_folder, connection).and_return(folder_children)
allow(subject).to receive(:folder_configured?).and_return(true)
subject.purge_unconfigured_folders(base_folders, configured_folders, whitelist)
subject.purge_unconfigured_resources(allowlist)
end
context 'with a folder that is not configured' do
@ -337,14 +393,14 @@ EOT
it 'should destroy the folder and children' do
expect(subject).to receive(:destroy_folder_and_children).with(child_folder).and_return(nil)
subject.purge_unconfigured_folders(base_folders, configured_folders, whitelist)
subject.purge_unconfigured_resources(allowlist)
end
end
it 'should raise any errors' do
expect(subject).to receive(:get_folder_children).and_throw('mockerror')
expect{ subject.purge_unconfigured_folders(base_folders, configured_folders, whitelist) }.to raise_error(/mockerror/)
expect{ subject.purge_unconfigured_resources(allowlist) }.to raise_error(/mockerror/)
end
end
@ -485,7 +541,7 @@ EOT
end
end
context 'when VM exists but is missing information' do
context 'when VM exists but is missing hostname, boottime, powerstate' do
let(:vm_object) { mock_RbVmomi_VIM_VirtualMachine({
:name => vmname,
})
@ -510,10 +566,55 @@ EOT
end
end
context 'when VM exists but is missing ip' do
let(:vm_object) { mock_RbVmomi_VIM_VirtualMachine({
:name => vmname,
:ip => '',
})
}
it 'should return empty for ip' do
result = subject.get_vm(poolname,vmname)
expect(result['ip']).to eq('')
end
end
context 'when VM exists but contains a self assigned ip' do
let(:vm_object) { mock_RbVmomi_VIM_VirtualMachine({
:name => vmname,
:ip => '169.254.255.255',
})
}
it 'should return nil ip' do
allow(subject).to receive(:sleep)
result = subject.get_vm(poolname,vmname)
expect(result['ip']).to eq(nil)
end
end
context 'when VM exists but contains an invalid ip' do
let(:vm_object) { mock_RbVmomi_VIM_VirtualMachine({
:name => vmname,
:ip => '0.0.0.0',
})
}
it 'should return nil for ip' do
allow(subject).to receive(:sleep)
result = subject.get_vm(poolname,vmname)
expect(result['ip']).to eq(nil)
end
end
context 'when VM exists and contains all information' do
let(:vm_hostname) { "#{vmname}.demo.local" }
let(:boot_time) { Time.now }
let(:power_state) { 'MockPowerState' }
let(:ip) { '192.168.0.2' }
let(:vm_object) { mock_RbVmomi_VIM_VirtualMachine({
:name => vmname,
@ -572,6 +673,11 @@ EOT
expect(result['powerstate']).to eq(power_state)
end
it 'should return the ip' do
result = subject.get_vm(poolname,vmname)
expect(result['ip']).to eq(ip)
end
end
end
@ -1006,14 +1112,17 @@ EOT
end
describe '#vm_ready?' do
let(:domain) { nil }
let(:domain) { 'vmpooler.example.com' }
context 'When a VM is ready' do
before(:each) do
allow(subject).to receive(:domain).and_return('vmpooler.example.com')
expect(subject).to receive(:open_socket).with(vmname, domain)
end
it 'should return true' do
expect(subject.vm_ready?(poolname,vmname)).to be true
redis_connection_pool.with do |redis|
expect(subject.vm_ready?(poolname, vmname, redis)).to be true
end
end
end
@ -1025,7 +1134,10 @@ EOT
end
it 'should return true' do
expect(subject.vm_ready?('missing_pool',vmname)).to be true
allow(subject).to receive(:domain).and_return('vmpooler.example.com')
redis_connection_pool.with do |redis|
expect(subject.vm_ready?('missing_pool', vmname, redis)).to be true
end
end
end
@ -1037,7 +1149,9 @@ EOT
end
it 'should return false' do
expect(subject.vm_ready?(poolname,vmname)).to be false
redis_connection_pool.with do |redis|
expect(subject.vm_ready?(poolname, vmname, redis)).to be false
end
end
end
end
@ -1340,7 +1454,7 @@ EOT
let(:TCPSocket) { double('tcpsocket') }
let(:socket) { double('tcpsocket') }
let(:hostname) { 'host' }
let(:domain) { 'domain.local'}
let(:domain) { 'vmpooler.example.com' }
let(:default_socket) { 22 }
before do
@ -1349,44 +1463,44 @@ EOT
end
it 'opens socket with defaults' do
expect(TCPSocket).to receive(:new).with(hostname,default_socket).and_return(socket)
expect(TCPSocket).to receive(:new).with(hostname,default_socket,{connect_timeout: 5}).and_return(socket)
expect(subject.open_socket(hostname)).to eq(nil)
end
it 'yields the socket if a block is given' do
expect(TCPSocket).to receive(:new).with(hostname,default_socket).and_return(socket)
expect(TCPSocket).to receive(:new).with(hostname,default_socket,{connect_timeout: nil}).and_return(socket)
expect{ |socket| subject.open_socket(hostname,nil,nil,default_socket,&socket) }.to yield_control.exactly(1).times
end
it 'closes the opened socket' do
expect(TCPSocket).to receive(:new).with(hostname,default_socket).and_return(socket)
expect(TCPSocket).to receive(:new).with(hostname,default_socket,{connect_timeout: 5}).and_return(socket)
expect(socket).to receive(:close)
expect(subject.open_socket(hostname)).to eq(nil)
end
it 'opens a specific socket' do
expect(TCPSocket).to receive(:new).with(hostname,80).and_return(socket)
expect(TCPSocket).to receive(:new).with(hostname,80,{connect_timeout: nil}).and_return(socket)
expect(subject.open_socket(hostname,nil,nil,80)).to eq(nil)
end
it 'uses a specific domain with the hostname' do
expect(TCPSocket).to receive(:new).with("#{hostname}.#{domain}",default_socket).and_return(socket)
expect(TCPSocket).to receive(:new).with("#{hostname}.#{domain}",default_socket,{connect_timeout: 5}).and_return(socket)
expect(subject.open_socket(hostname,domain)).to eq(nil)
end
it 'raises error if host is not resolvable' do
expect(TCPSocket).to receive(:new).with(hostname,default_socket).and_raise(SocketError,'getaddrinfo: No such host is known')
expect(TCPSocket).to receive(:new).with(hostname,default_socket,{connect_timeout: 1}).and_raise(SocketError,'getaddrinfo: No such host is known')
expect { subject.open_socket(hostname,nil,1) }.to raise_error(SocketError)
end
it 'raises error if socket is not listening' do
expect(TCPSocket).to receive(:new).with(hostname,default_socket).and_raise(SocketError,'No connection could be made because the target machine actively refused it')
expect(TCPSocket).to receive(:new).with(hostname,default_socket,{connect_timeout: 1}).and_raise(SocketError,'No connection could be made because the target machine actively refused it')
expect { subject.open_socket(hostname,nil,1) }.to raise_error(SocketError)
end

View file

@ -0,0 +1,44 @@
require 'spec_helper'
require 'vmpooler/providers'
describe 'providers' do
let(:providers) do
Vmpooler::Providers.new
end
it '#correct class' do
expect(providers).to be_a Vmpooler::Providers
end
it '#load_all_providers' do
expect(Vmpooler::Providers.load_all_providers.join(', ')).to match(%r{/lib/vmpooler/providers/base.rb})
expect(Vmpooler::Providers.load_all_providers.join(', ')).to match(%r{/lib/vmpooler/providers/dummy.rb})
expect(Vmpooler::Providers.load_all_providers.join(', ')).to match(%r{#{project_root_dir}/lib/vmpooler/providers/vsphere.rb})
end
it '#installed_providers' do
expect(Vmpooler::Providers.installed_providers).to eq(['vmpooler', 'vmpooler-provider-vsphere'])
end
it '#load_by_name' do
expect(Vmpooler::Providers.load_by_name('vsphere').join(', ')).to match(%r{#{project_root_dir}/lib/vmpooler/providers/vsphere.rb})
expect(Vmpooler::Providers.load_by_name('vsphere').join(', ')).to_not match(%r{base.rb})
expect(Vmpooler::Providers.load_by_name('vsphere').join(', ')).to_not match(%r{dummy.rb})
end
it '#load only vpshere' do
expect(providers.load_from_gems('vsphere').join(', ')).to match(%r{#{project_root_dir}/lib/vmpooler/providers/vsphere.rb})
expect(providers.load_from_gems('vsphere').join(', ')).to_not match(%r{base.rb})
expect(providers.load_from_gems('vsphere').join(', ')).to_not match(%r{dummy.rb})
end
it '#load all providers from gems' do
expect(providers.load_from_gems.join(', ')).to match(%r{/lib/vmpooler/providers/base.rb})
expect(providers.load_from_gems.join(', ')).to match(%r{/lib/vmpooler/providers/dummy.rb})
expect(providers.load_from_gems.join(', ')).to match(%r{#{project_root_dir}/lib/vmpooler/providers/vsphere.rb})
end
end

7
update-gemfile-lock Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# The container tag should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
docker run -it --rm \
-v $(pwd):/app \
jruby:9.4.3.0-jdk11 \
/bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends git make netbase && cd /app && gem install bundler && bundle install --jobs 3 && bundle update; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"'

View file

@ -1,10 +1,10 @@
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'vmpooler-vsphere-provider/version'
require 'vmpooler-provider-vsphere/version'
Gem::Specification.new do |s|
s.name = 'vmpooler-vsphere-provider'
s.version = VmpoolerVsphereProvider::VERSION
s.name = 'vmpooler-provider-vsphere'
s.version = VmpoolerProviderVsphere::VERSION
s.authors = ['Puppet']
s.email = ['support@puppet.com']
@ -15,9 +15,8 @@ Gem::Specification.new do |s|
s.files = Dir[ "lib/**/*" ]
s.require_paths = ["lib"]
s.add_dependency 'rbvmomi', '>= 2.1', '< 4.0'
s.add_development_dependency 'vmpooler', '~> 1.3', '>= 1.3.0'
s.add_dependency 'rbvmomi2', '>= 3.1', '< 4.0'
s.add_dependency 'vmpooler', '~> 3.0'
# Testing dependencies
s.add_development_dependency 'climate_control', '>= 0.2.0'
@ -25,7 +24,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'pry'
s.add_development_dependency 'rack-test', '>= 0.6'
s.add_development_dependency 'rspec', '>= 3.2'
s.add_development_dependency 'rubocop', '~> 1.1.0'
s.add_development_dependency 'rubocop', '~> 1.28.2'
s.add_development_dependency 'simplecov', '>= 0.11.2'
s.add_development_dependency 'thor', '~> 1.0', '>= 1.0.1'
s.add_development_dependency 'yarjuf', '>= 2.0'