This is the first command being ported and so it includes the base
framework for integrating other commands with cliff.
The docs are also re-arranged to include the new commands, some
examples, as well as the existing ara-manage commands.
Change-Id: Ia758e4b70ec0a6821e97b5b66d123dfe33cc63d3
This makes it so "pip install ara" would only install a minimal
amount of dependencies (pbr and requests as of this commit) required
for running the Ansible callback plugin as well as ara_record.
The server dependencies can be installed by running
"pip install ara[server]".
Fixes: https://github.com/ansible-community/ara/issues/36
Change-Id: I67769d28ec24cade7753230dffd0b049358af29a
The usage of static files in the ARA API server is very limited.
They are used for displaying the API browser from django-rest-framework
and the Django admin interface.
By using whitenoise, Django can serve static files through "manage.py
runserver" and through the WSGI application without needing to enable
debug mode or adding specific routes.
This allows us to simplify the deployment a bit because we no longer
need to collect static files.
We're also taking this opportunity to simplify configuration a bit by no
longer exposing the following configuration options:
- STATIC_ROOT
- STATIC_URL
- MEDIA_ROOT
- MEDIA_URL
They'll still be loaded but there is no longer a use case for being able
to change the defaults -- at least for the time being.
Change-Id: I9fc853e84b3739fca574afcd2da799dc8c1fbad6
It was used in the previous implementation of settings.py which has
since been replaced with dynaconf.
Change-Id: Id8bca7a35cbc817120e04d3fc6247eaee48bef01
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
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
It was forgotten when adding in the http client
and ara-clients no longer worked when we started
not installing ara/ara-server for nothing.
Change-Id: I056d1a2822cddb2a6058a86fa5cccef8e810ee2e
Changes include:
* Custom admin app config instead of monkey patching attributes.
* DRF Routers & Viewsets instead of manual view configuration.
* nested viewsets from drf-extensions (for now) to scope files to playbooks.
* Removed media serving since runserver does this alreay in dev;
deployment will need another option anyways.
Change-Id: I409bd3f7faa5f133fcb204613baebf2512d34c1a
Otherwise it won't work because the API server listens on 127.0.0.1,
not localhost.
The right fix is probably to set the nodejs server to start on
127.0.0.1, though.
Figure this out later.
Change-Id: I260e794e8ff842f6b854d313d6c243e431220fcd
- Make the project installable with pbr
- Use tox to run tests, build docs, runserver
- Flesh out the README a little bit
- Real docs is WIP.
Change-Id: I3dc92250cd93add0cdf11c6a67d8f1081560d4e1