An Inspec profile for asserting compliance withe the EGI Ansible Style Guide
Switch branches/tags
Nothing to show
Clone or download

README.md

Build Status DOI

EGI Ansible Fashion Police

This is an InSpec profile, which tests compliance with the EGI Ansible Style.

This profile is meant to guide developers of Ansible roles for use in the EGI federation write them consistently with a consensus-based style guide.

Controls

We implement controls for:

according to the Ansible style guide in use.

How to use this profile

TL;DR: set a few variables, run the profile:

  1. You will need to interact with the GitHub API - get a token and set it in the environment : export GITHUB_TOKEN=super_secret_token
  2. Set the name of the repo you want to assert compliance of : export GITHUB_REPO=cmd (this should be a repo under the @EGI-Foundation org)
  3. inspec supermarket exec brucellino/ansible-style-guide
  4. If you want it hot off the press, use the git fetcher : inspec exec -b local http://github.com/EGI-Foundation/ansible-fashion-police

This profile should be included in your continuous integration pipeline.

Prerequisites

You will need Inspec to use this profile. This implies a ruby ( ~> 2.4) runtime environment and the necessary gems.

  1. Install ruby gems
  2. Install bundler : gem install bundler
  3. Install dependencies: bundle

Using the profile locally

This profile expects the role to be in GitHub repository, configured according to good practice. If you use the Ansible Galaxy skeleton provided by the style guide you should be fine 👏 If you are developing a new Ansible role locally and want to use this profile, you're going to have control failures for aspects of the repo configuration (master branch protection, labels, etc). You can disable these controls temporarily - see the Inspec docs.

Contributing

We're not taking contributions right now.