Commit Graph

166 Commits

Author SHA1 Message Date
David Moreau Simard d361537fa9
Remove Zuul configuration for ara-server
Depends-On: https://review.openstack.org/640818
Change-Id: I298f0dd757362d3800e99c6e5094b671d56ae9c6
2019-03-04 12:02:08 -05:00
David Moreau Simard 33e4c1d841
Update README to explain ara-server was migrated back into ara
The ara-server standalone repository is being discontinued.
The clear and logical separation of components was nice but the overhead
in complexity was not worth it.

Change-Id: I9d5e3096db4972405932ae2af46ee63bfeef43b5
2019-03-02 08:47:26 -05:00
David Moreau Simard c0021b3e05
Use DurationSerializer for the results, they have a duration
DurationSerializer provides the duration of items that have "started",
"updated" and "ended" fields.

Change-Id: Ieeab1e1cc046b7ec52a0f86c5a38fe9c9ec6f7ad
2019-02-20 10:06:20 -05:00
Guillaume Vincent d3de8af4c8
Allow get results with multiple statuses
Change-Id: Id649fa95e908ba69d3e95502a47e203496e5b79e
2019-01-30 16:30:00 -05:00
Zuul de925912f5 Merge "Add pip-wheel-metadata to gitignore" 2019-01-28 18:50:11 +00:00
Zuul 4238a0fa06 Merge "Misc updates to security and configuration documentation" 2019-01-25 21:28:59 +00:00
Zuul 706c235e72 Merge "Added support for external auth via REMOTE_USER provided by webservers." 2019-01-25 21:28:58 +00:00
David Moreau Simard 0709e3ed6a
Add pip-wheel-metadata to gitignore
Not exactly sure where this new directory is coming from yet.
It is created when running tox.

Change-Id: I643146ac09d69a526f6dfecb7b6fdfbf727801aa
2019-01-25 12:33:20 -05:00
David Moreau Simard 35999a1bed
Misc updates to security and configuration documentation
- Improve docs on ARA_ENV
- Refresh outdated defaults
- Fix broken link on ara-web git repo

Change-Id: Ib882dc7415cc7b50f35a3a6bfbf1bc0fbe401dc8
2019-01-25 12:29:11 -05:00
Florian Apolloner c703bf8245 Added support for external auth via REMOTE_USER provided by webservers.
Change-Id: If36c3406c1a0d991633e08657e1441c322b3cf9d
2019-01-25 17:01:40 +01:00
David Moreau Simard 5a7eeb93af First iteration of authentication and security docs
This is a first iteration on basic security and authentication
documentation. It documents the security settings users might want to
pay attention to and explains how to configure them.

We're bumping the version of sphinx in order to enable the
"autosectionlabel" extension so we don't need to create explicit
labels for sections.

Change-Id: I694eb1a2aa03193335f11cbda40ed6962357c428
2019-01-24 17:07:36 +00:00
Florian Apolloner ee8e1aa5ee Added very basic read/write authentication.
Auth is performed via basic auth, create a user in the admin if you want
to get access.

Change-Id: Ie6a4f7e440387b4472661284408213872f453473
2019-01-24 17:07:31 +00:00
David Moreau Simard 3d5efff28c
Replace the ansible-integration job by the new integration jobs
ara-infra now provides a new and improved set of integration jobs
so we no longer need to have the ansible-integration job.

These new jobs test ara-server, ara-clients and ara-plugins against
a variety of operating systems and versions of Ansible.

It was convenient to be able to run these tests from ara-server by
itself, we'll re-introduce a wrapper so we can continue to do so
later.

Depends-On: https://review.openstack.org/#/c/630303
Change-Id: Iedf259e44af5165be08c5d6917e5af98b281202d
2019-01-23 13:44:28 -05:00
David Moreau Simard ca0137b437
Docs: SECRET_KEY is now randomly generated if it's not set
Update docs to reflect that in https://review.openstack.org/#/c/631011/
we made SECRET_KEY optional to launching ara-server by randomizing a
key if none are supplied by the configuration.

Change-Id: I469663082ed6071db250c8152430ea1e8d61b500
2019-01-21 10:56:48 -05:00
Florian Apolloner 47dc0ad989 Fixed XSS issue from DRF.
Details in https://github.com/encode/django-rest-framework/issues/6330

Change-Id: Icea25569b92c3559029ae1c93712e746684187f1
2019-01-17 22:40:43 +01:00
Florian Apolloner 600a189b21 Renamed most of config to settings and dropped the default_ prefix.
Dropping the default prefix from the default settings file allows a user
to run an ARA production config by just changing that file. This seems
more in line with default configuration search paths of most other
programs out there.

Since the generated SECRET_KEY should be safe, there should be no
problem in reusing the generated file.

