Skip to content

Commit

Permalink
feat: Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lxhunter committed Mar 11, 2018
0 parents commit a2ad3e2
Show file tree
Hide file tree
Showing 9 changed files with 3,585 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.idea/
.kitchen/
.vagrant/
roles/
.DS_Store
README.html


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

node_modules
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 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:

```bash
$ pip install ansible-lint
```

Check the rules out to a directory of your choice:

```bash
$ 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](https://freshshell.com) for this:

```bash
$ fresh lxhunter/ansible-lint rules/ --file=/usr/local/src/ansible-lint
```

## Usage

Now you can lint your playbooks by doing:

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

## Rules

| **Code** | **Message** |
| --- |:---|
| **LX1** | **Playbook** |
| --- | |
| **LX2** | **Role** |
| --- | |
| **LX3** | **Task** |
| --- | |
| **LX4** | **General Module** |
| LX401 | Specific Modules should have owner, group and mode |
| --- | |
| **LX5** | **Specific Module** |
| LX501| Template Module - Template files should have the extension '.j2' |

## Testing

### Setup:

You need to have `nodemon` installed:

```bash
$ npm install
```

### Usage:

I used node for testing:

```bash
nodemon LX401
```

## Credits
* [Initial Idea from Will Thames](https://github.com/willthames/ansible-lint)
* [Learned a lot from shirou and his rules](https://github.com/shirou)

## Contribute

[Tutorial](http://kbroman.github.io/github_tutorial/pages/fork.html)

## Author

Author:: [Alexander Jäger](https://github.com/lxhunter)

Copyright 2018
Loading

0 comments on commit a2ad3e2

Please sign in to comment.