Skip to content

An Ansible role that deploys Jenkins CI with a job that runs Test Kitchen to test an Ansible role from GitHub.

Notifications You must be signed in to change notification settings

metmajer/jenkins-test-kitchen-ansible

Repository files navigation

jenkins-test-kitchen-ansible

An Ansible role that deploys Jenkins CI with a job that runs Test Kitchen to test an Ansible role from GitHub.

Prepare a Virtual Machine

1. Start a Vagrant Virtual Machine

$ cd vagrant
$ vagrant up

2. Fetch the IP Address of the Virtual Machine

First, connect to your virtual machine:

$ cd vagrant
$ vagrant ssh

Identify the IP address through which the virtual machine is accessible from outside via ifconfig. In this example, we assume the IP address to be 192.168.0.66. exit the virtual machine again.

3. Enter the IP Address of the Virtual Machine into Ansible's hosts file

$ echo 192.168.0.66 > hosts

4. Run the Ansible Playbook to provision the Virtual Machine

$ ansible-playbook -i hosts playbook.yml

When asked for a password, enter vagrant.

Run the Jenkins Build

After successful provisioning, Jenkins can be accessed via, e.g., http://192.168.0.66:8080 in your browser. Jenkins comes readily configured with a project called MyCoolApp. When you build the project, Test Kitchen will execute Serverspec tests against an Ansible role and present its colorized results in the Jenkins Build's Console Output.

Image of Test Kitchen run in Jenkins

About

An Ansible role that deploys Jenkins CI with a job that runs Test Kitchen to test an Ansible role from GitHub.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages