1.0.7 • Published 6 years ago

ansible-lint v1.0.7

Weekly downloads
12
License
-
Repository
github
Last release
6 years ago

ansible-lint

This is the rule-set I use for my ansible roles. By linting the roles and playbooks you get an standarized setup and use best practices.

Setup

You need to have ansible-lint installed:

$ pip install ansible-lint

Check the rules out to a directory of your choice:

$ hub clone lxhunter/ansible-lint /usr/local/src/ansible-lint
# or
$ git clone https://github.com/lxhunter/ansible-lint.git /usr/local/src/ansible-lint

Pro-Tip: I use fresh for this:

$ fresh lxhunter/ansible-lint . --file=/usr/local/src/ansible-lint

Usage

Now you can lint your playbooks by doing:

# just my rules
$ ansible-lint -r /usr/local/src/ansible-lint/rules playbook.yml
# or for the standard rule and mine
$ ansible-lint -R -r /usr/local/src/ansible-lint/rules playbook.yml

Rules

CodeMessage
LX1Playbook
---
LX2Role
---
LX3Task
---
LX4General Module
LX401Specific Modules should have owner, group and mode
---
LX5Specific Module
LX501Template Module - Template files should have the extension '.j2'

Testing

Setup:

You need to have nodemon installed:

$ npm install

Usage:

I used node for testing:

nodemon LX401

Credits

Contribute

Tutorial

Author

Author:: Alexander Jäger

Copyright 2018

1.0.7

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago