Skip to content

Ansible role repo acting as base for a DevOps centric environment.

License

Notifications You must be signed in to change notification settings

jesmigel/ansible-role-common

Repository files navigation

ansible-role-common

License: MIT CI

Ansible common role. Ansible base role for building DevOps environments

Dependencies

Dependency Comments
Ansible Configuration management automation tool
ESXI (6.7u3) Hypervisor
Python Programming language required to run ansible
Vagrant VM manager. Local dev/test environment
Virtualenv Python environment isolation

Make Commands

Command Comments
address Displays image ipv4 addresses of the VM's identified by vagrant
clean Destroys the VM's and cleans the vagrant cache
config Validates the vagrant configuration
down Suspends the VM's
lint Exectutes ansible-lint that references yamllint
login SSH to the VM using the ssh-config referred to by vagrant
provision Executes the provisioner configured in the vagrant file
status Used to identify the health of the VM with respect to vagrant
up Creates or starts the VM(s)
venv_init initialises virtual env directory. Required by the provisioners

Preflieght Steps

  1. Copy the sample.env.yaml to env.yaml and populate the following fields
    • vm.datastore: # datastore used by the target ESXi Host
    • host: # ESXi host
    • user: # ESXi user id
    • password: # ESXi password
    • networks: # Network in ESXi. It must be on the same subnet as the end user
    • Optional
      • nameserver_list: # List of custom nameservers.
      • nameserver_test: # fqdn resolved by a DNS stated in nameserver_list

Tests

  • Lint: yamllint and ansible-lint. This is automated through Github Actions
  • Functional: Tested through Vagrant and ESXi. To be added in github actions

Usage

This repository is used as an ansible role. It can be referenced through a requirements.yaml file.

# from github
- src: https://github.com/jesmigel/ansible-role-common.git
  name: common

The role can be installed through the ansible-galaxy command:

ansible-galaxy role install -r requirements.yaml -p $ROLE_DIRECTORY

ToDo

  1. DevOps CI/CD test
    • Jenkins