跳转到主要内容

ARA记录Ansible

项目描述

ARA记录Ansible

ARA记录Ansible,使其更容易理解和调试。

logo

它是一个以简单性为重点的另一个递归缩写。

关于ara

ara通过记录ansibleansible-playbook命令提供Ansible报告,无论它们如何和在哪里运行

  • 来自大多数Linux发行版,甚至在Mac OS上(只要python >= 3.8可用)
  • 来自运行Ansible的工具,如ansible-(pull|test|runner|navigator)、AWX & Automation Controller (Tower)、Molecule和Semaphore
  • 从终端、脚本或手动
  • 从笔记本电脑、台式机、服务器、虚拟机、容器或执行环境
  • 来自CI/CD平台,如Jenkins、Rundeck和Zuul
  • 来自GitHub、GitLab、Gitea & Forgejo等git forge

记录的结果可通过包含的CLI、REST API以及自托管、本地优先的Web报告界面访问。

https://github.com/ansible-community/ara/assets/1291204/4fbdf5f7-509c-46ea-beb0-726b43e1b985

如何工作

ARA将Ansible结果记录到SQLite、MySQL和PostgreSQL数据库中,使用标准的回调插件

此插件在Ansible运行时收集数据并将其发送到Django REST API服务器

recording-workflow

要求

  • 任何最近版本的Linux发行版或macOS,且python版本需大于等于3.8
  • 必须安装包含Ansible插件的ara包,且与Ansible本身使用相同的Python解释器

入门指南

对于生产使用,请考虑了解最佳实践启用认证以及忽略不需要记录的内容

在没有API服务器的情况下记录playbook

ara默认将数据记录到本地sqlite数据库,并且不需要持久化服务器

# Install ansible (or ansible-core) with ara (including API server dependencies)
python3 -m pip install --user ansible "ara[server]"

# Configure Ansible to enable ara
export ANSIBLE_CALLBACK_PLUGINS="$(python3 -m ara.setup.callback_plugins)"

# Run an Ansible playbook as usual
ansible-playbook playbook.yml

# Check out the CLI
ara playbook list
ara host list

# or the UI at http://127.0.0.1:8000
ara-manage runserver

getting-started

在有API服务器的情况下记录playbook

服务器包括REST API和Web报告界面。

考虑运行一个来聚合来自不同工具、作业或服务器的playbook运行,并在单个仪表板中共享。

使用ara_api角色或使用项目在DockerHubquay.io上发布的容器镜像开始使用。

# Create a directory for a volume to store settings and a sqlite database
mkdir -p ~/.ara/server

# Start an API server with docker from the image on DockerHub:
docker run --name api-server --detach --tty \
  --volume ~/.ara/server:/opt/ara -p 8000:8000 \
  docker.io/recordsansible/ara-api:latest

# or with podman from the image on quay.io:
podman run --name api-server --detach --tty \
  --volume ~/.ara/server:/opt/ara -p 8000:8000 \
  quay.io/recordsansible/ara-api:latest

一旦服务器启动,ara必须安装并配置为向其发送数据

# Install ansible (or ansible-core) with ara (excluding API server dependencies)
python3 -m pip install --user ansible ara

# Configure Ansible to enable ara
export ANSIBLE_CALLBACK_PLUGINS="$(python3 -m ara.setup.callback_plugins)"

# Set up the ara callback to know where the API server is located
export ARA_API_CLIENT="http"
export ARA_API_SERVER="http://127.0.0.1:8000"

# Run an Ansible playbook as usual
ansible-playbook playbook.yml

# Check out the CLI
ara playbook list
ara host list

# Or browse http://127.0.0.1:8000 (running from the container)

现场演示

一个现场演示已经部署了来自Ansible Galaxy的ara Ansible集合。

它可在https://demo.recordsansible.org访问。

文档和更新日志

关于安装、配置、运行和使用ara的文档可在ara.readthedocs.io找到。

通过阅读故障排除指南,可以解决常见问题。

更新日志和发布说明可在存储库的git标签以及文档中找到。

社区和获取帮助

贡献

欢迎并感谢对项目的贡献!

贡献者文档开始。

作者

项目中的代码贡献可以在git日志或GitHub上查看。

ara鹦鹉标志由Jason E. Rist设计并贡献。

版权

Copyright (c) 2023 The ARA Records Ansible authors

ARA Records Ansible 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.

ARA Records Ansible 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 ARA Records Ansible.  If not, see <https://gnu.ac.cn/licenses/>.

项目详情


发布历史 发布通知 | RSS源

下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

ara-1.7.2.tar.gz (12.9 MB 查看哈希值)

上传时间

构建分发

ara-1.7.2-py2.py3-none-any.whl (233.7 kB 查看哈希值)

上传时间 Python 2 Python 3

支持者: