Commit Graph

55 Commits (2cb24987e10c7198bfb956cf5f59d898cd77d688)

Author SHA1 Message Date
Brian Coca 5940d3d45b fixes to vault/copy
rm _del_ as it might leak memory
renamed to tmp file cleanup
added exception handling when traversing file list, even if one fails try rest
added cleanup to finally to ensure removal in most cases
2016-04-14 14:12:48 -04:00
Jonathon Klobucar 7bee994e1c Fix for serial when percent amount is less than one host (#15396)
Ansible when there was a percentage that was calculated to be less than
1.0 would run all hosts as the value for a rolling update.

The error is due to the fact that Python will round a
float that is under 1.0 to 0, which will trigger the case of
0 hosts. The 0 host case tells ansible to run all hosts.

The fix will see if the percentage calculation after int
conversion is 0 and will else to 1 host.
2016-04-13 10:49:38 -04:00
Brian Coca 5b11494437 python3 compatiblity
remove use of basestring
deal with configparser
2016-03-24 06:39:21 -07:00
Toshio Kuratomi ef8bec18bf Use a unicode format string so that we don't convert to byte strings
Fixes #14349
2016-02-26 10:29:37 -08:00
Brian Coca 38120c1075 termination handling
- moved to base cli class to handle centrally and duplicate less code
- now avoids duplication and reiteration of signal handler by reassigning it
- left note on how to do non-graceful in case we add in future
  as I won't remember everything i did here and don't want to 'relearn' it.
2016-02-10 15:35:30 -05:00
Brian Coca d9dcb2a427 Revert "centralized TERM signal handling"
This reverts commit 5a88478ccc.
is WIP, not ready for use yet
2016-02-10 09:48:42 -05:00
Brian Coca 5a88478ccc centralized TERM signal handling 2016-02-09 18:21:33 -05:00
Brian Coca 1b8dec9c88 avoid termination message when term is internal 2016-02-09 18:10:36 -05:00
Brian Coca 5a1887cc76 correctly handle term signals
- adhoc now terminates gracefully
- avoid race condition on terminations by ignoring errors if
  worker might have been reaped between checking if active and termination call
- ansible-playbook now properly exits on sigint/term
- adhoc and playbook now give exceptions that we should not normally capture
  and rely on top level finally to reap children
- handle systemexit breaks in workers
- added debug to see at which frame we exit
partial fix for #14346
2016-02-08 09:51:16 -05:00
James Cammarata a61e51efb7 Don't try to generate retry files if the tqm hasn't been initialized
Fixes #14144
2016-01-27 09:56:50 -05:00
James Cammarata 3ed3a5f43a Make retry file generation not use StringIO 2016-01-26 14:52:41 -05:00
James Cammarata 78d499140c Re-implementing the retry file feature for 2.0
Fixes #13944
2016-01-26 14:11:28 -05:00
James Cammarata 1825b4a9c7 Fix any_errors_fatal incorrect implementation in 2.0
Also adds that flag to blocks.

Fixes #13744
2016-01-15 13:15:10 -05:00
Toshio Kuratomi 8068f23bad do_encrypt import needed to move as well
Fixes #13861
2016-01-13 13:08:33 -08:00
Brian Coca a196c7d737 only send event if tqm exists
fixes #13843
2016-01-13 10:18:36 -05:00
Brian Coca 1cc5ac06e7 restructure vars_prompt and fix regression
pushed it to use the existing propmpt from display and moved the vars prompt code there also for uniformity
changed vars_prompt to check extra vars vs the empty play.vars to restore 1.9 behaviour
sipmlified the code as it didn't need to check for syntax again (tqm is made none prior based on that)
fixes #13770
2016-01-08 11:46:04 -05:00
Matt Martz 384b2e0234 Get v2_playbook_on_start working
* Move self._tqm.load_callbacks() earlier to ensure that v2_on_playbook_start can fire
* Pass the playbook instance to v2_on_playbook_start
* Add a _file_name instance attribute to the playbook
2015-12-02 11:29:51 -06:00
James Cammarata 6671d78f95 Tweak location of stats callback execution and properly relocate stats output code 2015-11-28 14:03:21 -05:00
James Cammarata 800811a15f Trigger on_stats just once, not once for each play
Fixes #13271
2015-11-28 13:37:43 -05:00
Brian Coca fa358d9d61 avoids prompting for vars during syntax check
fixes #13319
2015-11-27 11:41:00 -08:00
Toshio Kuratomi 62979efa14 Finish up plugin porting to global display
Also remove display = display which does nothing
2015-11-11 10:44:23 -08:00
Toshio Kuratomi 318bfbb207 Migrate cli and dependencies to use global display 2015-11-11 10:44:22 -08:00
James Cammarata 86de1429e5 Cleaning up FIXMEs 2015-10-22 16:03:50 -04:00
James Cammarata a88c59f451 Reset basedir for plays that are not from a PlaybookInclude
Fixes #12524 (again)
2015-10-17 12:44:28 -04:00
Toshio Kuratomi baa309309d Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 2015-10-16 08:21:28 -07:00
Marius Gedminas 4fb6f62f1b Fix Unexpected Exception: global name 'os' is not defined
I inadvertently introduced it in
ca826508d9 and didn't notice, because
there are no unit tests for playbook_executor.py.  Sorry!

(The "from ansible.errors import *" was used *only* to get the 'os'
module, which makes go "what?")
2015-10-15 10:41:00 +03:00
Marius Gedminas 9ba6c087d3 Python 3: there's no basestring 2015-10-13 09:56:12 +03:00
James Cammarata 82e76e42e5 Tweak to the way serial percentages are handled 2015-10-12 09:00:43 -04:00
Toshio Kuratomi 01ba2e94c0 Wait until later to convert to byte strings for output
Also some pre-emptive python3 compat and a code simplification
2015-10-08 08:22:17 -07:00
Brian Coca 76feba00c4 avoid callbacks during syntax check and listing
fixes #12682
2015-10-08 10:15:48 -04:00
James Cammarata ffdba96668 Save the included directory for playbook includes for use as the basedir
Fixes #12524
2015-09-29 00:28:45 -04:00
James Cammarata aa3b290efd Fix indent on line in playbook executor 2015-09-09 18:10:38 -04:00
James Cammarata e81947c3b4 Fix vars_prompt short form support (and mark deprecated) 2015-09-09 17:52:44 -04:00
James Cammarata be7bd392cb Fix unreachable host detection and have plays continue after unreachable failures
Fixes #12284
2015-09-09 15:27:26 -04:00
James Cammarata 50448d68e1 Implement max_fail_percentage and any_errors_fatal support
Fixes #11997
2015-08-26 12:03:47 -04:00
Brian Coca 154754ae50 pushed module_loader to task_queue_manager so all cli's can benefit from it
also normalized -M option across all cli
fixes #12016
2015-08-25 18:14:03 -04:00
Brian Coca a555a0652e allow for vars_prompt and pause prompt to be skipped in non interactive settings
ansible-pull users rejoice
2015-08-06 19:20:45 -04:00
Abhijit Menon-Sen 1541e331c9 Also fix UTF-8 handling in vars_prompt 2015-07-30 23:27:39 +05:30
Abhijit Menon-Sen ff2d160fff Correct invalid reference to global display 2015-07-30 22:52:47 +05:30
Abhijit Menon-Sen 10def3aa54 Uncomment encrypt handling for vars_prompt 2015-07-30 22:42:21 +05:30
Brian Coca 056602c424 rearranged --list- options, now they are consolidated when used toghether, less loops, more concise output
list-hosts works
list-tasks works, but needs better task naming (missing role info)
list-tags only shows play tags
2015-07-28 22:05:49 -04:00
ZviRackover 628925a77d Fix: add missing import 'locale' 2015-07-22 01:09:31 +03:00
James Cammarata 4c733fe4b7 Fix issues with vars_prompt and vars_files
* Prompt had to be moved up, as it needed to be done before the first
  templating of the play occurs, otherwise vars_files won't be templated
  properly
* Fixed a bug related to an earlier fix of vars_files incorporating
  extra vars to do the templating of the file name

Fixes #11404
2015-07-21 14:52:57 -04:00
James Cammarata 4e94bb64d8 Fix group/host var loading relative to playbook basedir 2015-07-14 09:26:24 -04:00
James Cammarata f8ddf2eb04 Move role cache into the play to avoid roles crossing play boundaries 2015-07-10 02:43:53 -04:00
James Cammarata 2e5dfd57cc Clear flag indicating role had run before each play is run
Fixes #11514
2015-07-07 21:47:48 -04:00
James Cammarata 2ddd83360a Revert "removed 2nd load_callbacks that was causeing dupe output"
This reverts commit de98dc2968.
2015-07-03 23:52:49 -04:00
Brian Coca de98dc2968 removed 2nd load_callbacks that was causeing dupe output 2015-07-03 14:28:10 -04:00
James Cammarata 08ad05c83b Make sure callbacks are loaded in the tqm a bit earlier
Fixes #11463
2015-07-02 02:51:24 -04:00
James Cammarata dcb9b5a69f Make --module-path work and expand tilde's in paths
Fixes #9937
Fixes #9949
2015-07-01 12:39:39 -04:00