341 Commits

Author SHA1 Message Date
David Moreau Simard
cab932f0ed
Switch default branch from feature/1.0 to master
This updates the doc and git branches to match master instead of
feature/1.0.

Change-Id: Ifc98157328b2f9f56055fa0cdcfea5db5180fb7f
2019-06-04 20:33:00 -04:00
Zuul
47b98a6aea Merge "Make the API page size configurable" into feature/1.0 2019-06-04 22:45:37 +00:00
David Moreau Simard
9df768c413 Add missing selinux policy package for running gunicorn
Running gunicorn out of a virtualenv in a home directory requires
some extra selinux policies.

Fixes: https://github.com/ansible-community/ara/issues/49
Change-Id: I027d148d846e7add391b28e805f67cbe312dcde0
2019-06-04 20:48:05 +00:00
David Moreau Simard
1f3895315f Make the API page size configurable
Instead of hard coding the page size to 100, make it configurable.

Change-Id: I399ff5a8d9f8fa6c61fcaabc6fafb0c30cc1dc55
2019-06-04 20:47:56 +00:00
Zuul
0457e8ef97 Merge "Update README" into feature/1.0 1.0.0rc1 1.0.0 2019-06-03 12:57:06 +00:00
Zuul
2c1df952a1 Merge "Add a comment in requirements.txt about location of server deps" into feature/1.0 2019-06-03 01:48:37 +00:00
David Moreau Simard
6c734132e5
Update README
- Make the intro shorter and more to the point
- Link to ara-web
- Add local dev server to the quickstart
- Include links to live demos and Ansible roles
- Test docs have been moved to contributing docs

Change-Id: Ie82c66965ed220824448048cbbd434c585afe0b9
2019-06-02 21:36:35 -04:00
David Moreau Simard
416c16b95e
Add a comment in requirements.txt about location of server deps
Change-Id: I8d011668f3cb470b70e69dcf0e21056b5b031dc7
2019-06-02 21:19:29 -04:00
David Moreau Simard
fb07d063ef
General clean up the API server documentation
- Alphabetically sort everything
- Remove double ARA_ENV in the summary table
- Change summary table order to have default before usage

Change-Id: Ia03119d899d9dc6e4abed35d4e9a9655d6b3f348
2019-06-02 19:48:00 -04:00
David Moreau Simard
7bb2cd5bfc
Add missing 'changed' and 'ignore_error' to results
The callback was sending them but for some reason we did not have
those fields in the model yet.

Change-Id: I78c5ed6315d2c300f382b7a2b282722aec73d9a6
2019-05-30 16:40:11 -04:00
David Moreau Simard
c864d0dafa
Port FAQ docs from 0.x and update for 1.0
- Moved workflow diagram to FAQs
- Added live demos
- Removed web screenshots
- Combined "Why is ARA being developed" with
  "Why don't you use Ansible Tower (AWX), Rundeck or Semaphore"

Change-Id: Id7da538b8bce52f85ef4c4422a48d3b8b7588150
2019-05-29 11:26:39 -04:00
David Moreau Simard
582d03e179
Port contribution docs from 0.x and update for 1.0
This is mostly ported as-is from 0.x but contains updates relevant
to GitHub and removes bits about Storyboard.

Change-Id: Ib38a413a2927e3b4cfcb9dbfb24d528c99be7657
2019-05-29 10:02:06 -04:00
David Moreau Simard
f946cd19a1
Provide SQL migrations for the removal of host aliases
We can start providing SQL migrations now that the API and database
have largely settled.

Change-Id: I764c5ea473cbcc291bab2c7cd061cd78b34c7211
1.0.0b2
2019-05-23 13:35:56 -04:00
Zuul
0aeee1fa5e Merge "Add docs for ara_record" into feature/1.0 2019-05-23 17:09:46 +00:00
Zuul
f2777640ce Merge "Add docs for playbook names and labels" into feature/1.0 2019-05-23 17:09:46 +00:00
David Moreau Simard
643ac861c7
Add docs for ara_record
These docs are mostly ported as-is from 0.x since the feature hasn't
really changed from a user standpoint.

Change-Id: I4704ef74780c161dc8900b83c93f6ca385fc460a
2019-05-23 12:02:07 -04:00
David Moreau Simard
f02f3a23f7
Add docs for playbook names and labels
Change-Id: I7124f6030e736a5f096b48ff7245ddc8722a22b2
2019-05-23 11:49:57 -04:00
David Moreau Simard
0eea9bf0b6
Remove the concept of host aliases
Between playbook labels and the name of the hosts being searchable,
the host alias feature is redundant.

