Commit Graph
100 Commits
Author SHA1 Message Date
Matthew Jones 5727d722b6 Merge remote-tracking branch 'upstream/release_2.3' into devel
* upstream/release_2.3: (91 commits)
  Include python-{paramiko,ecdsa} dependencies
  Remove extra epel testing stanzas
  Unit test for ec2 credentialless inventory
  Fix issue with ec2 iam sync with no credential.
  Use the htpasswd command instead the ansible module
  Pip is no longer needed
  check local user root or not in ./configure
  Remove unneeded when check for super user addition
  Improve distro detection in setup.sh
  Fix superuser check on upgrade
  Minor improvements to setup.sh
  Remove ansible prerequisite check from configure
  Attempt to install ansible within setup.sh
  Allow munin processes to access postgres
  Move up base package dependency install
  fixes jenkins failures
  Proper flake8 fix
  fixes executing processes with correct PYTHONPATH will pickup .pth files
  Show the repo for bundled package file dump
  Proper flake8 fix
  ...
2015-09-03 15:46:10 -04:00
Matthew Jones 7774b17960 Unit test for ec2 credentialless inventory 2015-09-03 14:05:17 -04:00
Matthew Jones 15005d3e6b Fix issue with ec2 iam sync with no credential.
When checking if an inventory sync can start allow an ec2 sync to run
even if credentials are not supplied
2015-09-03 13:37:38 -04:00
Matthew Jones 5f6f16b5ff Rev version to 2.4.0 2015-09-03 09:44:20 -04:00
Matthew Jones c37716a2e7 Proper flake8 fix 2015-09-01 18:35:12 -04:00
Matthew Jones f0a23b7ed3 Proper flake8 fix 2015-09-01 16:15:39 -04:00
Matthew Jones 4a5111308f Fix flake8 warning from tests 2015-09-01 15:23:35 -04:00
Matthew Jones 09f4c9fbbe Fixed job redaction for projects and unit tests 2015-08-31 16:24:38 -04:00
Matthew Jones bd3faea671 Fix path check in start_development docker script 2015-08-31 15:15:49 -04:00
Matthew Jones 2f39393cf3 Implement fact receiver thread worker
Optionally allow processing of fact receiver messages in a worker
thread.  This works around an issue where data could take a while to
page into Mongo and cross the zmq socket timeout.
2015-08-28 10:59:52 -04:00
Matthew Jones 549809dfa4 Fix chunked stdout display issue
* We removed stdout redaction from jobs and job templates but only for
  the full stdout dump, this extends it to the limited display also
2015-08-25 16:05:03 -04:00
Matthew Jones 896b0e18f3 Merge remote-tracking branch 'chrismeyers/feature-configure_offline' into release_2.3
* chrismeyers/feature-configure_offline:
  configure support inventory file
  retain existing behavior with added --inventory-file param
2015-08-24 14:38:30 -04:00
Matthew Jones 1ead738f96 Updates to offline packager docker environment 2015-08-21 16:40:35 -04:00
Matthew Jones 1471a3bb3e Allow proot's base tmp path to be configurable 2015-08-21 15:28:39 -04:00
Matthew Jones 7080996670 Cleanup stdout dump during 2.2 migration
postgres is adding extra newline/carriage return escapes to the stdout
output.  Here we'll use sed to fix those so they can be read correctly
2015-08-21 13:28:34 -04:00
Matthew Jones 4ce2300d27 Bump version number for 2.3.0 release 2015-08-21 11:55:19 -04:00
Matthew Jones c5ce9cdc12 Fix stdout plaintext render
* Was rendering as json (though text/plain)
* Switched to rendering it as normal text with stripped ansi
* Fixes: https://trello.com/c/TMyOak0H/142-api-v1-jobs-n-stdout-format-txt-emits-json-output
2015-08-21 10:20:57 -04:00
Matthew Jones 230a1f3be5 Merge remote-tracking branch 'upstream/release_2.2.3' into upstream_devel
* upstream/release_2.2.3: (33 commits)
  Bump version to 2.2.3
  Optimize inventory read check for Job Templates
  Updating changelog for 2.2 release
  Bump version to 2.2.2
  Use smart_str instead of .encode on passwords
  Change default sensitive redaction behavior
  Update changelogs for 2.2.1
  Add an error message when running a job and trying to use an OpenSSH formatted key on an older version of OpenSSH.
  Revert "Add sudo: true to the backup playbook"
  Handle Ubuntu 12.04 psutil recursive cancel
  fixed log viewer modal partial
  fixed alignment of download standard out button in modals
  About Tower version number fix
  Pin package version for older release
  add standard out download button to various places in the UI
  Bump 2.2 branch to version 2.2.1
  Don't create a group that is its own parent when an EC2 tag has an empty value.  Fixes https://trello.com/c/2zc0odvX
  Limit max depth when building mapping of group depths to avoid hitting recursion limit.  Fixes https://trello.com/c/2zc0odvX
  Fix .ini web links for v2
  Add support for detecting encrypted openssh format private keys. Fixes https://trello.com/c/ZeVOXN5U
  ...
