827 Commits

Author SHA1 Message Date
Chris Meyers
9ba0ba07ec nest insights api response data 2017-05-22 10:11:31 -04:00
Chris Meyers
fb53ca8455 insights proxy
* Issue request to Red Hat Insights API from Tower
/hosts/<id>/insights endpoint. User the first found Satellite 6
Credential as Basic Auth requests to Insights API.
2017-05-22 10:11:31 -04:00
Wayne Witzel III
d652ed16d0 Dynamic -> Smart Inventory 2017-05-17 16:25:40 -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
Chris Meyers
45d609e6a9 Merge pull request #6251 from chrismeyersfsu/fix-6235
boolean logic performed on filter results
2017-05-12 15:34:39 -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
81611b44f6 Fix an incorrect reference on instance group jobs list 2017-05-12 12:12:29 -04:00
Chris Meyers
b55af095ef boolean logic performed on filter results
* Before, the boolean logic operators were performed against the Q()
objects, iteratively. Now, boolean logic is done after
Host.objects.filter(Q()). This results in the wanted and expected
results.
2017-05-12 09:26:11 -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
Wayne Witzel III
54876e71e7 Added tests for post conditional logic 2017-05-11 15:31:39 -04:00
Alan Rominger
bdde87f7f5 Merge pull request #6245 from AlanCoding/alan_rockin_ramparts
Introduce view to allow associations but no creations
2017-05-11 14:10:21 -04:00
Wayne Witzel III
aff084e1f6 Update permissions/RBAC for updates 2017-05-11 14:01:32 -04:00
Matthew Jones
47f4e5358b View Fixes for instance groups
* Return "instance_groups" instead of "rampart_groups" on the ping
  endpoint
* Don't pre-filter IG jobs endpoints for status
2017-05-11 13:55:31 -04:00
AlanCoding
14b5ab984b new view to allow associations but no creations 2017-05-11 13:11:11 -04:00
Wayne Witzel III
0e816a2d98 Create /inventories/N/update_inventory_sources endpoint 2017-05-11 13:05:49 -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
44c1935590 Merge pull request #6232 from ryanpetrello/jt_promptable_extra_creds
add prompting for JT.extra_credentials
2017-05-11 07:51:36 -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
Aaron Tan
3099fd7a01 Merge pull request #6117 from jangsutsr/dynamic_inv_src_dependency_update
Dependency updates
2017-05-10 09:57:58 -04:00
Ryan Petrello
9a6dc4d0ef add a view for /api/v2/credential_types/N/activity_stream/ 2017-05-09 15:01:04 -04:00
Ryan Petrello
2feb7d5a69 add a new read-only view for /api/v2/credential_types/N/credentials/ 2017-05-08 17:11:09 -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
Aaron Tan
cfb633e8a6 Dependency Updates
* Dynamic Inventory Source
Template against ansible 2.3 dynamic inventory sources.
The major change is removal of `rax.py`. Most upstream scripts except
`foreman.py` has quite trivial coding style changes, or minor functional
extensions  that does not affect Tower inventory update runs.
`foreman.py`, on the other hand, went through quite a major refactoring,
but functionalities stay the same.

Major python dependency updates include apache-libcloud (1.3.0 -->
2.0.0), boto (2.45.0 --> 2.46.1) and shade (1.19.0 --> 1.20.0). Minor
python dependency updates include indirect updates via `pip-compile`,
which are determined by base dependencies.

Some minor `task.py` extensions:
 - `.ini` file for ec2 has one more field `stack_filter=False`, which
   reveals changes in `ec2.py`.
 - `.ini` file for cloudforms will catch these four options from
   `source_vars_dict` of inventory update: `'version', 'purge_actions',
   'clean_group_keys', 'nest_tags'`. These four options have always been
   available in `cloudforms.py` but `cloudforms.ini.example` has not
   mentioned them until the latest version. For consistency with upstream
   docs, we should make these fields available for tower user to customize.
 - YAML file of openstack will catch ansible options `use_hostnames`,
   `expand_hostvars` and `fail_on_errors` from `source_vars_dict` of
   inventory update as a response to issue #6075.

* Remove Rackspace support
Supports of Rackspace as both a dynamic inventory source and a cloud
credential are fully removed. Data migrations have been added to support
arbitrary credential types feature and delete rackspace inventory
sources.

Note also requirement `jsonschema` has been moved from
`requirements.txt` to `requirements.in` as a primary dependency to
reflect it's usage in `/main/fields.py`.

Connected issue: #6080.

* `pexpect` major update
`pexpect` stands at the very core of our task system and underwent a
major update from 3.1 to 4.2.1. Although verified during devel, please
still be mindful of any suspicious issues on celery side even after this
PR gets merged.

* Miscellaneous
 - requests now explicitly declared in `requirements.in` at version 2.11.1
   in response to upstream issue
 - celery: 3.1.17 -> 3.1.25
 - django-extensions: 1.7.4 -> 1.7.8
 - django-polymorphic: 0.7.2 -> 1.2
 - django-split-settings: 0.2.2 -> 0.2.5
 - django-taggit: 0.21.3 -> 0.22.1
 - irc: 15.0.4 -> 15.1.1
 - pygerduty: 0.35.1 -> 0.35.2
 - pyOpenSSL: 16.2.0 -> 17.0.0
 - python-saml: 2.2.0 -> 2.2.1
 - redbaron: 0.6.2 -> 0.6.3
 - slackclient: 1.0.2 -> 1.0.5
 - tacacs_plus: 0.1 -> 0.2
 - xmltodict: 0.10.2 -> 0.11.0
 - pip: 8.1.2 -> 9.0.1
 - setuptools: 23.0.0 -> 35.0.2
 - (requirements_ansible.in only)kombu: 3.0.35 -> 3.0.37