Change-Id: I0c09e8cf29ca8c82f9fdb496823eebb46f2739f4
2019-05-23 10:27:45 -04:00
Zuul
89daa48a6b Merge "Stop creating STATIC_ROOT needlessly, filter whitenoise warning instead" into feature/1.0 2019-05-22 21:56:28 +00:00
Zuul
810e49e57a Merge "Enable timezone settings and stop logging from settings.py" into feature/1.0 2019-05-22 21:56:26 +00:00
David Moreau Simard
a2454fd059
Enable timezone settings and stop logging from settings.py
Enabling timezone settings caused drifts in log timestamps as settings
were re-loaded.
Since we can't reliably log from settings.py, replace those instances by
the messages prefixed by [ara].

Also move the settings file configuration to __main__ so it doesn't end
up being printed several times.

Fixes: https://github.com/ansible-community/ara/issues/45
Change-Id: I88c40d1af21fec8e917ccb22fe9eee4d9ae8ee2d
2019-05-22 13:42:15 -04:00
David Moreau Simard
2a0346acaf
Stop creating STATIC_ROOT needlessly, filter whitenoise warning instead
The maintainer has suggested that we filter the warnings instead of
creating the directory needlessly.

Change-Id: I901f9f7e14e1308461c6b4f887b5d70b1441fb72
2019-05-22 13:40:33 -04:00
David Moreau Simard
b3fe1dd78b
Don't use private task attributes to retrieve task tags
Tags are available as task.tags, there is no need to use _attributes
which now defaults unset values to a new Sentinel class instead of None
or [].

Fixes: https://github.com/ansible-community/ara/issues/46
Change-Id: Ie8b2ef112a54497253ea1c3a1b5956c6284434c3
2019-05-22 11:11:15 -04:00
David Moreau Simard
a3ea6642a8
Make manage.py executable
Change-Id: I086cbcc543a6d1a865b69fde04cf4ef1fd0b5858
2019-05-21 16:56:59 -04:00
Zuul
abff982070 Merge "roles: use virtualenv_command instead of virtualenv_python" into feature/1.0 2019-05-21 18:23:11 +00:00
Zuul
bd23f78478 Merge "CI: Disable extra pip wheels mirror" into feature/1.0 2019-05-21 18:23:10 +00:00
Zuul
f04ed5b3df Merge "Move github references from openstack/ara to ansible-community/ara" into feature/1.0 2019-05-21 18:18:37 +00:00
David Moreau Simard
052f28a9a2
roles: use virtualenv_command instead of virtualenv_python
python3 -m venv is always expected to work while virtualenv_python might
attempt to use a virtualenv binary script.
We already make sure that python3-venv is installed in the ara_api
pre-requirements.

Fixes: https://github.com/ansible-community/ara/issues/43
Change-Id: I0994cd99e24f9a23d0dfeb66e8b838ced7aed948
2019-05-21 13:37:55 -04:00
David Moreau Simard
0f8d206659
CI: Disable extra pip wheels mirror
Change-Id: Ia584a6c178653775b727d7d03fca3c590c699f4b
Related: https://github.com/ansible-community/ara/issues/43
2019-05-21 12:15:38 -04:00
David Moreau Simard
942271a4a4
Move github references from openstack/ara to ansible-community/ara
Change-Id: I1942cbe9c6af51ade33168c12dbc3a7c59da3a14
2019-05-21 11:08:57 -04:00
David Moreau Simard
79c7e1b5e3
ara_api role: use ansible_user_id instead of ansible_user for gunicorn
ansible_user_id is always provided by host facts while ansible_user is
only available when supplied by the user.

Change-Id: I74ac06dab545d65475122139d4aca7422a34631b
Closes: https://github.com/ansible-community/ara/issues/44
2019-05-21 10:52:59 -04:00
David Moreau Simard
9b00abd786 Add support for specifying playbook labels as Ansible variables
By declaring the "ara_playbook_labels" list Ansible variable, the
callback picks them up and sends them to the API.
The API then ensures the label is created and associates it with
the playbook.

Change-Id: Ibe5c36ce005f0a7ce99b38c57439a6dc2277228a
2019-05-21 13:15:20 +00:00
Zuul
0b9c17132e Merge "Remove the description field from the label model" into feature/1.0 2019-05-17 17:47:50 +00:00
David Moreau Simard
ac9beaae95
Remove the description field from the label model
Having a name is sufficient and is required.