2015-08-20 11:47:07 -04:00
Matthew Jones a76b1a0432 Merge branch 'release_2.2.3' into stable
* release_2.2.3:
  Bump version to 2.2.3
  Optimize inventory read check for Job Templates
2015-08-20 11:15:48 -04:00
Matthew Jones f66ed43788 Bump version to 2.2.3 2015-08-19 13:26:55 -04:00
Matthew Jones 2bdc79f3ba Optimize inventory read check for Job Templates
Our old check used an extremely inefficient boolean logic AND and
generated a bad query.   This does a simpler check by querying the
inventories that the user has access to and using that as a simple
condition when performing the job template permission query
2015-08-19 13:26:10 -04:00
Matthew Jones 26f942a593 Merge remote-tracking branch 'upstream/release_2.2' into stable
* upstream/release_2.2: (31 commits)
  Updating changelog for 2.2 release
  Bump version to 2.2.2
  Use smart_str instead of .encode on passwords
  Change default sensitive redaction behavior
  Update changelogs for 2.2.1
  Add an error message when running a job and trying to use an OpenSSH formatted key on an older version of OpenSSH.
  Revert "Add sudo: true to the backup playbook"
  Handle Ubuntu 12.04 psutil recursive cancel
  fixed log viewer modal partial
  fixed alignment of download standard out button in modals
  About Tower version number fix
  Pin package version for older release
  add standard out download button to various places in the UI
  Bump 2.2 branch to version 2.2.1
  Don't create a group that is its own parent when an EC2 tag has an empty value.  Fixes https://trello.com/c/2zc0odvX
  Limit max depth when building mapping of group depths to avoid hitting recursion limit.  Fixes https://trello.com/c/2zc0odvX
  Fix .ini web links for v2
  Add support for detecting encrypted openssh format private keys. Fixes https://trello.com/c/ZeVOXN5U
  Fix psutil usage on el6 for job cancel
  Set recursive on child process canceling
  ...
2015-08-19 10:39:54 -04:00
Matthew Jones 35ffb37492 Add cleaning site-packages in the Makefile 2015-08-17 11:33:45 -04:00
Matthew Jones ee8a76f32b Use smart_str instead of .encode on passwords
We originally tried to prune these .encode() calls out of the tree in
favor of smart_str but we must have missed this one.   This allows
migration 0066 to work if utf-8 characters are used in the password
2015-08-13 17:00:46 -04:00
Matthew Jones e221097a37 Use smart_str instead of .encode on passwords
We originally tried to prune these .encode() calls out of the tree in
favor of smart_str but we must have missed this one.   This allows
migration 0066 to work if utf-8 characters are used in the password
2015-08-13 16:55:39 -04:00
Matthew Jones d4dccff20c Change default sensitive redaction behavior
* Only project updates will contain sensitive data redaction logic when
  displaying stdout
2015-08-13 15:48:56 -04:00
Matthew Jones 6c2d6a63e7 Change default sensitive redaction behavior
* Only project updates will contain sensitive data redaction logic when
  displaying stdout
