Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharepointoscar/Windows-Ansible
An example of using Ansible as a Provisioner within a Vagrant file and using ServerSpec for tests.
https://github.com/sharepointoscar/Windows-Ansible
ansible vagrant windows
Last synced: 3 months ago
JSON representation
An example of using Ansible as a Provisioner within a Vagrant file and using ServerSpec for tests.
- Host: GitHub
- URL: https://github.com/sharepointoscar/Windows-Ansible
- Owner: sharepointoscar
- Created: 2017-04-21T21:57:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T06:05:50.000Z (over 7 years ago)
- Last Synced: 2024-05-28T03:20:50.696Z (6 months ago)
- Topics: ansible, vagrant, windows
- Language: PowerShell
- Homepage:
- Size: 15.9 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - sharepointoscar/Windows-Ansible - An example of using Ansible as a Provisioner within a Vagrant file and using ServerSpec for tests. (PowerShell)
README
# Ansible Examples on Windows Server 2016
----------------This repository demonstrates:
- Using Packer to build a machine with specific configuration
- Using Vagrant to further configure the machine
- Using ServerSpec to run tests against your machine to ensure desired state configuration is in place### About ServerSpec
>With Serverspec, you can write RSpec tests for checking your servers are configured correctly.
>Serverspec tests your servers’ actual state by executing command locally, via SSH, via WinRM, via Docker API and so on. So you don’t need to install any agent softwares on your servers and can use any configuration management tools, Puppet, Ansible, CFEngine, Itamae and so on.
But the true aim of Serverspec is to help refactoring infrastructure code.
## Build the Windows 2016 Box
To build the Windows Server, we use Packer. There are three providers in the vagrant template `vmware-fusion` `vmware-workstation` and `virtualbox-iso`Here is how you build the virtualbox box using packer by specifying the template json file.
```bash
packer build --only=virtualbox-iso windows_2016.json
```## Running Tests
First, **vagrant-serverspec** is required, you can install it by executing `vagrant plugin install vagrant-serverspec`Next, execute `vagrant up` and the since we added the _serverspec_ provisioner within our vagrantfile like so
```bash
config.vm.provision :serverspec do |spec|
spec.pattern = 'spec/oscar-ansible-windows2016/check_features_spec.rb'
end
```
our tests will run at the time the VM is spinning up.