Commit Graph

520 Commits

Author SHA1 Message Date
Alan Rominger
ba8326285e Merge pull request #337 from AlanCoding/capacity_fix
correct capacity algorithm for task manager
2017-08-28 16:49:19 -04:00
AlanCoding
5327a4c622 Use global capacity algorithm in serializer
The task manager was doing work to compute currently consumed
capacity, this is moved into the manager and applied in the
same form to the instance group list.
2017-08-28 12:07:47 -04:00
Alan Rominger
c904ed62fe Merge pull request #348 from AlanCoding/jobs_opt
optimizations for unified job subtypes
2017-08-28 11:06:26 -04:00
AlanCoding
a1083d45c5 optimizations for unified job subtypes 2017-08-19 07:05:37 -04:00
AlanCoding
66a8170bbc basic API optimization of labels list 2017-08-17 10:33:10 -04:00
AlanCoding
eed5a5c924 fix adhoc IG bug and prevent related inventory deletion 2017-08-14 11:14:42 -04:00
Alan Rominger
fe66d161b2 Merge pull request #140 from AlanCoding/poly_why
hack to work around Django-polymorphic prefetch_related bug
2017-08-07 14:24:17 -04:00
AlanCoding
dfda406090 remove can_update from RBAC checks 2017-08-04 12:39:05 -04:00
Chris Meyers
22aa251a24 Merge pull request #127 from chrismeyersfsu/fix-6559
remove conditional inventory sources POST
2017-08-02 12:25:50 -04:00
Chris Meyers
6cc5f14e16 remove conditional inventory sources POST
* Move logic from validator down to model
* Allow only 1 inventory source of type scm with
update_on_project_update set to True; for each inventory
2017-08-02 11:49:10 -04:00
AlanCoding
321591515c hack to work around Django-polymorphic select_related bug 2017-08-02 09:32:13 -04:00
AlanCoding
1722d2169b Fix RBAC bugs in job relaunch with prompted extra_credentials
In addition to just checking for similarity with JT,
in all cases (prompt_for_credential_on_launch both T/F)
check for use_role on all extra_credentials the job has
if the job extra_credentials differ from the JT
2017-07-28 15:53:29 -04:00
Aaron Tan
5a540a877e Prevent unprivileged users from deleting inventory sources 2017-07-27 16:29:03 -04:00
AlanCoding
7ff23e049a block deletion of inventory sources with running jobs 2017-07-19 08:26:57 -04:00
Matthew Jones
1b02809f9e Fixing missing import for licenseforbids
This was improperly removed during the license refactor
2017-07-14 10:54:21 -04:00
Matthew Jones
891f26c850 Fix an issue where an unlicensed system would throw errors
In the case where the license was entirely not present but the tower
license module was present
2017-07-14 10:21:26 -04:00
Matthew Jones
8e8324983b Merge branch 'license_module_switch' into devel
* license_module_switch:
  Hide eula if stub license is used
  Fix up some issues on feature validation for licenses
  Remove any references to internal licensing utilities
  Switch out existing obfuscated license with external module
2017-07-13 11:08:47 -04:00
Matthew Jones
8486944eaa Switch out existing obfuscated license with external module
This creates a new fallback license module called StubLicense that
will be used in the event that the tower_license module is not
installed.

All existing license mechanisms are routed through the get_licenser()
util method
2017-07-11 12:01:24 -04:00
AlanCoding
fed2eddf07 move circular group association validation to view 2017-07-10 09:12:02 -04:00
Chris Meyers
318b1aebd1 remove special scan job logic 2017-07-05 10:32:45 -04:00
adamscmRH
4b3b184fc8 Fix duplicate Instances in API 2017-07-03 15:23:39 -04:00
AlanCoding
ad4a7fe033 access_registry made simple dict with auto registration 2017-06-29 15:17:37 -04:00
Alan Rominger
68103f2d72 Merge pull request #6720 from AlanCoding/scm_inv_update_resp
Accuracy edit for inventory update response when updating project
2017-06-29 11:45:50 -04:00
Ryan Petrello
b0e51b42d8 fix a bug that prevents unpriveleged users from listing CredentialTypes
see: #6737
2017-06-27 16:47:02 -04:00
AlanCoding
066dc4a5f0 Separate Inventory Source API vs RBAC testing
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.
2017-06-23 15:31:59 -04:00
AlanCoding
f62f0ca1e6 add isolated job controller_id to summary fields 2017-06-21 16:29:06 -04:00
Wayne Witzel III
d8dfc7e97b Ensure InventorySource access is checking against Inventory access properly 2017-06-15 09:29:17 -04:00
Ryan Petrello
d4afa41acb key prompting of all credentials off of ask_credential_on_launch
see: #6371
2017-06-12 12:26:58 -04:00
Wayne Witzel III
c6925ca8b4 Ensure the admin_role can always add an inventory_source. 2017-06-07 11:44:44 -04:00
Wayne Witzel III
b9520c7f3b Merge pull request #6246 from wwitzel3/issue-5756
Create /inventories/N/update_inventory_sources endpoint.
2017-05-12 17:30:00 -04:00
Alan Rominger
5f3aad4972 Merge pull request #6256 from AlanCoding/relaunch_extra_creds
Job relaunch refactor to accommodate new credential system
2017-05-12 17:24:16 -04:00
AlanCoding
048804f48e Job relaunch refactor to accomidate new credential system
* make user_capability for 'start' more simple
* provide error messages if relaunch not possible
* check for prompted extra_credentials
* add extra_credentials permission checks in orphan mode
2017-05-12 17:16:06 -04:00
AlanCoding
c6a3a7cc34 JT RBAC edits for extra_credentials and vault_credential 2017-05-12 17:13:58 -04:00
Ryan Petrello
1ba71acf07 fix a typo causing tests to fail 2017-05-12 15:34:23 -04:00
Matthew Jones
1a4a6273a4 Merge branch 'rampart_groups_setup_playbook' into devel
* rampart_groups_setup_playbook:
  Updating changelog for Instance Groups
  Fix an incorrect reference on instance group jobs list
  Purge remaining references to rampart groups
  Simplify can_access for instance groups on job templates
  Adding Instance Group permissions and tests
  Increase test coverage for task scheduler inventory updates
  Exit logic fixes for instance group tools
  View Fixes for instance groups
  new view to allow associations but no creations
  Updating acceptance documentation and system docs
  Updating unit tests for task manager refactoring
  Update views and serializers to support instance group (ramparts)
  Implementing models for instance groups, updating task manager
  Updating the setup playbook to support instance group installation
  Add nginx to server start and switch back to first tmux win
  Fix an issue where the local queue wouldn't use the rabbitmq name