2015-08-13 15:48:16 -04:00
Matthew Jones 4968848958 Merge pull request #371 from cchurch/openssh_key_check
Add error message when OpenSSH private keys aren't supported
2015-08-11 16:53:08 -04:00
Matthew Jones 21acaa999d Handle Ubuntu 12.04 psutil recursive cancel
Ubuntu has a crazy old version of psutil, we'll fall back to sigkill for
that platform
2015-08-11 10:32:29 -04:00
Matthew Jones 9aa89e08d9 Handle Ubuntu 12.04 psutil recursive cancel
Ubuntu has a crazy old version of psutil, we'll fall back to sigkill for
that platform
2015-08-11 10:24:54 -04:00
Matthew Jones 43d873acab Fix path check in start_development docker script 2015-08-10 14:36:39 -04:00
Matthew Jones e5bd721b4b Add cleaning site-packages in the Makefile 2015-08-10 11:02:51 -04:00
Matthew Jones a992881b17 Install honcho in the docker development container 2015-08-10 11:00:27 -04:00
Matthew Jones 5969c6a380 Check for site-packages and if it doesn't exist symlink to the built directory 2015-08-10 10:24:29 -04:00
Matthew Jones 7484267186 Bump 2.2 branch to version 2.2.1 2015-08-07 11:19:09 -04:00
Matthew Jones 1e95ac1c54 Merge pull request #361 from cchurch/recursive_inventory
Fix inventory issues when a group is its own parent
2015-08-06 21:30:45 -04:00
Matthew Jones 3b96c3ca52 Fix psutil usage on el6 for job cancel
psutil will fail to import on el6 due to not being able to access a
pseudo terminal.  This issues a SIGKILL to the proot process in order to
force the stop
2015-08-05 22:01:44 -04:00
Matthew Jones 31b8491d53 Set recursive on child process canceling
Sometimes ansible spawns many subprocesses that can get orphaned and
stuck if we only kill the direct descendent child processes
2015-08-05 22:00:27 -04:00
Matthew Jones 57778eb429 mock stdout unit test patch failure fix
Adjust some mock.patch behavior to match the new stdout behavior where
we need to check a file's size as well as its existence
2015-08-05 21:55:02 -04:00
Matthew Jones b1c12ca120 Fix empty standard out behavior
Previously we could just check for the absence of the stdout file to
know we didn't yet/wouldn't ever have any stdout content.  Now that we
are creating the stdout file ahead of time and persisting it we need to
also check to see if the file contains any data.   This is also
necessary for some unit tests.
2015-08-05 21:54:23 -04:00
Matthew Jones dc0d732ad4 Fix merge issues on stdout branch
The act of committing a PR that including part of these changes and then
reverting it meant that some of the changes from the original branch
didn't land in this new PR.   This commit adds the missing bits.

Lesson learned:  Create a new branch when submitting a PR on a
previously reverted PR
2015-08-05 21:53:46 -04:00
Matthew Jones c0ea174e93 Rework stdout display for file storage only
* Cleanup old code related to stdout download using temporary files
* Remove copy-into-database code
* Modify stdout download code to reference stdout file
2015-08-05 21:52:47 -04:00
Matthew Jones f20d93a274 Merge pull request #358 from cchurch/openssh_private_key_support
Support private keys in OpenSSH format
2015-08-05 19:44:56 -04:00
Matthew Jones a7ae1d8348 Merge pull request #359 from chrismeyersfsu/requirements.txt3
all vendor dependencies expressed in requirements.txt
2015-08-05 19:44:16 -04:00
Matthew Jones 64c3b1ec69 Merge pull request #345 from chrismeyersfsu/fix-centos_6.5
unittest works on centos 6.5
2015-08-05 19:43:57 -04:00
Matthew Jones 91bd96f458 Merge pull request #360 from matburt/fix_el6_job_cancel
Fix overall job cancel behavior
2015-08-05 19:39:11 -04:00
Matthew Jones ab042c269b Set recursive on child process canceling
Sometimes ansible spawns many subprocesses that can get orphaned and
stuck if we only kill the direct descendent child processes
2015-08-05 11:44:50 -04:00
Matthew Jones efcff9b5f7 Fix psutil usage on el6 for job cancel
psutil will fail to import on el6 due to not being able to access a
pseudo terminal.  This issues a SIGKILL to the proot process in order to
force the stop
2015-08-05 11:20:48 -04:00
Matthew Jones 14df41b47b mock stdout unit test patch failure fix
Adjust some mock.patch behavior to match the new stdout behavior where
we need to check a file's size as well as its existence
2015-08-05 10:02:07 -04:00
Matthew Jones 7e45ee8b55 Fix empty standard out behavior
Previously we could just check for the absence of the stdout file to
know we didn't yet/wouldn't ever have any stdout content.  Now that we
are creating the stdout file ahead of time and persisting it we need to
also check to see if the file contains any data.   This is also
necessary for some unit tests.
2015-08-04 14:25:05 -04:00
Matthew Jones c231601b76 Fix merge issues on stdout branch
The act of committing a PR that including part of these changes and then
reverting it meant that some of the changes from the original branch
didn't land in this new PR.   This commit adds the missing bits.

