一个命令行工具,用于创建一个表示可负责的剧本任务和角色的图形

ansible-playbook-grapher的Python项目详细描述


Ansible Playbook图示器

Build StatusPyPI versionCoverage Status

ansible-playbook-grapher是一个命令行工具,用于创建一个表示可负责的剧本任务和角色的图形。目的 这个项目是快速有一个你的行动手册的概述。

灵感来自Ansible Inventory Grapher

先决条件

  • ansibe>;=2.7:脚本尚未使用ansibe的早期版本进行测试,某些功能可能无法工作。如果您仍然使用Ansible的旧版本,请创建一个虚拟环境并安装Ansible Playbook Grapher。pip install将安装ansibe>;=2.7的版本

  • graphviz:用于在svg中生成图形的工具。

$ sudo apt-get install graphviz # or yum install or brew install

安装

$ pip install ansible-playbook-grapher

用法

$ ansible-playbook-grapher tests/fixtures/example.png

Example

$ ansible-playbook-grapher --include-role-tasks  examples/example_with_roles.yml

Example

有些选项可用:

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

Make graph from your Playbook.

Options:
  --ask-vault-pass      ask for vault password
  -e EXTRA_VARS, --extra-vars=EXTRA_VARS
                        set additional variables as key=value or YAML/JSON, if
                        filename prepend with @
  -h, --help            show this help message and exit
  --include-role-tasks  Include the tasks of the role in the graph.
  -i INVENTORY, --inventory=INVENTORY
                        specify inventory host path (default=[%s]) or comma
                        separated host list.
  --new-vault-id=NEW_VAULT_ID
                        the new vault identity to use for rekey
  --new-vault-password-file=NEW_VAULT_PASSWORD_FILES
                        new vault password file for rekey
  -o OUTPUT_FILE_NAME, --ouput-file-name=OUTPUT_FILE_NAME
                        Output filename without the '.svg' extension. Default:
                        <playbook>.svg
  -s, --save-dot-file   Save the dot file used to generate the graph.
  --skip-tags=SKIP_TAGS
                        only run plays and tasks whose tags do not match these
                        values
  -t TAGS, --tags=TAGS  only run plays and tasks tagged with these values
  --vault-id=VAULT_IDS  the vault identity to use
  --vault-password-file=VAULT_PASSWORD_FILES
                        vault password file
  -v, --verbose         verbose mode (-vvv for more, -vvvv to enable
                        connection debugging)
  --version             show program's version number and exit

贡献

欢迎捐款。通过创建问题或提交PR:smiley:

开发环境

要设置新的开发环境:

  • 安装graphvizsudo apt-get install graphviz # or yum install or brew install graphviz
  • pip install-r requirements.txt

使用以下命令运行测试:

$ make test

待办事项

  • graphviz:正确排列图的边缘,以表示任务和角色的执行顺序
  • graphviz:找到避免或减少边重叠的方法
  • 重构图形表示法

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Google Billing Library:QueryPurchaseAsync:取消购买的订阅资源未返回   java转换列表mapsturct中的单个对象   java简单算法。我做不好   包含集合的@ManyToMany映射的java JPA2持久性   在Java中序列化和反序列化对象时发生BuffereImage错误   java使用ui:param传递值并在backingbean中访问它们   java从应用程序读取配置。yml至POJO列表地图   java中在while循环外部调用文件值   java如何与来自不同类的UI交互   java如何在jTable中显示2D数组?   在Java 8中,类为什么不从接口继承默认方法?   java类。getAnnotation和getAnnotations无法正常工作   java处理pagertabstrip上的触摸事件   java GWT和struts2异常   用Java解析HTTP查询字符串   java这段代码SQL注入安全吗?