2017-05-08 12:03:02 -04:00
Ryan Petrello
f3591b81a7 more multicredential JobTemplate changes
* allow for filtering Jobs and JobTemplates by v1 `cloud_credential` and
 `network_credential` fields
* properly validate uniqueness of `extra_credentials` types

see: #5807
2017-05-04 16:18:48 -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
Ryan Petrello
d0a848d49a Add a new extra_credentials endpoint for Jobs and JobTemplates
additionally, add backwards compatible support for `cloud_credential`
and `network_credential` in /api/v1/job_templates/ and /api/v1/jobs/.

see: #5807
2017-05-03 13:38:10 -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
AlanCoding
8d2598beee allow management of 2 types of SCM inventory sources 2017-05-03 12:18:08 -04:00
Alan Rominger
84b8dcece0 Merge pull request #6120 from AlanCoding/ansible-inventory
Inventory updates through `ansible-inventory`
2017-05-02 16:19:58 -04:00
Wayne Witzel III
af35838aff Make kind read-only for PUT/PATCH, use isinstance in Host Manager, update field fasly check 2017-05-02 13:00:17 -04:00
AlanCoding
2f62182940 refactor inventory Loaders for ansible-inventory
* remove support for loading from executable and static files
* instead use ansible-inventory with fallback to backport
* provide private file dir in task manager for cred injection
* durable management of tmp dirs for user scripts

* new 'scm' source choice for scm-type
* update SCM inventory docs to new reality
2017-05-01 14:37:43 -04:00
Wayne Witzel III
1750e5bd2a Refactor Host manager and dynamic Inventory tests and update
validation/serialization
2017-05-01 13:06:49 -04:00
Wayne Witzel III
17e9b3057e Clean-up intiail commit for Host filter / DynamicInventory 2017-05-01 12:55:42 -04:00
Matthew Jones
e1e83598e9 Merge branch 'release_3.1.3' into devel
* release_3.1.3: (52 commits)
  ack fact scan messages
  making ldap user/group search fields into codemirror instances
  removing UI parsing for LDAP User and Group Search fields
  Allow exception view to accept all valid HTTP methods.
  Restore ability of parsing extra_vars string for provisioning callback.
  Fix up backup/restore role broken in f7a8e45809758322d9ee41c5305850dd70ed5faf
  Stop / start ansible-tower-service during restores
  value_to_python should encode lookup fields as ascii
  fix brace interpolation on standard out pane
  Adjust some hardcoded usages of 'awx' to use 'aw_user' and 'aw_group'.
  Pull Spanish updates from Zanata
  Temporarily grant awx user createdb role
  Stop giving ownership of backups to postgres
  don't display chunked lines'
  Add dropdown li truncation with ellipsis
  CTiT -> adhoc modules should allow the user to add new modules
  Remove task that was replacing the supervisor systemd tmp file
  Fix failing supervisorctl commands on RH-based distros
  Give ownership of the supervisor socket to awx
  Setting for external log emissions cert verification
  ...
2017-04-28 13:57:04 -04:00
Aaron Tan
0dc6bbe5a0 Prevent workflow resources from returning 402 with basic license. 2017-04-27 16:50:16 -04:00
Ryan Petrello
7037daa799 Merge pull request #6096 from ryanpetrello/api_new_in_v2
refactor API v2 version detection
2017-04-25 10:48:00 -04:00
Ryan Petrello
f0f859f553 Merge pull request #6088 from ryanpetrello/v1_custom_credentials
for /api/v1/ requests, filter out v2 (custom) credentials
2017-04-25 10:30:02 -04:00
Ryan Petrello
80df1523b0 refactor API v2 version detection and feature inclusion 2017-04-25 09:35:03 -04:00
Alan Rominger
34b697ce17 Fix 500 error in ProjectScmInventorySources 2017-04-24 16:54:17 -04:00
Ryan Petrello
83dc4f6757 for /api/v1/ requests, filter out v2 (custom) credentials
see: #5877
2017-04-24 15:21:30 -04:00
Ryan Petrello
7e64a6fd60 add "added_in_api_version" metadata to OPTIONS requests 2017-04-21 15:42:27 -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
Chris Meyers
a64f8a7660 Merge pull request #6045 from chrismeyersfsu/fix-hosts_list
return count, results, next, prev
2017-04-18 09:08:05 -04:00
Chris Meyers
70a8ccef0f return count, results, next, prev
* This returns /api/vx/hosts/ to having all the nice response items like
count, results, next, prev. I had "chopped" that off by explicitly only
returning result.
2017-04-17 16:43:29 -04:00
AlanCoding
6d92c56da5 SCM Inventory model, view, and task system changes
Inventory source file-type combined with a linked project
will allow the inventory source to be updated when the
project is updated. The inventory update runs in the
post-run hook of the project update.
2017-04-17 15:01:19 -04:00