Lesson learned:  Create a new branch when submitting a PR on a
previously reverted PR
2015-08-04 09:57:39 -04:00
Matthew Jones bddcb06fab Merge branch 'stdout_file_download' into upstream_master
* stdout_file_download:
  Rework stdout display for file storage only
2015-08-03 15:30:17 -04:00
Matthew Jones 1c777c5441 Rework stdout display for file storage only
* Cleanup old code related to stdout download using temporary files
* Remove copy-into-database code
* Modify stdout download code to reference stdout file
2015-08-03 15:14:51 -04:00
Matthew Jones 2f05ac7276 Merge pull request #349 from matburt/master
Optimize inventory read check for Job Templates
2015-08-03 09:57:51 -04:00
Matthew Jones 47a3e69636 Optimize inventory read check for Job Templates
Our old check used an extremely inefficient boolean logic AND and
generated a bad query.   This does a simpler check by querying the
inventories that the user has access to and using that as a simple
condition when performing the job template permission query
2015-07-31 00:06:12 -04:00
Matthew Jones ef443ec8b2 Add psutil dependency to the docker dev container 2015-07-28 13:30:59 -04:00
Matthew Jones e9370d0199 Merge pull request #326 from matburt/fix_cancel_behavior_in_proot
Fix proot job cancel behavior
2015-07-27 20:49:59 -04:00
Matthew Jones 4f73ba9e3e Merge pull request #329 from ansible/revert-320-stdout_file_download
Revert "Improve stdout behavior by implementing a downloadable stdout."
2015-07-24 14:54:36 -04:00
Matthew Jones 5df23b95f6 Revert "Improve stdout behavior by implementing a downloadable stdout." 2015-07-24 14:54:13 -04:00
Matthew Jones e5776dd22d Merge pull request #320 from matburt/stdout_file_download
Improve stdout behavior by implementing a downloadable stdout.
2015-07-24 12:28:17 -04:00
Matthew Jones 28759e9f20 Use psutil to find the right job to TERM
* When using proot use psutil to find the ansible child process and
  issue the SIGTERM to instead of the proot process
2015-07-24 12:06:02 -04:00
Matthew Jones 3041fce503 Allow settings access from api templates 2015-07-23 12:07:34 -04:00
Matthew Jones 88128a2e87 Return useful errors when downloading stdout 2015-07-22 16:35:03 -04:00
Matthew Jones d9f5dee773 Change default stdout temp directory
* Use /var/lib/awx on production configurations
* Use /tmp for development configurations
2015-07-22 16:31:43 -04:00
Matthew Jones 2a6600fb42 Update unified job stdout help text 2015-07-22 15:28:25 -04:00
Matthew Jones 7937b4fbbd Implement a stdout tmp cleanup task
* Cleans up stdout tempfiles generated for download
* Runs every 3 hours, cleans up files older than 1 day
2015-07-22 15:24:52 -04:00
Matthew Jones b1b49ba286 Efficient stdout downloader implementation
* Temporarily dump stdout contents to a configurable temp location
* Implement file streaming to the host via a new format specifier in the
  api view