Change-Id: I1cfbc04cba378d7bda9386b344efae85b3490296
2019-01-16 13:56:37 +01:00
Zuul 2c8eb916b2 Merge "Fixed config code example if the path has spaces." 2019-01-16 12:47:17 +00:00
Zuul dd5f26fd14 Merge "Fixed default configuration loading and do not write default config if a config is specified." 2019-01-16 02:13:51 +00:00
Florian Apolloner 9c7c7c474f Fixed config code example if the path has spaces.
Change-Id: I3a9dd03c9957cde335a8d37b88bbfe257492012a
2019-01-16 02:09:50 +00:00
Zuul d29209dc17 Merge "Add Tasks, Records and Plays to Playbook serializer" 2019-01-15 23:19:14 +00:00
Florian Apolloner 5bae31785f Fixed default configuration loading and do not write default config if a config is specified.
Change-Id: I671f59256bbc5a5d5c68e3bfbabfd26375fbb406
2019-01-15 20:37:52 +01:00
Florian Apolloner e171aab870 Alternative approach to manage.py instead of symlink.
Change-Id: Ia51bb220371557685878595a6d86d33baa94cebb
2019-01-15 18:14:08 +01:00
Florian Apolloner cf2bda747b Adjusted requirements to include yaml for dynaconf.
Change-Id: I5eccfde22fdd0725d41258bc4acc7fe771289874
2019-01-15 18:11:38 +01:00
David Moreau Simard e47f5afb2e
Load logging from settings.py to tell users about the things we do
This will tell them:
- If we created SERVER_DIR (info)
- If we generated a random SECRET_KEY (warn)
- What configuration file (ARA_SETTINGS) is in use (info)

Change-Id: I6a1bbc0032fc1d73859e9c7c3efec463e1574416
2019-01-15 11:41:53 -05:00
David Moreau Simard 8b8bc03f7c
Create a persistent default random secret key if none are set
If there are no SECRET_KEY or ARA_SECRET_KEY environment variables
set or if there is no configuration file with the SECRET_KEY variable
set, settings.py will generate a random secret key once and it will
be persisted to the default configuration.

Change-Id: Idf2f1ee5f8a70bc2411de51a154bc4504705d89a
2019-01-15 11:41:51 -05:00
David Moreau Simard eadd3712b5
Re-add manage.py to the root of the repository
manage.py is a standard in Django projects and it is expected to
be available at the root of the repository.

We're keeping the ara-manage entry point so this is just a symlink
to ara/server/__main__.py.

Change-Id: I0819479e978eac1269d7e48e709bed0f59c9fe5e
2019-01-15 10:35:18 -05:00
Guillaume Vincent ca5c065b18 Add Tasks, Records and Plays to Playbook serializer
Change-Id: Ic2456f021107d9397ea561fbc9a60661c34b5f2c
2019-01-15 16:01:48 +01:00
David Moreau Simard 6519a91289
Serialize the value provided by ara_record
We need to serialize the value provided by ara_record since
the values can be structured data such as lists, dicts or json.

Editorial note: the value field in ARA 0.x was already serialized
so this is considered a bug fix.

Change-Id: I9beea4a755db077806952d3fdf7cbb04aaad3209
2019-01-14 15:15:38 -05:00
Florian Apolloner 1039878100 Updated Django dependency to 2.1.5
This is needed so that
e1721ece48 (diff-f6d1c75ec606389da5af6558bf57f171)
is included and saves us from having compat code in https://review.openstack.org/#/c/617112/1

This is also a good idea in preparation of the Django 2.2 release which
will be LTS and probably the version ARA should target.

Change-Id: I36d74c6c0a0165dd1ceaf695185809af5d6da18e
2019-01-04 17:01:42 +01:00
Zuul 526ce375d4 Merge "Add docs on how to use the API clients with ara-server" 2018-12-21 16:54:04 +00:00
Zuul 6625e9d274 Merge "Add documentation on how to configure ara-server" 2018-12-21 16:34:39 +00:00
David Moreau Simard e279385bce
Add docs on how to use the API clients with ara-server
Change-Id: I1c6cee62f9ab261a06d2bc5cbbd42b1f74829e76
2018-12-21 11:31:04 -05:00
Zuul 7a36f260b9 Merge "Remove requirement on django-environ" 2018-12-21 16:13:00 +00:00
Zuul 806879fbcb Merge "Add basic installation documentation" 2018-12-21 16:12:59 +00:00
Zuul c846275602 Merge "Update and improve README" 2018-12-21 16:12:59 +00:00
David Moreau Simard 827f3ed16b
Add documentation on how to configure ara-server
Change-Id: I59fc4def84116c4cf1c764799f00485305af9273
2018-12-21 10:49:55 -05:00
David Moreau Simard d671ff33b4
Update and improve README
- Add quickstart docs
- Remove scary disclaimer
- Add community info

