Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documention for using ARA with AWX/Tower #24

Open
dmsimard opened this issue Apr 24, 2019 · 14 comments
Open

Add documention for using ARA with AWX/Tower #24

dmsimard opened this issue Apr 24, 2019 · 14 comments
Labels

Comments

@dmsimard
Copy link
Contributor

@dmsimard dmsimard commented Apr 24, 2019

ARA and AWX/Tower aren't mutually exclusive. They can be used individually or together depending on the user's needs and use cases.

In theory, we would be able to install ara in the default virtualenv but that doesn't work and is documented in ansible/awx#1737

What had worked for me in the past would be to create a new virtualenv, install ara and ansible in it and then make awx/tower use that virtualenv for job templates after setting the callback plugin in the settings interface.

Screencaps from an Ansible meetup presentation:
Screenshot from 2019-04-24 10-13-23

...

Screenshot from 2019-04-24 10-13-32

@dmsimard dmsimard added the docs label Apr 24, 2019
@dmsimard dmsimard changed the title Document usage of ARA with AWX/Tower Add documention for using ARA with AWX/Tower Apr 24, 2019
@6sossomons

This comment has been minimized.

Copy link

@6sossomons 6sossomons commented Apr 25, 2019

I've used those same steps as described above and still don't see data being recorded into ara from runs inside tower.

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Apr 25, 2019

@6sossomons yes, at the time I created the issue I also noted that the procedure didn't work and needed to be troubleshooted.

I got it to work just now:
Screenshot from 2019-04-25 11-32-52

And in ARA:
Screenshot from 2019-04-25 11-33-15

The issue was that job isolation (in settings -> jobs) was enabled and /var/lib/awx/.ara was not in the list of "paths exposed to isolated jobs".

Considering that AWX/Tower requires postgresql, it might be wise to consider documenting setting it up in postgresql instead of sqlite anyway.

@MrMEEE

This comment has been minimized.

Copy link

@MrMEEE MrMEEE commented Apr 26, 2019

Also trying to get it to work here..

I have configured the following:
araawx

But nothing is pushed into the database.. it works fine if I run it from the cli...

Anyone got a hint??... anyway to troubleshoot/debug this

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Apr 30, 2019

@MrMEEE you can see this in my first comments but when I got it to work, it was by creating the venv in /var/lib/awx/venv/ara.
This is somehow picked up by awx automatically and the venv becomes available in a dropdown menu to select in your job templates.

@MrMEEE

This comment has been minimized.

Copy link

@MrMEEE MrMEEE commented May 1, 2019

hi @dmsimard

I tried that as well.. still does nothing :(

@6sossomons

This comment has been minimized.

Copy link

@6sossomons 6sossomons commented May 31, 2019

Any update on this case?

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Jun 4, 2019

@6sossomons @MrMEEE I haven't had the opportunity to look into this yet, been focused on releasing ara 1.0.

In other news, Tower 3.5 has been released for RHEL8 with full python3 support which will make it easier to integrate ara 1.0.

In the meantime, ara 1.0 is already integration tested with postgresql so we could have ara leverage the AWX/Tower postgresql instance for data storage.

The release of CentOS 8 is also making progress: https://wiki.centos.org/About/Building_8

I won't have time to look at this for a while still but I'd appreciate any help.

@HOSTED-POWER

This comment has been minimized.

Copy link

@HOSTED-POWER HOSTED-POWER commented Aug 6, 2019

It would be great if there is some documentation. We use awx in docker but weren't able to get ARA working either unfortunately :(

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Aug 12, 2019

@HOSTED-POWER would you like to share the steps you tried and what didn't work ?

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Sep 12, 2019

I haven't had time to spend on this yet but I came across a workaround that someone posted on StackOverflow and thought it would be worth adding to this issue: https://stackoverflow.com/a/56728592/6072068

@6sossomons

This comment has been minimized.

Copy link

@6sossomons 6sossomons commented Oct 4, 2019

I tried the work-around with no avail. All of my venv are running ara in them, so now I just need to get ara to play nicely inside the scope of tower.

@dmsimard dmsimard added the help wanted label Oct 9, 2019
@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Jan 15, 2020

No progress on this yet but cross-referencing a reply I did to a post on /r/ansible about integration with AWX/Tower: https://www.reddit.com/r/ansible/comments/eo6k4x/ansible_ara_integration_help/

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Jan 16, 2020

I spent some time on this last night and got it working on the latest version of AWX on CentOS 8.

In a nutshell:

# Install ARA in the awx_task container
docker exec -it awx_task /var/lib/awx/venv/ansible/bin/pip install ara
Requirement already satisfied: ara in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (1.3.2)
Requirement already satisfied: requests>=2.14.2 in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (from ara) (2.22.0)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (from ara) (5.4.4)
Requirement already satisfied: idna<2.9,>=2.5 in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (from requests>=2.14.2->ara) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (from requests>=2.14.2->ara) (2019.11.28)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (from requests>=2.14.2->ara) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /var/lib/awx/venv/ansible/lib/python3.6/site-packages (from requests>=2.14.2->ara) (1.25.7)

# Get path to callback plugins so we can configure it later
docker exec -it awx_task /var/lib/awx/venv/ansible/bin/python3 -m ara.setup.callback_plugins
/var/lib/awx/venv/ansible/lib/python3.6/site-packages/ara/plugins/callback

# Install and launch ARA API server on the host in the background (not in a container)
python3 -m pip install ara[server] --user
ara-manage runserver 0.0.0.0:8000 &

Some screen captures:

Setting up the callback plugins path and environment variables for configuring the ARA callback

Screenshot from 2020-01-16 10-18-27

Note: For the ARA_API_SERVER variable, using 127.0.0.1 didn't work and I had to specify the local IP address (10.0.0.9 in my case). This meant I had to add 10.0.0.9 to the list of ALLOWED_HOSTS in ~/.ara/server/settings.yaml.

Running the included demo template

Screenshot from 2020-01-16 10-17-39

Playbook task result

Screenshot from 2020-01-16 10-17-21

Playbook task file

Screenshot from 2020-01-16 10-56-46

Playbook extra_vars file

Screenshot from 2020-01-16 10-57-07

Host facts

Screenshot from 2020-01-16 10-57-32

@dmsimard

This comment has been minimized.

Copy link
Contributor Author

@dmsimard dmsimard commented Jan 16, 2020

Following up on my previous comment, I've created a proof of concept gist that takes care of installing both AWX and ARA with instructions on how to setup AWX to send data to ARA: https://gist.github.com/dmsimard/368fa69e3927001f65a1b0d56fee7f02

It is minimal but a good starting point that demonstrates the integration working.

In terms of next steps, I think we need the following to do this cleanly:

  • Add support for CentOS 8 for the ara_api and ara_frontend Ansible roles. I've created this issue for tracking this: #107
  • There is also an issue for adding support to ara_api so it can install ARA with pip install --user instead of inside a virtualenv: #82. I don't think this is a blocker, though, as the API server can run from a virtualenv just as well.

Afterwards, it would probably make sense to write a small playbook that would create a postgresql database on the AWX postgresql instance so ARA can use that instead of the sqlite default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.