2015-07-22 15:08:37 -04:00
Matthew Jones 55da712a95 Protect against very large stdout fields
* Defer loading result_stdout_text until specifically needed
* Conditionally display it based on the size of the field
* Provide a helpful message otherwise
2015-07-22 14:13:48 -04:00
Matthew Jones 0ff280a363 Initial support for downloading stdout 2015-07-22 12:36:38 -04:00
Matthew Jones e38e2106ef Rev master to 2.3.0 2015-07-15 14:42:56 -04:00
Matthew Jones ac0984b2d8 Rev branch to 2.2.1 2015-07-15 14:41:36 -04:00
Matthew Jones 7fd4613523 Remove uses_mongo redirection from service script 2015-07-13 15:44:58 -04:00
Matthew Jones 9a4b19bd11 Update start/stop service script ordering
Mongo needs to be last when starting and first when stopping if enabled
2015-07-13 14:05:22 -04:00
Matthew Jones 08ec0c132e Merge pull request #306 from matburt/fix_restore_playbook
Fix the restore playbook procedure
2015-07-09 16:17:17 -04:00
Matthew Jones 874c97f748 Purge some unneeded HA unit tests 2015-07-08 14:31:02 -04:00
Matthew Jones 5605ec9754 Adjust usage of is_ha_environment()
Limit it to just instance count and make sure we use it for the mongo check
2015-07-08 14:18:04 -04:00
Matthew Jones d5e948890c Stricter control of mongo in setup playbook
Detect if this is an HA setup and if so we won't attempt to start mongo
during the setup process
2015-07-08 13:45:59 -04:00
Matthew Jones 9e6c604fc1 Remove extra output from doing a hard mongo shutdown. 2015-07-06 14:38:19 -04:00
Matthew Jones 4fd0fbda08 Invert the conditional checking for whether or not mongo is running 2015-07-06 14:28:27 -04:00
Matthew Jones 26af43dab6 Remove superflous sleep when shutting mongo down 2015-07-06 14:19:12 -04:00
Matthew Jones 9b03d22d75 Fixes to conditionally invoking mongo shutdown
* Make sure we are waiting on the service script
* Improve sudo configuration
* Check pidof before attempting to invoke a hard mongo shutdown
2015-07-06 14:15:41 -04:00
Matthew Jones 10f5308bd8 Fix version parsing of ansible to exclude newlines 2015-07-06 12:16:17 -04:00
Matthew Jones 5a77d1f0d4 Fix up mongo service handline and task logging
* Use -f instead of -c for mongod when refernecing config file
  for shutdown behavior in the stop task
* Fix up task logging to use new supervisor configuration syntax
2015-07-06 11:49:24 -04:00
Matthew Jones cd41d99843 Merge pull request #298 from matburt/fix_ha_setup_logic
Fix ha setup logic
2015-06-26 16:16:07 -04:00
Matthew Jones 414394afa0 can not -> cannot (even though they are both correct) 2015-06-26 15:35:33 -04:00
Matthew Jones 05f56c805a Logic should check for the condition where HA is NOT enabled 2015-06-26 15:28:41 -04:00
Matthew Jones 80a6f22c0c Move HA license check logic to the promotion step and allow registering
HA instances.   Registration is allowed but promotion/demotion is not
allowed without the HA feature
2015-06-26 15:23:07 -04:00
Matthew Jones 237a661912 Fix verbage around why we are disallowing removing a primary 2015-06-26 15:22:35 -04:00
Matthew Jones 97bfa32b44 Merge pull request #296 from matburt/extricate_service_script_playbooks
Extricate service script playbooks
2015-06-25 13:29:23 -04:00
Matthew Jones 4d84a603ad Add missing fact receiver logfile in production settings 2015-06-24 11:05:19 -04:00
Matthew Jones b45ea4f1f4 Force shutdown of mongo after requesting a service stop. Just in case. 2015-06-23 12:32:43 -04:00
Matthew Jones d01e93535d Fixing flake8 issue 2015-06-15 09:36:04 -04:00
Matthew Jones bb7af4e916 Merge pull request #277 from matburt/fix_inventory_read_jt_rbac
Check inventory access for normal users when deciding what job templates show up in the queryset
2015-06-12 16:04:34 -04:00
Matthew Jones 5d1b27e520 Adding some job template listing unit tests and permissions to actually
make those work
2015-06-12 14:43:24 -04:00
Matthew Jones df61fd6ab8 Check inventory access for normal users when deciding what job templates
show up in the job template queryset
2015-06-11 16:24:54 -04:00
Matthew Jones d011a87bb0 Support cancel on system jobs 2015-06-11 15:19:27 -04:00
Matthew Jones f945719794 Fix a few more copyright statements 2015-06-11 14:53:25 -04:00
Matthew Jones bcc18aa689 Make using named pipe for adding passwords conditional on the version
of ssh used.
2015-06-11 14:48:10 -04:00
Matthew Jones 322fdc37a4 Remove some spurious print statements I left previously 2015-06-11 14:48:09 -04:00
Matthew Jones f9ca5159e7 Fix up more copyright headers 2015-06-10 16:11:26 -04:00