Skip to content

coglinev3/ansible-development

Repository files navigation

A Multi-VM Vagrant environment for Developing and Testing Ansible Roles

Documentation Status

This is a multi node Vagrant environment which represents a real life Ansible scenario with one Ansible management node and different Linux OS nodes (Ansible clients).

The supported clients are:

  • Alpine 3.14,
  • Alpine 3.15,
  • Alpine 3.15,
  • Alpine 3.17,
  • Enterprise Linux 7,
  • Enterprise Linux 8,
  • Enterprise Linux 9,
  • Debian 9 (Stretch),
  • Debian 10 (Buster),
  • Debian 11 (Bullseye),
  • Fedora 35,
  • Fedora 36.
  • Fedora 37.
  • Ubuntu 18.04 LTS (Bionic Beaver),
  • Ubuntu 20.04 LTS (Focal Fossa),
  • Ubuntu 22.04 LTS (Jammy Jellyfish).

It is desigend for developing and testing Ansible playbooks and roles on these operating systems. The configuration can be easily changed to support other Linux distributions as well. As Vagrant provider (Hypervisors) VirtualBox or libvirt with KVM can be used, default ist VirtualBox.

For detailed documentation how to use this environment look at: Vagrant environment for testing Ansible Roles

Requirements

This setup was tested under Windows 10 with the following components:

and under Ubuntu 22.04 LTS (Jammy Jellyfish) with

preinstalled.

Setup Vagrant Box Environment

For the next steps open a bash (under Windows a cygwin bash) on the host system.

Get Vagrant box configuration from GitLAB

git clone https://gitlab.com/cogline_vagrant/ansible-development.git
cd ansible-development

Now install Ansible roles defined under provisioning/requirements.yml:

ansible-galaxy install -r provisioning/requirements.yml -p provisioning/roles

Install vagrant plugins

Before using this Vagrant environment, you still need to install the following plugins.

vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-timezone
vagrant plugin install vagrant-vbguest

If you use Vagrant with libvirt under Linux, you also need to install the following plugins

vagrant plugin install vagrant-libvirt
vagrant plugin install vagrant-mutate

and the NFS kernel server:

# on Debian/Ubuntu systems
sudo apt install -y nfs-kernel-server

Initial Provisioning

The next step will start all Ansible client nodes and the Ansible management node. While starting the first time Vagrant will be run any configured provisioners against the running managed machines.

vagrant up

If you want to use vagrant with libvirt instead of VirtualBox, use

VAGRANT_DEFAULT_PROVIDER=libvirt vagrant up

The first time this step takes a while. All required Vagrant Boxes will be downloaded from the Vagrant Cloud. Depending on the speed of the internet connection, this will take a few minutes. Subsequently, the individual systems are started and provisioned in sequence. Then the environment is ready for the development and testing of new Ansible playbooks and roles.

Version

Release: 3.1.2

License

GPLv3

Author Information

Copyright © 2023 Cogline.v3.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published