* Before, we were re-writing `plugin:` when users updated the
InventorySource via the API. Now, we just override at run-time. This
makes for a more sane API interaction
* Lean on API validation for tower_inventory_source arg errors
used for
- validating needed credential is given
- missing source_project for scm sources
* Add warning when config is specified in 2 places
Fix up unit tests, address multiple comments re: backwards compatibility, redundant methods, etc.
Update new_name and variables parameters, update unit tests
under the hood, Host.ansible_facts is a postgres jsonb field which
performs match operations using the JSON containment operator (@>)
this operator _only_ works on exact matches on containment (i.e.,
"does the `ansible_distribution` jsonb value contain _this exact_ JSON
structure"):
SELECT ...
FROM main_host
WHERE ansible_facts @> '{"ansible_distribution": "centos"}'
SELECT ...
FROM main_host
WHERE ansible_facts @> '{"packages": {"dnsmasq": [{"version": 2}]}}'
postgres does _not_ expose any operator for fuzzy or lookup-based
matches with this operator, so host filter values like these don't
really make sense (postgres can't _filter_ in the way intended in these
examples):
ansible_distribution__startswith=\"Cent\"
ansible_distribution__icontains=\"CentOS\"
ansible_facts__packages__dnsmasq[]__version__startswith=\"2\"
This makes inventory sources with the that flag set behave
like any other inventory source with manual use.
They will still update when triggered by a project SCM
hash change.
Introduced new decorator for patching an access method,
does legwork of inserting into access registry so that
tests that test the API can mock RBAC behavior.
* fixed a problem where the SCM last revision was not getting reset
* change the 400 editing error to just reset the last revision
* handle `source_vars` in the same way as custom scripts
* block unallowed `source_vars` in the validator
* hide POST in OPTIONS for inventory source sublist if not allowed
on InventorySource model
* scm_project -> source_project
on InventorySourceSerializer
* scm_inventories -> scm_inventory_sources
on InventoryUpdate model
* scm_project_update -> source_project_update