RETIRED, this project has moved to https://github.com/ansible-community/ara
Go to file
David Moreau Simard e32333930a
role: Add support and integration tests for postgresql
This adds support for specifying the "django.db.backends.postgresql"
django database engine, installing the required dependencies and setting
up the necessary configuration.

We're also adding a new package extras [postgresql] which will take care
of installing psycopg2 automatically.

This is self tested by integration tests which creates a postgresql
Docker container and runs the ara_api role configured to run against the
postgresql container. The tests are designed to run either locally or on Zuul.

Change-Id: I9bb7166d01c96d8b39361a55b1c9952de8fa9798
2019-05-15 08:57:58 -04:00
.zuul.d role: Add support and integration tests for postgresql 2019-05-15 08:57:58 -04:00
ara Write only supported configuration params to the settings file. 2019-05-14 14:42:53 +00:00
doc/source Write only supported configuration params to the settings file. 2019-05-14 14:42:53 +00:00
playbooks Streamline integration test role and make it easier to run 2019-03-26 12:54:46 -04:00
roles role: Add support and integration tests for postgresql 2019-05-15 08:57:58 -04:00
tests role: Add support and integration tests for postgresql 2019-05-15 08:57:58 -04:00
.black.toml Rename pyproject.toml to .black.toml to address pep517 2019-04-24 21:17:34 -04:00
.editorconfig 💥 first commit 2018-03-29 12:36:14 -04:00
.gitignore Also ignore .venv directories. 2019-05-13 21:35:09 +02:00
.gitreview OpenDev Migration Patch 2019-04-19 19:49:48 +00:00
LICENSE 💥 first commit 2018-03-29 12:36:14 -04:00
manage.py Add missing license headers 2019-05-03 03:59:16 +00:00
README.rst Make API server deps optional, move them to extras 2019-05-03 16:01:30 -04:00
requirements.txt Make API server deps optional, move them to extras 2019-05-03 16:01:30 -04:00
setup.cfg role: Add support and integration tests for postgresql 2019-05-15 08:57:58 -04:00
setup.py Bootstrap the repository with the basic machinery (#1) 2018-03-29 12:36:22 -04:00
test-requirements.txt Updated black dependency. 2019-05-13 21:32:58 +02:00
tox.ini Make API server deps optional, move them to extras 2019-05-03 16:01:30 -04:00

ARA Records Ansible

image

ARA Records Ansible playbook runs and makes the recorded data available and intuitive for users and systems.

The project provides several distinct components in order to make this happen:

  • An API server for sending and querying data relative to playbook execution results
  • An API client library for communicating with the API
  • An Ansible callback plugin to record events as they happen throughout the execution
  • An Ansible action module to associate arbitrary key/values to your playbook reports

Quickstart

Here's how you can get started from scratch with default settings:

# Create a virtual environment and activate it so we don't conflict
# with system or distribution packages
python3 -m venv ~/.ara/virtualenv
source ~/.ara/virtualenv/bin/activate

# Install Ansible, ARA and it's API server dependencies
pip install ansible git+https://github.com/openstack/ara@feature/1.0[server]

# Tell Ansible to use the ARA callback plugin
export ANSIBLE_CALLBACK_PLUGINS="$(python -m ara.setup.callback_plugins)"

# Run your playbook as your normally would
ansible-playbook playbook.yml

The data will be saved in real time throughout the execution of the Ansible playbook.

What happens behind the scenes is that the ARA Ansible callback plugin used the built-in API client to send the data to the API which then saved it to a database located by default at ~/.ara/server/ansible.sqlite.

You're now ready to start poking at the API with the built-in API clients !

If you'd like to have the ARA web reporting interface, take a look at ara-web.

Documentation

Documentation for installing, configuring, running and using ara is available on readthedocs.io.

Community and getting help

You can chat with the ARA community on Slack and IRC. The two are transparently bridged with teamchat which broadcasts messages from one platform to the other.

In addition, you can also find ARA on Twitter: @ARecordsAnsible

IRC

Slack

Development and testing

# Retrieve the source and check out the 1.0 branch
git clone https://github.com/openstack/ara
cd ara
git checkout feature/1.0

# Install tox from pip or from your distro packages
pip install tox

# Run Ansible integration tests with the latest version of Ansible
tox -e ansible-integration

# Run integration tests with a specific version of Ansible
# Note: tox will always use the latest version of Ansible to run the playbook which runs the tests.
# For example, if the latest version of Ansible is 2.7.9, it will use Ansible 2.7.9
# to install Ansible==2.6.15 in a virtual environment and 2.6.15 is what will be tested.
tox -e ansible-integration -- -e ara_tests_ansible_version=2.6.15

# Run integration tests with Ansible from source
tox -e ansible-integration -- -e "ara_tests_ansible_name=git+https://github.com/ansible/ansible"

# Run unit tests
tox -e py3

# Run linters (pep8, black, isort)
tox -e linters

# Run test server -> http://127.0.0.1:8000/api/v1/
tox -e runserver

# Build docs
tox -e docs

Contributors

See contributors on GitHub.

Copyright

Copyright (c) 2019 Red Hat, Inc.

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 <http://www.gnu.org/licenses/>.