|
1 | 1 | Lab Config |
2 | 2 | ====================== |
3 | | -A collection of simple scripts that run against a vSphere environment to enforce consistency and enables self-healing on a regular basis. The premise is that you'd want to fill out a vars file with your standards, and then let the script engine run hourly / nightly / weekly to control drift and absorb new assets that are brought online. |
4 | | - |
5 | | -## Description |
6 | | -Pretty straight forward. The engine's job is to start up a job for each script. Each script parses the vars file to determine what variables and options you want enforced. |
7 | | -- Set standards for a lab environment (which is what I do) and use a pull or utility server to run the engine on a schedule. |
8 | | -- Pick apart the scripts to use with other orchestration engines, or just as ideas for your code. |
9 | | - |
10 | | -## Installation |
11 | | -Copy or fork the repo into your environment. Make sure you have PowerShell 4.0+ installed, along with PowerCLI 5.8+. The scripts are not signed, so you'll need to adjust your PowerShell ExecutionPolicy based on where you're running the engine file. |
12 | | - |
13 | | -## Usage Instructions |
14 | | -Here's the scoop. |
15 | | - |
16 | | -1. Update the vars.ps1 file with your domain specific information. |
17 | | -2. Decide how you wish to run the scripts: |
18 | | - 2. Option 1: Run the engine.ps1 file, which will call all of the scripts in the various folders. |
19 | | - 3. Option 2: If you don't want to run all of the scripts, open up the engine.ps1 file and edit the $jobMap variable and remove references to the scripts you wish to remove. |
20 | | - 4. Option 3: Just ignore the engine.ps1 file and run the scripts individually. They will still use the vars.ps1 file and have some limited output to the console. |
21 | | - |
22 | | -Here's an example of what the $jobMap var looks like: |
23 | | -``` |
24 | | -$jobMap = [Ordered]@{ |
25 | | - "DNS" = "\VMware\set-dns.ps1"; |
26 | | - "NTP" = "\VMware\set-ntp.ps1"; |
27 | | - "SSH" = "\VMware\set-ssh.ps1" |
28 | | -} |
29 | | -``` |
30 | | - |
31 | | -## Future |
32 | | -This is mainly a lab helper for Wahl Network, but I figured the code examples might be interesting to folks, or others with home labs might want to take advantage of the scripts. |
33 | | -- Microsoft scripts |
34 | | - - DNS for clients |
35 | | - - Network RSS settings |
36 | | - - WinRM control |
37 | | -- More 3rd party stuff |
38 | | - - PernixData is on my radar |
39 | | - - NSX perhaps? |
40 | | - |
41 | | -## Contribution |
42 | | -Create a fork of the project into your own reposity. Make all your necessary changes and create a pull request with a description on what was added or removed and details explaining the changes in lines of code. If approved, project owners will merge it. |
43 | | - |
44 | | -Licensing |
45 | | ---------- |
46 | | -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> |
47 | 3 |
|
48 | | -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. |
| 4 | +This is a community project that aims to provide an extremely light-weight approach to vSphere configuration management using Pester and PowerCLI. Each component monitored is both tested and remediated against drift. The end-state configuration is abstracted into a simple config file. The entire project is written in PowerShell. |
| 5 | + |
| 6 | +# Requirements |
| 7 | + |
| 8 | +You'll just need a few free pieces of software. |
| 9 | + |
| 10 | +1. PowerShell version 4+ |
| 11 | +2. [PowerCLI version 5.8+](http://www.vmware.com/go/powercli) |
| 12 | +5. [Pester](https://github.com/pester/Pester) |
| 13 | +4. (optional) [Windows Management Framework 5.0](https://www.microsoft.com/en-us/download/details.aspx?id=50395) |
| 14 | + |
| 15 | +# Installation |
| 16 | + |
| 17 | +Download the files contained within this project anywhere you want. You can even make different copies for different environments. |
| 18 | + |
| 19 | +# Usage Instructions |
| 20 | + |
| 21 | +1. Edit the `Config.ps1` file with your specific environmental variables for DRS, NTP, SSH, etc. |
| 22 | +1. Open a PowerShell console. |
| 23 | +2. Navigate to the project folder that you downloaded. |
| 24 | +3. Run `Invoke-Pester` to launch the tests. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +# Future |
49 | 29 |
|
50 | | -Support |
51 | | -------- |
52 | | -Please file bugs and issues at the Github issues page. The code and documentation are released with no warranties or SLAs and are intended to be supported through a community driven process. |
| 30 | +The community module is not officially supported and should be **used at your own risk**. |
| 31 | + |
| 32 | +I'd like to see more tests added for things people find important. This will be done as time permits. :) |
| 33 | + |
| 34 | +# Contribution |
| 35 | + |
| 36 | +Everyone is welcome to contribute to this project. Here are the steps involved: |
| 37 | + |
| 38 | +1. Create a fork of the project into your own repository. |
| 39 | +2. From your fork, create a new feature branch (other than master) that expresses your feature or enhancement. |
| 40 | +3. Make all your necessary changes in your feature branch. |
| 41 | +4. Create a pull request with a description on what was added or removed and details explaining the changes in lines of code. |
| 42 | + |
| 43 | +If approved, project owners will merge it. |
| 44 | + |
| 45 | +# Licensing |
| 46 | + |
| 47 | +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 |
| 48 | + |
| 49 | +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. |
0 commit comments