从Ansible事实收集输出生成主机概述
ansible-cmdb的Python项目详细描述
啊![状态:稳定](https://img.shields.io/badge/status-stable-green.svg) 啊![生成状态](http://build.electricmonk.nl/job/ansible-cmdb/shield) 啊![活动:积极发展](https://img.shields.io/badge/activity-active%20development-green.svg) 啊![许可证:gplv3](https://img.shields.io/badge/license-GPLv3-blue.svg)
关于
Ansible CMDB获取Ansible事实收集的输出并将其转换为 包含系统配置的静态html概述页(以及其他内容) 信息。
它支持多种类型的输出(html、csv、sql等)和扩展 Ansible使用自定义数据收集的信息。对于每一个主机它也显示 组、宿主变量、自定义变量和机器本地事实。
啊![](https://raw.githubusercontent.com/fboender/ansible-cmdb/master/contrib/screenshot-overview.png)
啊![](https://raw.githubusercontent.com/fboender/ansible-cmdb/master/contrib/screenshot-detail.png)
[html示例](https://rawgit.com/fboender/ansible-cmdb/master/example/html_fancy.html)输出。
功能
(并非所有模板都支持所有功能)
- 多种格式/模板:
- 花哨的html(
--template html_fancy
),如上图所示。 - 奇特的html拆分(
--template html_fancy_split
),包含每个主机的详细信息 在单独的文件中(对于大量主机)。 - CSV(^ {CD3}}),值得信赖且灵活的逗号分隔格式。
- json(
--template json
),以json格式转储所有事实。 - 标记(
--template markdown
),用于复制粘贴到wiki和 如此。 - 标记拆分(
--template markdown_split
),包含每个主机的详细信息 在一个单独的文件中(对于大量主机)。 - sql(
--template sql
),用于将主机事实导入(my)sql数据库。 - 纯文本表(
--template txt_table
),用于控制台专家。 - 当然,任何你愿意定制的模板。
- 花哨的html(
- 主机概述和详细的主机信息。
- 主机和组变量。
- 收集宿主事实和手动自定义事实。
- 添加和扩展现有主机的事实并手动添加全部 新东道主。
- 自定义列
开始
完整文档的链接可以在下面找到,但这里有一个粗略的 说明Ansible CMDB如何工作,为您提供一个想法:
- 从[source,a release]安装Ansible CMDB
包](https://github.com/fboender/ansible-cmdb/releases)或通过pip:
pip install ansible-cmdb
。
通过ansible获取主人的信息:
$ mkdir out $ ansible -m setup –tree out/ all
使用Ansible CMDB生成CMDB HTML:
$ ansible-cmdb out/ > overview.html
- 在浏览器中打开
overview.html
。
就这样!请务必阅读有关使用的完整文档,因为有一些 如何使用生成的html的注意事项。
文档
所有文档都可以在[readthedocs.io](http://ansible-cmdb.readthedocs.io/en/latest/)中查看。
许可证
Ansible CMDB根据GPLv3获得许可:
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
For the full license, see the LICENSE file.