GithubHelp home page GithubHelp logo

matthodge / ansible-testkitchen-windows Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 4.0 10 KB

Running Ansible playbooks against Windows and testing with Pester

Home Page: https://hodgkins.io/testing-ansible-roles-windows-test-kitchen

PowerShell 73.05% Ruby 26.95%

ansible-testkitchen-windows's Introduction

Ansible / Test-Kitchen / Windows / Pester

This repository is an example of how you can test Ansible roles meant for Windows machines using test-kitchen.

The process will build an Ansible server as part of a test-kitchen run, apply configuration to a Windows node and then tests via Pester.

You can read a detailed blog post about this:

https://hodgkins.io/testing-ansible-roles-windows-test-kitchen

Setup your workstation

I HIGHLY recommend using chefdk and its version of Ruby, especially on Windows platforms.

Install the following:

  • ChefDK
  • Vagrant
  • VirtualBox

Install required Ruby gems

Before starting we need to install some Ruby gems.

# enter the kitchen directory
cd kitchen

# use bundler to install the gems
chef exec bundle install

Run test-kitchen

With everything installed we can start using test-kitchen.

# enter the kitchen directory
cd kitchen

# create the vms
# on windows you may get a UAC prompt when virtualbox initially configures networking 
kitchen create

# apply the ansible role to the windows server
kitchen converge

# run the tests against the windows server
kitchen verify

# delete the vms
kitchen destroy

Linting

I am using Scrutinizer CI to lint the role. See .scrutinizer.yml.

Resources

ansible-testkitchen-windows's People

Contributors

matthodge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.