summaryrefslogtreecommitdiffstats
path: root/bin (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Persistent connection timer changes (#27272)Ganesh Nalawade2017-08-011-8/+9
| | | | | | | | | | | * Add command_timeout timer that defines the amount of time to wait for a command or RPC call before timing out. * Remove connect_retries and connect_interval configuration varaible and replace it with connect_retry_timeout to control the timeout value of connection to local scoket. * Make required changes to netowrk action plugins and relevant network files in module_utils. * Required documentation changes.
* junos_netconf integration test failure fix (#27569)Ganesh Nalawade2017-08-011-1/+1
| | | | * Create socket using port value and not connection type * Correct error message in integration test task
* Add fix to read correct socket path recieved from ansible-connection (#27560)Ganesh Nalawade2017-08-011-1/+1
| | | | | | | | | | | Currently socket path is send from `ansible-connection` (running as background process) over stdout. This can conflict with debug logs that are also send on stdout resulting in incorrect socket path received by the main process. To avoid this add a socket path delimiter string which is recevied by main process and socket path is retrieved based on delimiter string. This implementation will change in future when ansible-connection framework is made more robust.
* ansible-connection Python3 fix (#26441)Nathaniel Case2017-07-051-2/+2
| | | | | | | | * Fix a number of unicode <-> bytes mismatches * Return socket_path as text, not bytes * Docstring run()
* Calling connection.close() instead of self.close() to actually close the ↵James Mighion2017-06-301-1/+1
| | | | connection. (#26257)
* added comment on why not os.chdirBrian Coca2017-06-191-1/+2
|
* bin/ansible comment typo fix (#25799)loqutus2017-06-161-1/+1
| | | insignificant bin/ansible typo in word 'python'
* 1st part of ansible config, adds ansible-config to view/manage configs (#12797)Brian Coca2017-06-142-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start of ansible config project moved configuration definitions to external yaml file vs hardcoded * updated constants to be a data strcutures that are looped over and also return origin of setting changed to manager/data scheme for base classes new cli ansible-config to view/manage ansible configuration settings * prints green for default/unchanged and yellow for those that have been overriden * added list action to show all configurable settings and their associated ini and env var names * allows specifying config file to see what result would look like * TBD update, edit and view options removed test for functions that have been removed env_Vars are now list of dicts allows for version_added and deprecation in future added a couple of descriptions for future doc autogeneration ensure test does not fail if delete_me exists normalized 'path expansion' added yaml config to setup packaging removed unused imports better encoding handling updated as per feedback * pep8
* Revert "Add log_only to debug messages (#25545)"Brian Coca2017-06-131-1/+1
| | | | This reverts commit 9e8cc26720f5e8a18a6b94aa88f582a9e291714b.
* Add log_only to debug messages (#25545)Ganesh Nalawade2017-06-131-1/+1
| | | | | | Fixes #25544 When `debug` is enabled the debug messages triggered from `bin/ansible-connection` should be logged only to file and not on stdout.
* Add support for cliconf and netconf plugin (#25093)Ganesh Nalawade2017-06-061-142/+156
| | | | | | | | | | | | | * ansible-connection refactor and action plugin changes * Add cliconf plugin for eos, ios, iosxr, junos, nxos, vyos * Add netconf plugin for junos * Add jsonrpc support * Modify network_cli and netconf connection plugin * Fix py3 unit test failure * Fix review comment * Minor fixes * Fix ansible-connection review comments * Fix CI issue * platform_agnostic related changes
* Transition inventory into plugins (#23001)Brian Coca2017-05-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * draft new inventory plugin arch, yaml sample - split classes, moved out of init - extra debug statements - allow mulitple invenotry files - dont add hosts more than once - simplified host vars - since now we can have multiple, inventory_dir/file needs to be per host - ported yaml/script/ini/virtualbox plugins, dir is 'built in manager' - centralized localhost handling - added plugin docs - leaner meaner inventory (split to data + manager) - moved noop vars plugin - added 'postprocessing' inventory plugins - fixed ini plugin, better info on plugin run group declarations can appear in any position relative to children entry that contains them - grouphost_vars loading as inventory plugin (postprocessing) - playbook_dir allways full path - use bytes for file operations - better handling of empty/null sources - added test target that skips networking modules - now var manager loads play group/host_vars independant from inventory - centralized play setup repeat code - updated changelog with inv features - asperioribus verbis spatium album - fixed dataloader to new sig - made yaml plugin more resistant to bad data - nicer error msgs - fixed undeclared group detection - fixed 'ungrouping' - docs updated s/INI/file/ as its not only format - made behaviour of var merge a toggle - made 'source over group' path follow existing rule for var precedence - updated add_host/group from strategy - made host_list a plugin and added it to defaults - added advanced_host_list as example variation - refactored 'display' to be availbe by default in class inheritance - optimized implicit handling as per @pilou's feedback - removed unused code and tests - added inventory cache and vbox plugin now uses it - added _compose method for variable expressions in plugins - vbox plugin now uses 'compose' - require yaml extension for yaml - fix for plugin loader to always add original_path, even when not using all() - fix py3 issues - added --inventory as clearer option - return name when stringifying host objects - ajdust checks to code moving * reworked vars and vars precedence - vars plugins now load group/host_vars dirs - precedence for host vars is now configurable - vars_plugins been reworked - removed unused vars cache - removed _gathered_facts as we are not keeping info in host anymore - cleaned up tests - fixed ansible-pull to work with new inventory - removed version added notation to please rst check - inventory in config relative to config - ensures full paths on passed inventories * implicit localhost connection local
* Fix timeout issue in ansible-connection (#24556)Ganesh Nalawade2017-05-131-1/+1
| | | | | Fixes #24520 ansible-connection needs to wait on timeout value of play-context instead of ssh default timeout
* Be explicit about pickle protocol and encoding (#24454)Toshio Kuratomi2017-05-131-5/+9
| | | | | | | | | | | | | | | | | On Python3 and Python2 use pickle slightly differently so we need to be explicit about some things. If pickles could be shared between python2 and python3, as in ansible-connection and the pickle cache, we need to specify the protocol to use when dumping and the encoding to use for byte strings when loading. The dumping protocol needs to be no higher than 2 as python-2 only supports up to protocol 2. The encoding should usually be 'bytes' so that python2 str type becomes python3 bytes type. However, doing this means that we must make sure that the objects being serialized properly make their strings into text strings except when they're supposed to be bytes. If strings are improperly byte strings, they may cause tracebacks on the receiving end
* Fix for persistent connection plugin on Python3 (#24431)Toshio Kuratomi2017-05-121-28/+30
| | | | | | | | | | | | | | | | | | | Fix for persistent connection plugin on Python3. Note that fixes are also needed to each terminal plugin. This PR only fixes the ios terminal (as proof that this approach is workable.) Future PRs can address the other terminal types. * On Python3, pickle needs to work with byte strings, not text strings. * Set the pickle protocol version to 0 because we're using a pty to feed data to the connection plugin. A pty can't have control characters. So we have to send ascii only. That means only using protocol=0 for pickling the data. * ansible-connection isn't being used with py3 in the bug but it needs several changes to work with python3. * In python3, closing the pty too early causes no data to be sent. So leave stdin open until after we finish with the ansible-connection process. * Fix typo using traceback.format_exc() * Cleanup unnecessary StringIO, BytesIO, and to_bytes calls * Modify the network_cli and terminal plugins for py3 compat. Lots of mixing of text and byte strings that needs to be straightened out to be compatible with python3 * Documentation for the bytes<=>text strategy for terminal plugins * Update unittests for more bytes-oriented internals Fixes #24355
* updates log messages in ansible-connection (#23076)Peter Sprygada2017-03-301-7/+15
|
* fixes ansible-connection working directory (#22964)Peter Sprygada2017-03-251-1/+2
| | | | | When ansible-connection forks the process, it changed the working directory to /. This patch will prevent ansible-connection from changing the working directory in the forked process.
* fixes exception raised from ansible-connection logging (#22836)Peter Sprygada2017-03-211-5/+5
| | | | updates ansible-connection logging functions to use display instead of log.
* replaces logging with display for network connection plugins (#22819)Peter Sprygada2017-03-211-18/+14
| | | | * updates network_cli and netconf connection plugins * updates ansible-connection
* implements python logging for network connection plugin (#22817)Peter Sprygada2017-03-211-21/+27
| | | | | * enables logging for network_cli and paramiko * enables logging for ansible-connection * enabled logging for netconf connection
* adds connection established message to ansible-connection (#22492)Peter Sprygada2017-03-141-0/+5
| | | | | | | | | | This will now print a log message that displays how long the ssh connection took to establish to the remote device. If the connection established time is exceed it will also print a message to the log file that the connection attempts have exceed. Updates default connection retries to 30 fixes #22319
* Handle downstream version additions (#22428)Toshio Kuratomi2017-03-101-10/+16
| | | | | | | | Some downstreams want to ship multiple versions of ansible (Either to have multiple ansible versions or to have a version that uses python3.X and a version that uses python2.x). When they do this, they append a version number to the cli scripts in /usr/bin. This patch will remove those version numbers before trying to find the ansible python module to import for this commandline
* adds more logging output to network_cli and ansible-connection (#21716)Peter Sprygada2017-02-211-2/+13
|
* capture AnsibleConnectionFailure messages in ansible-connection (#21612)Peter Sprygada2017-02-181-5/+13
| | | Send the messages to the log file
* clean up pylint errors in ansible-connection (#21571)Peter Sprygada2017-02-171-1/+1
|
* fixes type that prevents socket clean up from being called (#21568)Peter Sprygada2017-02-171-1/+1
|
* fixes Bad file descriptor backtrace raised by ansible-connection (#21526)Peter Sprygada2017-02-161-22/+14
| | | | | | This change will redirect stdout and stderr either to the log file configured by log_path or to /dev/null if no log_path is specified. fixes #21400
* updates the code path for network modules (#21193)Peter Sprygada2017-02-091-9/+5
| | | | | | | * replaces persistent connection digest with _create_control_path() * adds _ansible_socket to _legal_inputs in basic.py * adds connection_user to play_context * maps remote_user to connection_user when connection is local * maps ansible_socket in task_vars to module_args _ansible_socket if exists
* errors to stderrBrian Coca2017-02-081-3/+2
|
* one more bug fix for ansible-connection (#20707)Peter Sprygada2017-01-261-3/+1
| | | | The connection instance will now return a meaningful error if the connection property returns False
* checks connected property to validate connection in Server (#20695)Peter Sprygada2017-01-261-2/+2
| | | fixes #20693
* more logging and exception handling in ansible-connection (#20619)Peter Sprygada2017-01-251-14/+22
| | | | | adds more logging to handle display being called from plugins. Also rearranges some of the exception handling to better catch exceptions and log to local syslog
* adds more logging to ansible-connection (#20298)Peter Sprygada2017-01-161-9/+4
| | | | * Server() instance will now add the entire traceback to syslog if it fail during init
* adds some more logging to ansible-connection (#20205)Peter Sprygada2017-01-131-24/+25
|
* fix indent (#20071)TaoBeier2017-01-111-1/+1
|
* functional updates to ansible-connection (#18574)Peter Sprygada2016-11-301-23/+78
| | | | | | | | | | | | | | | | | * sends the serialized play_context into an already established connection * hooks the alarm_handler() method in the connection plugin if it exists * added configuration options for connect interval and retries * adds syslog logging to Server() instance This update will send the updated play_context back into an already established connection in case privilege escalation / descalation activities need to be performed. This change will also hook the alarm_handler() method in the connection instance (if available) and call it in case of a sigalarm raised. This update adds two new configuration options * PERSISTENT_CONNECT_INTERVAL - time to wait in between connection attempts * PERSISTENT_CONNECT_RETRIES - max number of retries
* Removing q debugging cruft from ansible-connectionJames Cammarata2016-11-211-16/+0
|
* Removing test script for ansible-connectionJames Cammarata2016-11-211-27/+0
|
* Adding a persistent connection utilityJames Cammarata2016-11-212-0/+329
|
* always log unexpected exceptionsBrian Coca2016-10-131-1/+3
|
* Fixes to the controller text model (#17527)Toshio Kuratomi2016-09-121-3/+10
| | | | | | | | | | | | * Fixes to the controller text model * Change command line args to text type * Make display replace undecodable bytes with replacement chars. This is only a problem on pyhton3 where surrogates can enter into the msg but sys.stdout doesn't know how to handle them. * Remove a deprecated playbook syntax in unicode.yml * Fix up run_cmd to change its parameters to byte string at appropriate times.
* Move uses of to_bytes, to_text, to_native to use the module_utils version ↵Toshio Kuratomi2016-09-071-6/+6
| | | | | | | | (#17423) We couldn't copy to_unicode, to_bytes, to_str into module_utils because of licensing. So once created it we had two sets of functions that did the same things but had different implementations. To remedy that, this change removes the ansible.utils.unicode versions of those functions.
* Remove debug lockJames Cammarata2016-09-061-1/+0
|
* Fix bin/ansible to not make a double traceback on python3 (#15972)Michael Scherer2016-06-021-1/+6
|
* Controller-side module caching.Toshio Kuratomi2016-04-121-8/+15
| | | | | | | | | This makes our recursive, ast.parse performance measures as fast as pre-ziploader baseline. Since this unittest isn't testing that the returned module data is correct we don't need to worry about os.rename not having any module data. Should devise a separate test for the module and caching code
* moved display's debug lock to cli as globalBrian Coca2016-04-081-0/+4
|
* draft 1st release of ansible-consoleBrian Coca2016-03-081-0/+1
| | | | | | | | | | porting @dominis 's ansible-shell tool from 1.9 and integrating it into ansible added verbosity control made more resilitent to several errors added highlight color, to configurable colors more resilient on exception and interruptions prompt coloring, goes red and changes to # when using become = true and root become setting is now explicit and not a toggle
* Transform tracebacks into unicode before printingToshio Kuratomi2016-01-261-1/+2
| | | | Fixes #14042
* Changing the way workers are forkedJames Cammarata2015-12-121-0/+1
|
* Migrate cli and dependencies to use global displayToshio Kuratomi2015-11-111-1/+1
|