Commit Graph

563 Commits

Author SHA1 Message Date
Ryan Petrello
35f629d42c Revert "changes to license compliance"
This reverts commit 218dfb680e.
2018-02-22 15:02:33 -05:00
AlanCoding
9c4d89f512 use the m2m field for inventory source creds 2018-02-20 12:34:56 -05:00
Wayne Witzel III
2c71a27630 Merge pull request #1123 from wwitzel3/new-permissions
New RBAC Roles
2018-02-15 16:56:03 -05:00
Wayne Witzel III
30a5617825 Address PR feedback 2018-02-14 22:53:33 +00:00
Ryan Petrello
218dfb680e changes to license compliance
now if a license is expired or over the managed node limit, it won't
prevent host creation or Job/JobTemplate launches

see: https://github.com/ansible/ansible-tower/issues/7860
2018-02-14 15:51:19 -05:00
AlanCoding
960845883d change schedule qs logic, avoid server error 2018-02-13 08:32:00 -05:00
Wayne Witzel III
819b318fe5 Add Org Execute 2018-02-10 02:52:26 +00:00
Wayne Witzel III
9e7bd55579 Add Notification Admin 2018-02-10 02:52:26 +00:00
Wayne Witzel III
b478740f28 Add Workflow Admin 2018-02-10 02:52:25 +00:00
Wayne Witzel III
109841c350 Add Credential Admin role 2018-02-10 02:52:25 +00:00
Wayne Witzel III
6c951aa883 Add Inventory Admin role 2018-02-10 02:52:25 +00:00
Wayne Witzel III
e7e83afd00 Add Project Admin role 2018-02-10 02:52:25 +00:00
Matthew Jones
624289bed7 Add support for directly managing instance groups
* Associating/Disassociating an instance with a group
* Triggering a topology rebuild on that change
* Force rabbitmq cleanup of offline nodes
* Automatically check for dependent service startup
* Fetch and set hostname for celery so it doesn't clobber other
  celeries
* Rely on celery init signals to dyanmically set listen queues
* Removing old total_capacity instance manager property
2018-02-01 16:46:44 -05:00
Ryan Petrello
1369f72885 add new API endpoints and websocket emit for new job event types
see: https://github.com/ansible/awx/issues/200
2018-01-03 09:09:44 -05:00
AlanCoding
e3a731bb9e apply listview optimizations to detail view 2017-12-13 16:09:37 -05:00
Matthew Jones
9dbcc5934e Merge remote-tracking branch 'tower/release_3.2.2' into devel 2017-12-13 12:25:47 -05:00
Ryan Petrello
202161f090 move legacy UnifiedJob stdout data to a separate unmanaged model
This data often (in the case of inventory updates) represents large data
blobs (5+MB per job run).  Storing it on the polymorphic base class
table, `main_unifiedjob`, causes it to be automatically fetched on every
query (and every polymorphic join) against that table, which can result
in _very_ poor performance for awx across the board.  Django offers
`defer()`, but it's quite complicated to sprinkle this everywhere (and
easy to get wrong/introduce side effects related to our RBAC and usage
of polymorphism).

This change moves the field definition to a separate unmanaged model
(which references the same underlying `main_unifiedjob` table) and adds
a proxy for fetching the data as needed

see https://github.com/ansible/awx/issues/200
2017-12-12 18:16:19 -05:00
AlanCoding
72a8854c27 Make ask_mapping a simple class property
from PR feedback of saved launchtime configurations
2017-12-08 13:45:23 -05:00
AlanCoding
34a8e0a9b6 Feature: saved launchtime configurations
Consolidate prompts accept/reject logic in unified models
Break out accept/reject logic for variables
Surface new promptable fields on WFJT nodes, schedules

Make schedules and workflows accurately reject variables
  that are not allowed by the prompting
  rules or the survey rules on the template

Validate against unallowed extra_data in system job schedules
Prevent schedule or WFJT node POST/PATCH with unprompted data
Move system job days validation to new mechanism
Add new psuedo-field for WFJT node credential
Add validation for node related credentials
Add related config model to unified job
Use JobLaunchConfig model for launch RBAC check

Support credential overwrite behavior with multi-creds
  change modern manual launch to use merge behavior
Refactor JobLaunchSerializer, self.instance=None
Modularize job launch view to create "modern" data
Auto-create config object with every job
Add create schedule endpoint for jobs
2017-12-08 13:38:54 -05:00
AlanCoding
a880f47925 fix bug with inventory update queryset 2017-11-28 14:13:35 -05:00
Aaron Tan
0641c6b0a6 Supress exception with concurrent deletion
Relates https://github.com/ansible/ansible-tower/issues/7768