Change-Id: I95fd64fe27c166e167d736eb1f17eb67631817f5
2019-05-17 13:20:32 -04:00
David Moreau Simard
d04d5d21fe
Add missing test for patching a playbook name
Change-Id: I39fc0c46900e5984f2cdb28d9ae462ecd7f728e0
2019-05-17 12:48:14 -04:00
David Moreau Simard
e1d3e56893
Add docs for configuring Ansible and ARA plugins
This is ported and adapted from 0.x so users can read how to configure
Ansible to use ARA and how to configure the ARA Ansible plugins.

Change-Id: I021ef773a5bb8e0b1b11cb2a3b8fb6611665e319
2019-05-16 10:03:22 -04:00
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
1.0.0b1
2019-05-15 08:57:58 -04:00
David Moreau Simard
426016a8a6
ara_tests: move test results and stop cleaning them up
Ansible and the tests should be idempotent, there's no need to clean
things up.

Change-Id: I63feda9d6b4d7d7a35e94da2c71011330cde2e16
2019-05-15 08:51:39 -04:00
David Moreau Simard
f8e31af454
role: Do not escalate privileges for creating base directories
Otherwise we can end up doing something like escalating privileges for
creating directories in /tmp/ and then the regular user won't have
access to them.

We can revisit this later if need be.

Change-Id: Ieb33c23f2d278ed1156a8bc2d39c41bb9b4bb6f6
2019-05-15 07:51:31 -04:00
David Moreau Simard
5f628b8877 Write only supported configuration params to the settings file.
Customization from a settings.yaml file were not effective because
we were not retrieving them again.

Change-Id: Ia82ab96d02ccc84bdf506d9546c50d49d60f8915
2019-05-14 14:42:53 +00:00
Florian Apolloner
c321b8f62b Also ignore .venv directories.
Change-Id: Ie0e2b40dd539e75196626e51af0c9dbb74d01d1f
2019-05-13 21:35:09 +02:00
Florian Apolloner
91cdd43b19 Updated black dependency.
Black is nearing its stable release, so it makes sense to update it and
ensure that we are still formatted properly.

Change-Id: Ib2673093683b1a42d642c4ae201009492cbd32bf
2019-05-13 21:32:58 +02:00
David Moreau Simard
7bfe2ccfbc
Include the http scheme for CORS_ORIGIN_WHITELIST
django-cors-headers now requires them to be specified since version
3.0.0 [1].
The change is backwards compatible and works with the previous releases
of django-cors-headers.

[1]: https://github.com/ottoyiu/django-cors-headers/blob/master/HISTORY.rst#300-2019-05-10

Change-Id: Ie7d6170fc2e3952c4770e88bf58060df6239fbd7
2019-05-13 11:00:51 -04:00
Zuul
bb4e5040c6 Merge "Add playbook.arguments to the /playbooks list view" into feature/1.0 2019-05-08 18:40:42 +00:00
Zuul
0f16fb5cbf Merge "Add docs on how to specify credentials for authentication" into feature/1.0 2019-05-08 16:15:05 +00:00
David Moreau Simard
939cde948d
Add playbook.arguments to the /playbooks list view
Making playbook arguments available in the list view is a compromise
which increases the size of the response but prevents a call to the
playbook detailed view if the only purpose was to retrieve the playbook
arguments.

For example, this would allow ara-web to provide more context in the
playbook list view (ex: if --check was enabled) without needing additional
API calls for each playbook.

Change-Id: I32c2abfb2770b240ac2ea98c14ce054b922a4dfc
2019-05-08 12:10:15 -04:00
David Moreau Simard
58bff7cdf3
Add docs on how to specify credentials for authentication
Change-Id: Ie4edf97ab7eacec122e4b5a8c9d32405930b32c3
2019-05-08 11:29:28 -04:00
David Moreau Simard
7178505af6
Remove /api/v1/info, the data is now available at /
We recently added the API endpoint as well as the ara version directly
at / which makes the /api/v1/info endpoint redundant and unnecessary.

Change-Id: I472be593dccd249ce352760c9c517209cd0469a3
2019-05-08 10:02:12 -04:00
David Moreau Simard
c00fade684
Import pbr.version instead of pbr when retrieving version
It seems that under some circumstances, "pbr.version" can't be imported
and returns an error:

    "version": pbr.version.VersionInfo("ara").release_string(),
    AttributeError: module 'pbr' has no attribute 'version'

Change-Id: Ia04dcb49c18c45f1d235ae1158780a060e4053d8
2019-05-08 10:02:12 -04:00
Tristan Cacqueray
60b13b18e3 Add APIRoot index
This change adds a welcoming index to the root path so that users
can navigate the api without knowning the path instead of being
given a 404.

Change-Id: If865e3c4ee7e6fa633c74152d6579b94ea75be4a
2019-05-08 10:49:31 +00:00