2017-05-12 13:40:30 -04:00
Matthew Jones
c1a6fc050d Simplify can_access for instance groups on job templates 2017-05-11 22:17:42 -04:00
Alan Rominger
7a1c6c6794 Merge pull request #6241 from AlanCoding/scm_inv_feedback
SCM inventory acceptance and bug updates
2017-05-11 16:30:26 -04:00
Matthew Jones
f8fc9cff5c Adding Instance Group permissions and tests 2017-05-11 15:14:18 -04:00
Wayne Witzel III
aff084e1f6 Update permissions/RBAC for updates 2017-05-11 14:01:32 -04:00
AlanCoding
97ca6bc897 SCM inventory acceptance and bug updates
* 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
2017-05-11 12:04:48 -04:00
Ryan Petrello
53c3ece32b add prompting for JT.extra_credentials
see: #2913
2017-05-11 07:29:53 -04:00
Matthew Jones
705f8af440 Update views and serializers to support instance group (ramparts)
* includes top level views for instances and instance groups and
  extending those views to be able to view running jobs
* Associative endpoints on Organizations, Inventories, and Job
  Templates
* Related and summary field entries where appropriate
* Adding job model references to executing instance group
* Fix up default queue properties for clustering from the settings file
* Update production and default settings for instance queues in settings
2017-05-10 12:33:03 -04:00
Ryan Petrello
1568fddde1 Make CredentialType conditionally editable/readonly.
* CredentialTypes should not be editable *or* deletable if they're
  "managed_by_tower".
* CredentialTypes should not be deletable if they're in use by one or
  more Credentials.
* CredentialType.inputs should not be editable if they're in use by one
  or more Credentials.

see: #6077
2017-05-08 16:13:26 -04:00
Ryan Petrello
385080ebf2 Merge pull request #6168 from ryanpetrello/multicredential_job
Replace Job/JT cloud/network credentials with a single M2M relation.
2017-05-04 12:39:10 -04:00
AlanCoding
d826c45ac6 SCM Inventory field name changes
on InventorySource model
* scm_project -> source_project
on InventorySourceSerializer
* scm_inventories -> scm_inventory_sources

on InventoryUpdate model
* scm_project_update -> source_project_update
2017-05-04 09:15:29 -04:00
AlanCoding
12ab3a0ae9 managed_by_tower restriction now in validation, not access 2017-05-03 13:53:06 -04:00
Ryan Petrello
accf7cdea2 Replace Job/JT cloud/network credentials with a single M2M relation.
The following fields:

    * (Job | JobTemplate).cloud_credential
    * (Job | JobTemplate).network_credential

...are replaced by M2M relationships:

    * Job.extra_credentials
    * JobTemplate.extra_credentials

Includes support for task execution with multiple cloud credentials.

see: #5807
2017-05-03 13:36:59 -04:00
Wayne Witzel III
9f28c57521 Remove all CONSTANTS 2017-05-03 10:27:32 -04:00
Ryan Petrello
ba259e0ad4 Introduce a new CredentialTemplate model
Credentials now have a required CredentialType, which defines inputs
(i.e., username, password) and injectors (i.e., assign the username to
SOME_ENV_VARIABLE at job runtime)

This commit only implements the model changes necessary to support the
new inputs model, and includes code for the credential serializer that
allows backwards-compatible support for /api/v1/credentials/; tasks.py
still needs to be updated to actually respect CredentialType injectors.

This change *will* break the UI for credentials (because it needs to be
updated to use the new v2 endpoint).

see: #5877
see: #5876
see: #5805
2017-04-21 15:42:26 -04:00
Alan Rominger
1011e54689 Merge pull request #5985 from AlanCoding/scm_inv5
SCM file-based inventory sources
2017-04-17 16:22:24 -04:00