Skip to content

Commit 3900edd

Browse files
committed
feat: add ARA
1 parent 9ffcdff commit 3900edd

File tree

5 files changed

+80
-1
lines changed

5 files changed

+80
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ LABEL maintainer="Kien Nguyen-Tuan <[email protected]>"
33
# Enable Mitogen to boostup performance
44
ENV ANSIBLE_STRATEGY_PLUGINS=/usr/lib/python3.10/site-packages/ansible_mitogen/plugins/strategy
55
ENV ANSIBLE_STRATEGY=mitogen_linear
6+
ENV ANSIBLE_CALLBACK_PLUGINS=/usr/lib/python3.10/site-packages/ara/plugins/callback
7+
ENV ANSIBLE_ACTION_PLUGINS=/usr/lib/python3.10/site-packages/ara/plugins/action
8+
ENV ANSIBLE_LOOKUP_PLUGINS=/usr/lib/python3.10/site-packages/ara/plugins/lookup
69
COPY etc/ansible.example.cfg /etc/ansible/ansible.cfg
710
COPY . /opt/ansitheus
811
WORKDIR /opt/ansitheus
912
RUN ansible-galaxy install -r requirements.yml
10-
# Mitogen needs sudo command to execute
13+
# Mitogen needs sudo command to execute
1114
RUN apk add --no-cache sudo
1215
ENTRYPOINT ["/opt/ansitheus/tools/ansitheus"]

docs/images/ara_playbooks.png

42.4 KB
Loading
104 KB
Loading

docs/report_with_ara.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Visualizing Ansitheus reports with ARA Records Ansible (ARA)
2+
3+
## 1. About ara
4+
5+
[ara](https://ara.recordsansible.org/) provides Ansible reporting by recording ``ansible`` and ``ansible-playbook`` commands regardless of how and where they run:
6+
7+
- from most Linux distributions and even on Mac OS (as long as ``python >= 3.8`` is available)
8+
- from tools that run Ansible like ansible-(pull|test|runner|navigator), AWX & Automation Controller (Tower), Molecule and Semaphore
9+
- from a terminal, a script or by hand
10+
- from a laptop, desktop, server, virtual machine, container or execution environment
11+
- from CI/CD platforms such as Jenkins, Rundeck and Zuul
12+
- from git forges like GitHub, GitLab, Gitea & Forgejo
13+
14+
The recorded results are available via an included CLI, a REST API as well as a self-hosted, local-first web reporting interface.
15+
16+
<!-- https://github.com/ansible-community/ara/blob/master/doc/source/_static/demo.mp4 -->
17+
https://github.com/ansible-community/ara/assets/1291204/4fbdf5f7-509c-46ea-beb0-726b43e1b985
18+
19+
## 2. Getting started
20+
21+
Started from version v2.2.0, Ansitheus already bundles ara on its Docker image. Checkout the [quickstart](./quickstart.md) for detail.
22+
23+
Firstly configure your ARA API server. Make sure it works properly. You can quickly deploy it using `docker-compose`:
24+
25+
```yaml
26+
version: "3.8"
27+
28+
services:
29+
postgres:
30+
image: postgres:latest
31+
container_name: postgres
32+
environment:
33+
POSTGRES_USER: ara
34+
POSTGRES_PASSWORD: ara_password
35+
POSTGRES_DB: ara
36+
volumes:
37+
- postgres_data:/var/lib/postgresql/data
38+
restart: unless-stopped
39+
40+
ara:
41+
image: recordsansible/ara-api:latest
42+
container_name: ara
43+
environment:
44+
- ARA_ALLOWED_HOSTS=["*"]
45+
- ARA_DATABASE_DRIVER=postgresql
46+
- ARA_DATABASE_USER=ara
47+
- ARA_DATABASE_PASSWORD=ara_password
48+
- ARA_DATABASE_HOST=postgres
49+
- ARA_DATABASE_NAME=ara
50+
ports:
51+
- "8000:8000"
52+
depends_on:
53+
- postgres
54+
restart: unless-stopped
55+
56+
volumes:
57+
postgres_data:
58+
```
59+
60+
Now you can use visualize Ansitheus report using ARA (**don't forget to update `ARA_API.*` variables**).
61+
62+
```shell
63+
docker run --name ansitheus --rm --network host \
64+
-e ARA_API_SERVER=http://localhost:8000 \
65+
-e ARA_API_CLIENT=http \
66+
-v /tmp/test/sub:/etc/ansitheus \
67+
-v /tmp/facts_cache:/tmp/facts_cache \
68+
kiennt26/ansitheus:v2.2.0 deploy --inventory /etc/ansitheus/inventory.ini
69+
```
70+
71+
Result:
72+
73+
![playbook](./images/ara_playbooks.png)
74+
75+
![playbook_detail](./images/ara_playbooks_detail.png)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ansible>=2.9.0
2+
ara>=1.7.2

0 commit comments

Comments
 (0)