Change-Id: Ib506baa6590ac2debc718fc42a572c747e6ac46f
2018-12-21 10:28:47 -05:00
David Moreau Simard 42404c41e0
Add basic installation documentation
Change-Id: Ie656aa1591a9f7aa46bf50714589304cd3196b68
2018-12-21 10:26:15 -05:00
Zuul 1952d041f7 Merge "Fix ansible-integration test after playbook.files tweak" 2018-12-21 15:23:41 +00:00
David Moreau Simard 71a2e122d7
Remove requirement on django-environ
It was used in the previous implementation of settings.py which has
since been replaced with dynaconf.

Change-Id: Id8bca7a35cbc817120e04d3fc6247eaee48bef01
2018-12-21 10:04:18 -05:00
David Moreau Simard d37baf3765
Fix ansible-integration test after playbook.files tweak
Now that the change in the callback landed, we can address this.
We'll improve these tests soon.

Change-Id: I47c354771723ae85df4e61529e7d832c2585e245
2018-12-21 09:54:54 -05:00
Florian Apolloner 39339053ec Added endpoint exposing ara and python version.
Change-Id: Ic0fead79c0b87d87b990cc6c6526a44414a4546e
2018-12-21 11:39:30 +01:00
David Moreau Simard 2bd8c3f654
Refactor and standardize how files are added to playbooks
Files are now (once again) related to playbooks.
We expect the playbook to be created first and then it's files are
created and associated to it.

- the /api/v1/playbook/<id>/files endpoint was removed
- the playbook id is now required when doing a POST on /api/v1/files
- playbook.file referenced a file object and no longer exists.
- playbook.file was replaced by "path" which is the path for the playbook
  file.
- playbook.files still exists but, from an API standpoint, this means
  that to find the files associated to a playbook, we can now do
  something like:

    "/api/v1/files?playbook=%s" % playbook.id

To find the playbook file itself, we can do something like:

    "/api/v1/files?playbook=%s&path=%s" % (playbook.id, playbook.path)

Change-Id: Id51129757e1626313caee4005b081027e5694aba
2018-12-20 17:49:01 -05:00
Florian Apolloner fdcc003fd9 Made dynaconf integration more explicit.
Change-Id: I9557a0da5b1c643acc3581abc9e56b58f4df8bc9
2018-12-20 18:46:02 +01:00
David Moreau Simard 16aa41eaf8 Refactor configuration to use dynaconf
This changes the configuration engine from everett to dynaconf.
dynaconf allows loading configuration from files (json, ini, yaml, toml)
as well as environment variables prefixed by ARA_.

Our usage of dynaconf is similar to the use case from the Pulp [1]
project and they have documented an issue when loading database
parameters [2]. This issue is worked around by importing dynaconf in the
different entry points.

This introduces some other changes as well:
- We're now creating a default configuration and data directory at
  ~/.ara. The location of this directory is controlled with the
  ARA_BASE_DIR environment variable.
- We're now creating a default configuration template in
  ~/.ara/default_config.yaml.
- The default database is now located at ~/.ara/ara.sqlite. The location
  of this database can be customized with the ARA_DATABASE_NAME
  environment variable.
  Note that ARA 0.x used "~/.ara/ansible.sqlite" -- the file name change
  is deliberate in order to avoid user databases clashing between
  versions.

More documentation on this will be available in an upcoming patch.

[1]: https://github.com/pulp/pulp
[2]: https://github.com/rochacbruno/dynaconf/issues/89

Change-Id: I8178b4ca9f2b4d7f4c45c296c08391e84e8b990d
2018-12-20 17:53:11 +01:00
Zuul 6c00d7552b Merge "Add playbook filtering by status" 2018-12-13 18:46:19 +00:00
Zuul b93cf0d33d Merge "Move manage.py to ara.server.__main__ and add an entry point" 2018-12-13 18:46:19 +00:00
melissaml 4d0c3fc93d Change openstack-dev to openstack-discuss
Mailinglists have been updated. Openstack-discuss replaces openstack-dev.

Change-Id: I23eb17817cb0fc165fb80271111acf06896ad8aa
2018-12-07 20:33:35 +08:00
David Moreau Simard c5890ea0cc
Add playbook filtering by status
This allows to search playbook by status (running, failed, completed,
etc.)

Change-Id: I05bba5611bb1f18e48791d570575b6f57c5862d9
2018-12-06 18:03:43 -05:00
David Moreau Simard 90ac1acc51
Move manage.py to ara.server.__main__ and add an entry point
This moves manage.py inside the package and sets up an "ara-manage"
console entry point for doing something like "ara-manage runserver"
instead of "python manage.py runserver".

Putting this under __main__ also allows users to do "python -m
ara.server".

Change-Id: I86b57f11fed2fea0295b1980e2734e35289d84f3
2018-12-06 16:14:11 -05:00