The links provided by the UI when filtering or sorting by date/duration
didn't carry existing search arguments so if you sorted or filtered, you
lost existing search queries.
The sorting and filtering is now handled by the same django form which
takes care of keeping our arguments around.
Fixes: https://github.com/ansible-community/ara/issues/201
Change-Id: I03af5baaadd7fd731133db3ad83dee74ed4813ba
It's useful to filter status to failed/unreachable for failed playbooks
but filtering for changed results by default often leads to no results
being shown at all in the case of playbooks without changes.
I find myself clicking "clear filter" more times than the default filter
being useful so let's not do that anymore.
Change-Id: I7635a2282e1e12bbab4224960d36055a80be8f50
We were not including the pygments css file in the result details page
so despite the right css classes being set by the format_data filter, we
didn't have any highlighting.
Change-Id: Iae20c9ec82164bb24b69e4c056aec281b7ac40dc
Results for a task which involves a loop are typically stored in a
'results' list. This renders these results like normal ones inside the
'results' key instead of being raw json.
Change-Id: I3ec57d5f4fbe94809e7feef75b9f7f9e423a8a8b
The controller fqdn that ran the playbook is now recorded and can be
searched for both in the UI and the CLI.
Fixes: https://github.com/ansible-community/ara/issues/193
Change-Id: I53e8d158fc3b6ba7a16582234aaa2542eab5fcdc
Threading is prone to database lock exceptions when using the default
database backend (sqlite) and so disable it by default.
Users can enable threading when using mysql or postgresql by specifying
the ARA_CALLBACK_THREADS environment variable or callback_threads in
ansible.cfg.
Fixes: https://github.com/ansible-community/ara/issues/195
Change-Id: I80edfd6268684722c2783e01323355d791c19b9d
rather than a tz-naive stamp. ara drf should do the right thing with
timezones based on the now included iso tz.
Change-Id: I64e486e9c7d9ebe8ec48f9565ac42b3eecd9a788
When using >=2 threads with the offline client, the playbook execution
can sometimes, but not always, lock up.
The issue doesn't appear to reproduce when using a single thread so do
that for now.
Otherwise, default to 4 threads as a more conservative default to
prevent hitting urllib's connectionpool max.
Change-Id: I2b0c57f784be36685619d80549fa626c385b0e04
There are some parts of the callback that need to be synchronous because
they rely on an object that must be created before, for example.
However, for the parts that don't need to run synchronously, thread them
so we don't block Ansible from running.
This results in a dramatic performance increase.
Related: https://github.com/ansible-community/ara/issues/171
Change-Id: I4317d1d1175a5286704b04f57de9ef73fa911a3a
We had this data but we didn't include it for some reason.
It's at least as much relevant as the other numbers displayed so include
it.
Change-Id: I9b95a2cbe2bbee5bba1392e2d7d4afd6eebc6d03
Improve readability by alphabetically sorting the hosts by name instead
of a pseudo-random order defined by the order in which they were
created.
Change-Id: Ie745215d8acf9eb8a16c8d22cd91c35276d92ddd
It turns out that we had been missing out on handler tasks because we
need to use the hook "v2_playbook_on_handler_task_start" for those.
Fixes: https://github.com/ansible-community/ara/issues/178
Change-Id: Id05ba581fb22eee26270c7f4bccc3445e87b5d3b
It could otherwise lead to errors like:
Timeout value connect was 15, but it must be an int, float or None
Change-Id: I7b426c88a09f27ca2d645fd05227c2cf106d8d1e
Tasks have a boolean "handler" field which indicates whether a task
originated from a handler or not.
This adds support for searching for them, ex:
/api/v1/tasks?handler=true
Change-Id: I49fe9483c304e4133f710776c5663a34a206e3c8
Re-order the columns to be consistent with the other list commands and
bring both --resolve and --long to it as well.
Change-Id: I31ffbbfb193c566f96704479d8d8e5a342efdd8a
This is the same logic currently used in the UI.
When printing paths or resolving paths, truncate them to 50 characters
at most unless --long is used.
Paths can easily take up over a hundred characters of width which made
the pretty table wrap too often.
Change-Id: I065db878c8bea73e19651d0981127242a2fa3b63
1.5 moved the URLs to be pluralized and the playbook details no longer
return all of the results so they need to be queried individually.
Change-Id: I54878a6933abf9a3c032e9a869b34432fff61662
Ansible >= 2.8 added the "v2_runner_on_start" callback hook which gives
us an accurate result start date instead of the task start date.
When running Ansible 2.7 and below, ara will fall back to the task start
date which was the original behavior.
In addition, recover the ended date for the result slightly sooner for
better accuracy.
Fixes: https://github.com/ansible-community/ara/issues/173
Change-Id: I43295fda19eb900a28df023bf6c4680e62a7f91e
This will apply a default filter to playbook links based on its status.
When failed, it will search for results with the status "failed" or
"unreachable" -- otherwise, it will search for results that have
resulted in a change.
The objective is to highlight changed, failed and unreachable results in
an ocean of skipped and ok results.
Change-Id: I662682296be68e387a26da16be8313daa15584bf
This new configuration option will label playbooks automatically
based on CLI arguments picked up by the callback.
For example, when "--check" is used, it would label the playbook with
the label "check:True" or "check:True" when it isn't used.
Related: https://github.com/ansible-community/ara/issues/148
Related: https://github.com/ansible-community/ara/issues/119
Change-Id: Ifd475875bf83a21ab35c9cf0ac0410520b98d804
This new command will allow to change the status of objects that have
been running for more than 24 hours (by default) without being updated
and so we are expecting these to never finish.
Change-Id: Iedbac84188fc4202f51e405d2fae0a35d34b3a1d
Related: https://github.com/ansible-community/ara/issues/26
This status can eventually be set from different contexts and for
different reasons but for now the main use case is to timeout
objects that have been in the running status for too long and will
never complete.
Change-Id: I13682a69ff2aa3d3609528583209007aa93ded0d
Related: https://github.com/ansible-community/ara/issues/26
Because we always set the started date of results as the beginning of
the task, each host result for the task apparently took a little bit
longer than the previous to complete because they were running one after
the other.
By storing a timestamp at the end of a result, we can use it as the
start date of the new result. While imperfect, it will be far more
accurate than relying on the task started date to calculate the
duration of each result.
Fixes: https://github.com/ansible-community/ara/issues/173
Change-Id: Iade5dc3ba35272ac7993a114d06bbefcd096d677
- Move the link to host facts has to it's own column
- Link on the hostname queries results for the host's id
- Host result status numbers queries results for the host's id and status
Change-Id: I706d9b2d3b922db094271352f54cd1c9f9c8fbaf
The hosts table is automatically hidden when there is a search query.
Clicking 'clear filters' or submitting the form would lead back to the
top of the page so going back to the results would require scrolling.
Link to the task results anchor instead.
Change-Id: I3887fc9a8f23913332aad3a117b4ec226c61a935
"changed" isn't a status, it's an attribute and so displaying it in the
same column as the statuses was confusing.
Change-Id: Ifb895cfc75e7b457f1cc6b31bbeec233efa40ea6
This is a first iteration that adds a form in the task results pane
which allows to search by:
- host id
- task id
- status
- changed
Ordering by date and duration is done by clicking on the respective
headers.
Change-Id: Iaa67fee1e182807e69d7df7c39bf2ee1d0b67bd4
The principal consumers of the API relied on a combination of the
status as well as the fields "changed" and "ignore_errors" to infer a
"changed" or "ignored" status.
This lead users to believe they could search for these statuses and it
wouldn't work. The consumers should expose the status differently but
that will be in another patch.
Change-Id: Ib34a65179d07186ab2d2efc65ce14c46e2596df0
This will allow larger playbooks to load much faster without needing to
return and render all of a playbook's results on a single page.
Fixes: https://github.com/ansible-community/ara/issues/168
Change-Id: I5fcf8bc411bc6da946fdd5ce23325b2b11a7197a
When querying the API for a playbook's detail, it would return all of
it's children (hosts, files, tasks, results) which could be very slow
when dealing with larger playbooks.
We no longer do that for playbooks as well as plays and tasks.
Instead, we can easily find a playbook's resources by searching for them
with the playbook id like so:
- /api/v1/plays?playbook=<id>
- /api/v1/tasks?playbook=<id>
- /api/v1/results?playbook=<id>
... and so on.
This commit adapts the built-in UI because it would've otherwise been
broken by the change.
Fixes: https://github.com/ansible-community/ara/issues/158
Change-Id: I442bff657e5da9d6a3916ebdbc5e66c0e670b00f