Commit Graph

52 Commits

Author SHA1 Message Date
AlanCoding
3d433350d3 raise 400 error on removal of credential on launch
Definition of removal is providing a `credentials` list on launch
that lacks a type of credential that the job template has.
This assures that every category of credential the job template
has will also exist on jobs ran from that job template.
This restriction already existed, but this makes the endpoint
fail instead of re-adding the credentials.
This change makes manual launch congruent with saved launch
configurations.
2018-02-15 08:16:03 -05:00
Ryan Petrello
17cd0595d7 fix a bug which broke the callback plugin launch process
see: https://github.com/ansible/awx/issues/980
2018-01-17 11:28:13 -05:00
Ryan Petrello
60743d6ba6 add the vault_id to the response payload on the JT launch endpoint
see: https://github.com/ansible/awx/issues/914
2018-01-04 15:13:48 -05:00
AlanCoding
659d31324d hide survey passwords in saved launch configs 2017-12-12 09:35:46 -05:00
Ryan Petrello
8c90d36290 add some more tests and acceptance docs to wrap up multivault support
see: https://github.com/ansible/awx/issues/352
2017-12-11 16:56:02 -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
Ryan Petrello
eb140d9e69 fix a permissions bug for credentials specified at JT launch time
hat tip to @alancoding for spotting this one
2017-11-14 16:21:05 -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
993fa9290d additional verbosity for vars parsing exceptions 2017-10-13 11:41:11 -04:00
Ryan Petrello
2c2e5cadbf don't require a credential for job launch if vault is specified
see: https://github.com/ansible/ansible-tower/issues/7310
2017-07-26 14:35:06 -04:00
Ryan Petrello
b0f5d2f82d allow Job Templates to launch with *only* a vault credential
see: https://github.com/ansible/ansible-tower/issues/7252
2017-07-24 11:42:35 -04:00
Ryan Petrello
5fde6ead42 properly copy prompted vault passwords on job launch
see: #6924
2017-07-07 13:15:17 -04:00
Ryan Petrello
3c2fe5e6db fix a variety of bugs that break vault pass injection for playbook runs
see: #6924
2017-07-07 12:19:31 -04:00
Chris Meyers
318b1aebd1 remove special scan job logic 2017-07-05 10:32:45 -04:00
Aaron Tan
0dae058bef Set priority rules for find_matching_hosts. 2017-06-15 11:45:44 -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
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
Ryan Petrello
53c3ece32b add prompting for JT.extra_credentials
see: #2913
2017-05-11 07:29:53 -04:00
Aaron Tan
18ba56964f Add prompt for verbosity. 2017-05-04 14:32:08 -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
Ryan Petrello
95ea370e5e add API versioning for /api/v2/ 2017-03-30 15:11:12 -04:00
AlanCoding
99fc0e8264 Use consistent error message when vars are not parsed correctly 2017-03-22 16:37:20 -04:00
Aaron Tan
2e2d88516e Negative functional test added. 2017-03-20 12:21:21 -04:00
Aaron Tan
2edd4b338d Add functional test to gurarantee consistent behavior of provisioning callback with jt launch. 2017-03-17 15:40:55 -04:00
Wayne Witzel III
dee359254f fix functional job runtime params tests 2017-02-06 14:50:51 -05:00
AlanCoding
8cd4ba0175 refactor of create_unified_job in connection with new copy endpoint development 2016-11-22 11:35:41 -05:00
Matthew Jones
cb82809f10 Merge pull request #3935 from jladdjr/at-3532-typo
Minor typo fix (pointing workflow node template at unsupported unified job template)
2016-11-18 15:45:34 -05:00
Aaron Tan
9e4655419e Fix flake8 E302 errors. 2016-11-15 20:59:39 -05:00
Jim Ladd
20840b9867 Fix all instances of can not 2016-11-09 17:03:25 -05:00
AlanCoding
d6c4c12c32 add API test coverage for empty tags and skip_tags 2016-08-02 10:43:51 -04:00
AlanCoding
0271aa611c add field to JT for asking to skip tags 2016-08-01 16:49:34 -04:00
Wayne Witzel III
8f3c0ff884 refactoring survey spec tests and fixtures 2016-06-06 13:39:25 -04:00
AlanCoding
53327dea2b Bug fixes related to survey corner cases and survey test refactor 2016-06-02 08:58:59 -04:00
AlanCoding
cfd9d5d4f1 Refactor of JT related field checking 2016-05-31 14:34:51 -04:00
Alan Rominger
50bb6b8fc3 Merge pull request #1951 from AlanCoding/1949_scan_runtime_bugs
Fix 500 error caused in job launch runtime vars validation
2016-05-18 15:34:58 -04:00
AlanCoding
f6b3da0c46 Make error message grammar more consistent 2016-05-18 13:39:06 -04:00
AlanCoding
f19088db1b fix job_type change 500 error, patch up runtime tests 2016-05-18 09:24:33 -04:00
AlanCoding
44d57bf4c3 update test to new error message 2016-05-04 19:45:23 -04:00
Wayne Witzel III
082ca59812 Fixing missed test from period all the things update 2016-05-04 17:12:51 -04:00
AlanCoding
d5a3951d52 break up test into 2, isolating context 2016-04-27 15:58:16 -04:00
AlanCoding
4af1e0a9bf remove additional resource creation in test context 2016-04-27 15:30:51 -04:00
AlanCoding
a7311a69c9 runtime test fixtures organized better 2016-04-27 14:24:54 -04:00
AlanCoding
271701a968 clean up unused test code 2016-04-27 10:43:03 -04:00
AlanCoding
5dc17cd72f New tests for user launching/relaunching with credential/inventory access 2016-04-27 09:03:38 -04:00
AlanCoding
64fc0c8ecb Mock out job start related stuff in runtime tests 2016-04-21 14:07:39 -04:00
AlanCoding
1a97773aa1 remove more save calls 2016-04-18 14:36:18 -04:00
AlanCoding
5abde762ae updates to prompt-for tests and logic for new RBAC updates 2016-04-18 14:29:30 -04:00
AlanCoding
914918b5ae update permission logic, update job runtime tests 2016-04-13 13:30:06 -04:00
AlanCoding
b0bbeb2ca8 move credential to prompt-for mechanism 2016-04-12 17:09:25 -04:00
AlanCoding
52d8993aa8 update tests to conform to new credential behavior and launch response 2016-04-12 17:09:24 -04:00