Commit Graph

547 Commits

Author SHA1 Message Date
Ryan Petrello
de84f3cf4a fix a bug in cluster node version comparison 2017-06-30 11:28:04 -04:00
Aaron Tan
d9d5fb38b8 Merge pull request #6732 from jangsutsr/6719_aggregate_service_restart_attempts
Aggregate Tower service restart attempts
2017-06-29 12:13:01 -04:00
Wayne Witzel III
e9235d8b54 update delete_inventory task 2017-06-29 00:15:56 -04:00
Aaron Tan
92f5025817 Aggregate Tower service restart attempts. 2017-06-28 16:49:36 -04:00
Ryan Petrello
bd3bfbe1d1 Merge pull request #6640 from ryanpetrello/remove_use_venv
remove ANSIBLE_USE_VENV and TOWER_USE_VENV
2017-06-28 10:22:09 -04:00
AlanCoding
cf751568b5 use atomic transaction to delete inventory in task 2017-06-26 10:46:58 -04:00
AlanCoding
9e07b3f777 Tag jobs started via special cases with node & group 2017-06-22 16:24:12 -04:00
Ryan Petrello
14addae813 delete inventories in the background via a celery task
see: #4382
see: #6279
2017-06-22 14:32:33 -04:00
Alan Rominger
20f0a83bec Merge pull request #6682 from AlanCoding/isolated_execution
Have execution_node reflect isolated instance
2017-06-22 10:12:21 -04:00
Chris Meyers
fee16fe391 Merge pull request #6588 from chrismeyersfsu/feature-fact_cache
initial tower fact cache implementation
2017-06-22 09:58:28 -04:00
Ryan Petrello
45bdd9f747 improve readability of the honcho console logs in the dev environment
* colorize uwsgi and celery logs; DEBUG lines are green, WARN lines
  are yellow, ERROR lines (and tracebacks) are red
* pretty-print fact callback receiver JSON
* simplify the uwsgi log format so it's more legible
2017-06-22 09:19:32 -04:00
AlanCoding
ea51c03c83 have execution_node reflect isolated instance 2017-06-22 08:57:07 -04:00
Chris Meyers
d679dc7407 do not inject facts for isolated node runs 2017-06-21 13:45:28 -04:00
Chris Meyers
6c67834694 beautify code 2017-06-21 13:45:28 -04:00
Chris Meyers
965159a1fb rename store_facts to use_fact_cache 2017-06-21 13:45:27 -04:00
Chris Meyers
817dbe8d33 add fact modified time 2017-06-21 13:45:27 -04:00
Chris Meyers
626e2d1c9b tower fact cache implementation
* Tower now injects facts into jobs via memcached for use by Ansible
playbooks. On the Ansible side, this is accomplished by the existing
mechanism, an Ansible Fact Cache Plugin + memcached. On the Tower side,
memcached is leveraged heavily.
2017-06-21 13:44:08 -04:00
AlanCoding
40287d8e78 multi-host isolated heartbeat w tower-isolated check
* use tower-expect command to determine job status when running
  the isolated heartbeat playbook
* grok JSON output of playbook to obtain result information
* run playbook against multiple isolated hosts at the same time
  (addresses scalability concerns)
