Skip to content

Commit

Permalink
doc: Update README.md and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
haidaraM committed Jun 26, 2020
1 parent d1b1d2d commit 20cd85b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions Readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Inspired by [Ansible Inventory Grapher](https://github.com/willthames/ansible-in
If you still use an older version of Ansible, create an virtual environment and install ansible-playbook-grapher. **`pip install` will install a version of Ansible >= 2.8**

* **graphviz**: The tool used to generate the graph in SVG.
```
```shell script
$ sudo apt-get install graphviz # or yum install or brew install
```

## Installation
```
```shell script
$ pip install ansible-playbook-grapher
```

Expand All @@ -29,20 +29,18 @@ $ pip install ansible-playbook-grapher
$ ansible-playbook-grapher tests/fixtures/example.yml
```

![Example](https://raw.githubusercontent.com/haidaraM/ansible-playbook-grapher/master/tests/fixtures/img/example.png)
![Example](https://raw.githubusercontent.com/haidaraM/ansible-playbook-grapher/master/img/example.png)


```shell script
$ ansible-playbook-grapher --include-role-tasks tests/fixtures/with_roles.yml
```
$ ansible-playbook-grapher --include-role-tasks examples/example_with_roles.yml
```


![Example](https://raw.githubusercontent.com/haidaraM/ansible-playbook-grapher/master/tests/fixtures/img/example_with_roles.png)

![Example](https://raw.githubusercontent.com/haidaraM/ansible-playbook-grapher/master/img/with_roles.png)

Some options are available:

```
```shell script
$ ansible-playbook-grapher --help
Usage: ansible-playbook-grapher [options] playbook.yml

Expand Down Expand Up @@ -83,15 +81,17 @@ Options:
Contributions are welcome. Feel free to contribute by creating an issue or submitting a PR :smiley:
### Dev environment
To setup a new development environment:
To setup a new development environment :
- Install graphviz `sudo apt-get install graphviz # or yum install or brew install graphviz`
- pip install -r requirements.txt
- (cd tests && pip install -r requirements_tests.txt)
Run the tests with:
```bash
$ make test
```shell script
$ make test # run all tests
```
The graphs are generated in the folder `tests/generated_svg`.
## TODO
- Graphviz : properly rank the edge of the graph to represent the order of the execution of the tasks and roles
- Graphviz : find a way to avoid or reduce edges overlapping
Expand Down
File renamed without changes
Binary file added img/with_roles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def read_requirements(path):
install_requires = read_requirements('requirements.txt')
test_require = read_requirements('tests/requirements_tests.txt')[1:]

with open('Readme.md') as f:
with open('README.md') as f:
long_description = f.read()

# add `pytest-runner` distutils plugin for test;
Expand Down
Binary file removed tests/fixtures/img/example_with_roles.png
Binary file not shown.

0 comments on commit 20cd85b

Please sign in to comment.