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.
We implement controls for:
according to the Ansible style guide in use.
TL;DR: set a few variables, run the profile:
- You will need to interact with the GitHub API - get a token and set it in the environment :
export GITHUB_TOKEN=super_secret_token
- Set the name of the repo you want to assert compliance of :
export GITHUB_REPO=cmd
(this should be a repo under the @EGI-Federation org) inspec supermarket exec brucellino/ansible-style-guide
- If you want it hot off the press, use the git fetcher :
inspec exec -b local http://github.com/EGI-Federation/ansible-fashion-police
This profile should be included in your continuous integration pipeline.
You will need Inspec to use this profile. This implies a ruby ( ~> 2.4) runtime environment and the necessary gems.
- Install ruby gems
- Install bundler :
gem install bundler
- Install dependencies:
bundle
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.
We're not taking contributions right now.