https://github.com/avishayil/ansible_test_kitchen_windows_role
Ansible Role for Windows hosts on AWS EC2 instances, Tested with Test-Kitchen and Pester
https://github.com/avishayil/ansible_test_kitchen_windows_role
ansible aws devops ec2 pester role roles test-kitchen testing
Last synced: about 2 months ago
JSON representation
Ansible Role for Windows hosts on AWS EC2 instances, Tested with Test-Kitchen and Pester
- Host: GitHub
- URL: https://github.com/avishayil/ansible_test_kitchen_windows_role
- Owner: avishayil
- Created: 2018-12-06T22:29:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-06T23:01:52.000Z (over 7 years ago)
- Last Synced: 2025-10-19T21:39:46.068Z (8 months ago)
- Topics: ansible, aws, devops, ec2, pester, role, roles, test-kitchen, testing
- Language: Python
- Homepage: https://medium.com/@avishayil/testing-ansible-roles-on-windows-hosts-using-test-kitchen-and-aws-b6aa69e8b29
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ansible_test_kitchen_windows_role
=========
This role is an example role for using `test-kitchen` on ansible roles that is meant to run on Windows hosts.
We use AWS EC2 to deploy the machines,
Role Tasks
--------------
- **main** - Downloading and Installing Google Chrome on the target machine.
Role Variables
--------------
- This role does not require any variables.
Outputs
------------
- This role has no outputs.
Dependencies
------------
- This role does not have any dependencies.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
# Assuming that you have some machines in 'jmeter' hosts group
- hosts: tag_kitchen_type_windows
gather_facts: no
tasks:
- include_role:
name: ansible_test_kitchen_windows_role
Testing
-------
We use [Test-Kitchen](https://github.com/test-kitchen/test-kitchen) for testing ansible roles that was meant to run on Windows hosts.
- Install [ChefDK](https://downloads.chef.io/chefdk)
- Install `chef` gems:
* `$ chef gem install 'kitchen-ansible'`
* `$ chef gem install 'winrm'`
* `$ chef gem install 'winrm-fs'`
* `$ chef gem install 'kitchen-pester'`
- Copy `.kitchen.yml` to `.kitchen.local.yml`, edit and override per your needs (instance profile, subnet, keypair, etc).
- Run `$ kitchen create` and take note of the windows machine that was created.
- Make sure that the following files are executable (by running `chmod +x file`):
* `$ chmod +x inventory/generate_inventory.sh`
* `$ chmod +x inventory/ec2.py`
- Update the hosts file on the ansible inventory running `$ ./inventory/generate_inventory.sh` from the root of the repository
- Run `$ kitchen converge` to run the default playbook from the provisioned ansible machine on the windows host.
- Run `$ kitchen verify` for running pester tests.
- Run `$ kitchen destroy` to terminate instances.
Todo
-------
License
-------
BSD
Author Information
------------------
Avishay Bar,
Cloud Initiatives team,
CyberArk 2018