This issue, as well as
https://github.com/ansible/ansible-tower/issues/7622, both rooted in a
concurrency issue of Django ORM:
https://github.com/ansible/ansible-tower/issues/762://code.djangoproject.com/ticket/28806

The solution related deals specifically with the related issue, but is
not a general solution. A general workaround can be found in
https://github.com/ansible/tower/pull/500.

Signed-off-by: Aaron Tan <jangsutsr@gmail.com>
2017-11-17 16:29:08 -05:00
AlanCoding
8cb5ce8307 prefetch UnifiedJob related credentials 2017-11-15 22:35:10 -05:00
Ryan Petrello
28ce9b700e replace all Job/JT relations with a single M2M credentials relation
Includes backwards compatibility for now-deprecated .credential,
.vault_credential, and .extra_credentials

This is a building block for multi-vault implementation and Alan's saved
launch configurations (both coming soon)

see: https://github.com/ansible/awx/issues/352
see: https://github.com/ansible/awx/issues/169
2017-11-14 12:49:12 -05:00
AlanCoding
7eac219eae do not use expensive visible_roles for Act Stream filter 2017-11-14 08:37:14 -05:00
Wayne Witzel III
96904968d8 Fix migration issues, tests, and templates 2017-11-09 17:29:48 -05:00
AlanCoding
0051da95c9 fix bug of system auditor 404 viewing job 2017-11-08 10:44:41 -05:00
AlanCoding
270a41443c fix bug of system auditor 404 viewing job 2017-11-03 08:20:15 -04:00
AlanCoding
4e16b19ae6 Refactor access.py get_queryset into filtering method
Use BaseAccess class to enforce the superuser and system
  auditor conditions, as well as the optimizations.
Declare optimizations on access class as tuple.
Limit role of access class method narrowly to RBAC filtering.
2017-10-26 11:40:08 -04:00
AlanCoding
5380d57ce8 add period to active job conflict error
Rename StateConflict to ActiveJobConflict and used shared
message inside of that exception class.
2017-10-10 14:38:48 -04:00
AlanCoding
3abbe87e10 fix bug checking WFJT node for prompted resources 2017-10-10 14:38:46 -04:00
AlanCoding
681770e25a allow WFJT admins to cancel scheduled jobs 2017-10-02 10:25:49 -04:00
Matthew Jones
64415872a0 Merge branch 'release_3.2.0' into devel 2017-09-18 10:55:45 -04:00
Ryan Petrello
7a958a1af1 more result_stdout_text defer optimization for inventory updates
see: https://github.com/ansible/ansible-tower/issues/7568
2017-09-15 09:51:53 -04:00
Chris Meyers
28a26e6e81 Merge pull request #408 from chrismeyersfsu/7500_process_workflow_cornercase_for_user_capability
memoize workflow license feature check
2017-09-14 08:29:41 -04:00
Matthew Jones
7e754e20ae Merge pull request #404 from ansible/sys_auditor_can_set_pass
Allow System Auditor to set password
2017-09-13 06:32:10 -07:00
Ryan Petrello
bd42dfe474 defer UnifiedJob.result_stdout_text for improved performance
result_stdout_text can be _very_ large - some customers have 5MB+ per
job; querying for this in list contexts results in _very_ large datasets
being read from the database which is very slow.  It's very uncommon to
actually need this column outside of the context of job details, so
defer it.

see: https://github.com/ansible/ansible-tower/issues/7568
2017-09-12 16:35:49 -04:00
Matthew Jones
d308946360 Allow system auditor to set their own password 2017-09-12 16:07:47 -04:00
AlanCoding
41940687f1 Pass existing object references within access methods
This avoids re-loading objects from the database in our
chain of permission checking, wherever possible.
access.py is equiped to handle object references instead
of pk ints, and permissions.py is changed to pass those refs.
2017-09-06 16:34:00 -07:00
Aaron Tan
68391301b0 Pick up workflow cornercase in get_user_capabilities 2017-08-31 11:31:41 -04:00
AlanCoding
2027047220 fix bug with host_filter RBAC check 2017-08-31 10:42:16 -04:00
Alan Rominger
7a1f674abc Merge pull request #363 from AlanCoding/org_smart_inv
backend of org-scoped smart inventories
2017-08-29 20:51:03 -04:00
AlanCoding
ff96a750e1 backend of org-scoped smart inventories 2017-08-29 16:43:56 -04:00
Matthew Jones
d7fd3a467a Ensure that only the super user can dis/associate IGs from Orgs 2017-08-29 09:36:42 -04:00
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