WahlNetwork / vester

Easily validate and remediate your vSphere configuration
https://wahlnetwork.com
Apache License 2.0
146 stars 45 forks source link

Run Vester in Docker Container #206

Open jeffgreenca opened 6 years ago

jeffgreenca commented 6 years ago

There are about three issues with running Vester in a Docker container:

  1. The VMware PowerCLI Core container doesn't appear to properly load Pester
  2. Vester uses hard-coded "\" path delimiters, which causes powershell core to fail on mixed paths
  3. PowerCLI Core doesn't support VMware.VumAutomation

I've addressed these three issues in the following ways:

  1. Pester: Created a container based on Microsoft's PowerShell container plus VMware PowerCLI: https://hub.docker.com/r/jeffgreenca/mspowercli/ that can load Pester
  2. Tweaked Vester code to intelligently handle platform-specific path delimiters
  3. Disabled explicit loading of the VMware.VumAutomation module

The code changes are available in my working branch https://github.com/jeffgreenca/vester/tree/feature/dockerized.

Why?!

This approach keeps Vester and its dependencies happily in their Docker container, making it easy for me to run this as part of a Jenkins pipeline.

What about a pull request?

Since I am actually using my working dockerized branch, I pulled in a handful of additional tests that have yet to be merged to this main repository. I figure it would make sense to resolve those first, then the PR should only include dockerizing specific changes. But if there is a better way, let me know!

brianbunke commented 6 years ago

Would love this 😃

Will get your existing PRs processed. (Long overdue for another version ship!)