2017-06-20 14:36:18 -04:00
Ryan Petrello
2e608f4eac remove ANSIBLE_USE_VENV and TOWER_USE_VENV
modern Tower deployments (both production and dev container-based)
always build ansible and Tower in separate, distinct virtualenvs, not
the global site-packages
2017-06-19 16:11:15 -04:00
AlanCoding
f371dd71b2 Run isolated heartbeat against all hosts at once
Previously we were running the playbook on a host-by-host
basis, but this changes it to pass in the list of all
isolated isntances the machine is responsible for.
Using the `json` Ansible stdout module, we are able to
parse the output for information on each host.
2017-06-19 12:13:36 -04:00
AlanCoding
dd1a261bc3 setup playbook and heartbeat for isolated deployments
* Allow isolated_group_ use in setup playbook
* Tweaks to host/queue registration commands complementing setup
* Create isolated heartbeat task and check capacity
* Add content about isolated instances to acceptance docs
2017-06-19 12:13:36 -04:00
Ryan Petrello
422950f45d Support for executing job and adhoc commands on isolated Tower nodes (#6524) 2017-06-14 11:47:30 -04:00
Alan Rominger
c0923729e2 Merge pull request #6386 from ansible/AlanCoding-patch-1
root folder re-creation on project sync
2017-06-13 12:10:35 -04:00
Alan Rominger
f0ca47b4fd root folder re-creation on project sync 2017-06-12 09:51:08 -04:00
Chris Meyers
2d05ffc90e Merge pull request #6382 from chrismeyersfsu/fix-4514
support vmware via source_vars
2017-06-08 13:27:28 -04:00
Chris Meyers
3dc329bb0f copy paste fix 2017-06-07 15:04:44 -04:00
Chris Meyers
ba5f553f0c fix up scm inventory updates
* implicit project updates inherit inv update instance group
* added needed settings for SCM group filter and others
2017-06-07 14:51:56 -04:00
Chris Meyers
0c034f29af use insights etag as a cache
* During insights project updates, if the etag from insights matches the
last etag (scm_revision) then don't get all the maintenance playbooks.
Otherwise, get all the maintenance playbooks and update scm_revision
with the etag.
2017-05-30 18:30:13 -04:00
Chris Meyers
8b97db06b0 abuse group_by and instance_filters 2017-05-30 18:29:02 -04:00
Chris Meyers
9ede92a426 Revert "support vmware via source_vars"
This reverts commit cc64104f4bad6c360dcbd2f0291006956180a416.
2017-05-30 16:16:12 -04:00
Chris Meyers
f7f4560de1 support vmware via source_vars
* support vmware host_filters and groupby_patterns by just doing nothing
2017-05-30 15:58:30 -04:00
Wayne Witzel III
e28cd97ffb Add smart_inventories endpoint to Host 2017-05-26 10:16:12 -04:00
Bill Nottingham
e93a61ac53 Allow setting the enabled/disabled flag for more than just cloud inventory sources.
Leverage the same _ENABLED_VAR (and other) variables that exist for cloud sources, and set some defaults for custom scripts.
2017-05-25 16:51:09 -04:00
Ryan Petrello
5a34f3a1a4 remove a hook QE no longer uses for testing task execution 2017-05-18 15:59:36 -04:00
Matthew Jones
cf7fb8ddd7 Fix system jobs not starting due to task manager and cred changes
* Task Manager logic wasn't assigning default instance group on system
  jobs
* Task credential changes assumed the model would have a credential
* Fix up an innocuous error symlinking rdb.py if it already exists
2017-05-18 13:10:48 -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
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
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
Alan Rominger
2b15d04096 Merge pull request #6218 from AlanCoding/scm_inv_cancel
SCM inventory cancel propagation
2017-05-10 15:52:31 -04:00
AlanCoding
fc590535be update inventory file list on every project update 2017-05-10 15:34:31 -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
Matthew Jones
4ced911c00 Implementing models for instance groups, updating task manager
* New InstanceGroup model and associative relationship with Instances
* Associative instances between Organizations, Inventory, and Job
  Templates and InstanceGroups
* Migrations for adding fields and tables for Instance Groups
* Adding activity stream reference for instance groups
* Task Manager Refactoring:
** Simplifying task manager relationships and move away from the
   interstitial hash tables
** Simplify dependency determination logic
** Reduce task manager runtime complexity by removing the partial
   references and moving the logic into the task manager directly or
   relying on Job model logic for determinism
2017-05-10 12:32:54 -04:00
AlanCoding
04d6fb1f95 SCM inventory cancel propagation
For manually initiated inventory updates, also cancel the source
project of "sync" type, like jobs do

For automatic inventory updates spawned from source project update,
of launch type "scm", handle contigency cases
2017-05-10 10:28:49 -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
Alan Rominger
f954507a8c Merge pull request #6186 from AlanCoding/scm_inv_stability
SCM Inventory task system and variables stability edits
2017-05-08 14:31:58 -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
AlanCoding
890b5bba58 SCM Inventory task system and variables stability edits
* Ensure "fresh bits" in dependent jobs
  - run IUs in same context and dependent PU
  - review docs for update-on-launch expectations
* Avoid customer variable precedence upgrade issues
  - only allow SCM types to have overwrite_vars=true
  - do not run other cloud sources through the backported script
* Make extra sure to echo stdout and stderr in event of error
2017-05-08 09:43:11 -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
35ae13f498 fully link up source_project_update to inventory update 2017-05-04 11:08:05 -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