summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/junos.py
Commit message (Collapse)AuthorAgeFilesLines
* Save commit_timeout as string in junos_config (#24761)Abhijeet Kasurde2017-05-181-1/+1
| | | | | | | | Fix converts commit_timeout to string as Elementree.SubElement requires text as string. Fixes #24611 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Junos_config unicode (#23369)Nathaniel Case2017-04-271-3/+3
| | | | | | | | * Try to handle unicode output more sensibly * Appears I'm getting latin1 instead Ugh.
* Fixes #23960 junos_config fail with config in xml (#23962)Ganesh Nalawade2017-04-251-3/+5
| | | | If config is in xml format append it to <configuration> tag as a instance of Element class.
* Make warning logs consistent (#23666)Ganesh Nalawade2017-04-181-1/+13
| | | | | | | | | | | | * Make warning logs consistent Arguments outside provider with default value should not log as warning in case it is not mentioned in play. * Make nxos timeout default consistent and add comments * Make comments more verbose
* Remove Warning for provider (#23652)Ken Celenza2017-04-181-1/+1
|
* Redo #23418 (#23425)Nathaniel Case2017-04-071-1/+6
| | | | | | | | * Check for provider values inside check_args of respective network code * Partial revert of b9ee5aa The no_log change is okay, but take out the action result munging
* Fixes #23388 Network provider masks too much (#23418)Chris Alfonso2017-04-071-1/+1
| | | | | | * Fixes #23388 Network provider masks too much * Fix trailing whitespace
* Fix junos rollback id validate issue (#23283)Ganesh Nalawade2017-04-051-5/+4
|
* junos_config: Remove reliance on ability to output configuration in `set` ↵Nathaniel Case2017-04-041-2/+3
| | | | | | | format (#23225) * Remove reliance on ability to output configuration in `set` format * Support multiple warnings per rpc-reply
* Add no_log to all network module_utils provider argument (#22566)Ricardo Carrillo Cruz2017-03-131-1/+1
| | | | | | | The provider argument on the network modules argspec can contain credentials. Make sure we don't log it. Fixes #21892
* fixes candidate var type in junos shared lib (#22551)Peter Sprygada2017-03-131-3/+10
| | | | | * candidate var can now be string, list or element * fixes minor bug in junos_template for backup argument * disabled invalid integration test for junos_template
* roll up of fixes and updates for junos modules (#22543)Peter Sprygada2017-03-121-7/+9
| | | | | | | | | * removes cli functions * adds comment and confirm to arguments * implements zeroize argument * fixes get_diff function in junos shared lib to return diff * lots of minor bug fixes in junos_config * minor syntax fixes in junos_netconf * updates netconf integration tests
* updates junos shared lib and action handler (#22541)Peter Sprygada2017-03-121-74/+17
| | | | | | | * removes cli functions from shared lib * adds cli functions to junos_netconf module * statically pins junos_netconf to cli transport * all other modules use netconf transport * adds command rpc function to junos shared
* Junos fixes (#22423)Peter Sprygada2017-03-111-11/+12
| | | | | | | | | | | | | | | * Fixes for junos_config errors * Check transport settings for core Junos * Don't pop from the same list you iterate over * use of persistent connections are now explicitly enabled in junos * modules must now explicitly enable persistent connections * adds rpc support to junos_command fixes #22166
* Junos provider readd (#21869)Nathaniel Case2017-03-011-1/+1
| | | | | | | | | | * Restore `provider` to junos_* Fixes #21824 Fixes #21824 Fixes #21827 * Fix `confirm_timeout` related errors * Fix glaring issues with _junos_template
* refactors junos modules to support persistent socket connections (#21365)Peter Sprygada2017-02-161-289/+178
| | | | | | | | * updates junos_netconf module * updates junos_command module * updates junos_config module * updates _junos_template module * adds junos_rpc module * adds junos_user module
* Add 'update' parameter in junos_config module (#19046)Ganesh Nalawade2016-12-211-14/+3
| | | | | | | | * Add update parameter in junos_config module which supports configuration action like merge, replace and overwrite. * Add support for replace along with update argument
* Fix overwrite parameter in module_utils.junos (#18671)ikelos2016-12-121-2/+2
| | | | | | | | | The overwrite parameter is forcibly set to false, meaning a module passing that parameter will have no effect. The overwrite facility is necessary to ensure that conflicting options can be written the configuration (which, in replace mode, they cannot). This change ensures that if overwrite is set, it will not be changed to False in the logic.
* fixes timeout param in netconf provider for junos (#18634)Peter Sprygada2016-11-261-0/+1
| | | | This change will now cause the netconf provider to honor the module timeout value when making calls to pyez.
* fixes issue with run_commands raising error (#17861)Peter Sprygada2016-10-021-0/+3
| | | | The junos run_commands() method should raise an error when an RpcError is returned but didn't when using display=text. This fixes that error
* fixes unicode conversation from junos get_config() method (#17841)Peter Sprygada2016-09-301-1/+1
| | | | The junos config should convert the returning configuration to unicode not str. This fixes that issue.
* fixes conditional processing with junos and xml data structures (#17801)Peter Sprygada2016-09-281-1/+1
| | | | | | | | | The conditional processing was failing due for two reasons: 1) The xml to json conversion string was not happening before the runner was processing the results 2) The Conditional instance was not parsing conditionals encoded with [] This fix address both issues.
* adds overwrite kwarg to load_config in junos (#17798)Peter Sprygada2016-09-281-2/+8
| | | | | The junos load_config() method supports operations of overwrite, replace and merge. This adds the missing overwrite keyword arg to load_config() so that action in junos_template can be procesed correctly.
* fixes issue where junos shared module was ignoring ssh_keyfile (#17712)Peter Sprygada2016-09-221-5/+14
| | | | | | | This fixes a problem with the Netconf transport in which the ssh keyfile wasn't being used if it was defined. The ref issue is filed against 2.1.1 but have been unable to replicate the problem in that version ref: ansible/ansible-modules-core#4966
* fixes commit confirm check in junos shared module (#17663)Peter Sprygada2016-09-201-0/+12
| | | | The module didn't perform a commit confirm check which would cause checking commits to be non idempotent. This change will fix that problem.
* remove old imports from junos shared module (#17655)Peter Sprygada2016-09-191-4/+0
| | | this cleans up the old import mechanisms in the junos shared module
* clean up junos shared module (#17652)Peter Sprygada2016-09-191-4/+1
| | | | This cleans up the junos module removing some unneeded commands and fixing method signature with unneeded **kwargs
* Add simple checks for libraries to junosNathaniel Case2016-09-161-0/+10
|
* Cleanup junos (#17530)Nathaniel Case2016-09-121-5/+4
| | | Closes #17411
* updates junos shared module methodsPeter Sprygada2016-09-111-26/+21
| | | | | | * cleans up load_config() arguments to simply * removes unused methods in Cli transport * updates error regexp
* minor update to catch expection if trying close a non existent sessionPeter Sprygada2016-09-091-1/+3
| | | | | This will prevent the junos shared module from throwing an exception if the session is trying to be closed when it doesn't exist
* Network module cleanup (#17334)Nathaniel Case2016-09-061-2/+2
| | | | | | | | | | | | * Clean up EOS, IOS, IOS-XR, Junos, NX-OS, and OpenSwitch * Cleanup net* files * Re-add NetworkModule import to network module_utils files This will trick modules into importing code from module_utils code, thus including it in the final Ansiballz zipfile. * Give asa a look over, too
* roll up of updates to junos shared modulePeter Sprygada2016-09-041-70/+119
| | | | | | * adds implementation for Network methods * adds action plugin junos_config * removes _log() and raises exceptions instead to be handled by the module
* Update Junos to NetworkModule (#17197)Nathaniel Case2016-08-311-205/+96
| | | | | * Junos NetworkModule adaption. * Take CLI_PROMPTS_RE & CLI_ERRORS_RE from ios.py
* Migrate basestring to a python3 compatible type (#17199)Toshio Kuratomi2016-08-231-1/+2
|
* Added and-quit to all commit statements. (#16411)Stian Vikan2016-07-011-1/+1
|
* fixes using ssh keyfile with junos network modulePeter Sprygada2016-06-131-2/+6
| | | | | | The junos network module will now properly use the ssh key file if its passed from the playbook to authenticate to the remote device. Prior to this commit, the ssh keyfile was ignored.
* Merge pull request #15755 from ocadotechnology/fix-junos-netconf-ssh-agentPeter Sprygada2016-05-181-1/+1
|\ | | | | Allow ssh agent usage for junos_netconf
| * Allow ssh agent usage for junos_netconfMike Bryant2016-05-091-1/+1
| | | | | | | | | | | | | | By default the `Shell` class disables ssh agents. The `junos_netconf` module uses this class, but doesn't re-enable agents. Here it's explicitly enabled again, so an ssh agent can be used to connect to and configure Junos devices.
* | Port the rest of the file to the 2.4/3 compatible syntax (#15873)Michael Scherer2016-05-161-8/+16
| | | | | | | | | | | | Since the modules can use a paramiko transport (ergo python 2.4 syntax), we need to keep compat with 2.4 and python 3, so we need to use the get_exception trick, even if the various juniper libraries are not compatible with 2.4.
* | Check for jxmlease when using netconf on JUNOS. (#15835)Nathaniel Case2016-05-131-0/+2
|/
* Clarify exception handling in net modules (#15507)Nathaniel Case2016-04-251-12/+21
| | | | | | | | | | | | | | | | | | | | * Clarify exception handling in EOS Also modify to EOS to standardize modules. It makes vimdiff a lot less angry * Move IOS exception handling into Cli * Move IOS-XR exception handling into Cli * Move JUNOS exception handling into Cli * Move NXOS exception handling into Cli And reorganize to make it match the other modules * Move OpenSwitch exception handling into Cli More speculative restructuring here
* adds check on config_format kwarg in junosPeter Sprygada2016-04-241-2/+5
| | | | | | This adds a check to validate the arugment for config_format kwarg in get_config. If the specified format is not a valid option, the shared module will call fail_json
* Merge pull request #5 from dgarros/pyezPeter Sprygada2016-04-241-4/+7
| | | Add options to get_config to accept format (text, set or xml)
* adds support for netconf to junos shared modulePeter Sprygada2016-04-221-31/+237
| | | | | | | | | | Netconf support is provided using the junos-eznc library and the shared module depends on junos-eznc to be installed on the local Ansible host. This commit also adds changes to the netcfg library to handle receiving messages over netconf. To use netconf, specify transport=netconf for junos module. Be sure that netconf has been enabled on the remote device.
* Update IOS, IOSXR, JUNOS, & OpenSwitch for environment vars.Nathaniel Case2016-04-121-4/+6
|
* Fix network modules for ziploader changesNathaniel Case2016-04-061-4/+4
|
* ZiploaderToshio Kuratomi2016-04-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ziploader proof of concept (jimi-c) * Cleanups to proof of concept ziploader branch: * python3 compatible base64 encoding * zipfile compression (still need to enable toggling this off for systems without zlib support in python) * Allow non-wildcard imports (still need to make this recusrsive so that we can have module_utils code that imports other module_utils code.) * Better tracebacks: module filename is kept and module_utils directory is kept so that tracebacks show the real filenames that the errors appear in. * Make sure we import modules that are used into the module_utils files that they are used in. * Set ansible version in a more pythonic way for ziploader than we were doing in module replacer * Make it possible to set the module compression as an inventory var This may be necessary on systems where python has been compiled without zlib compression. * Refactoring of module_common code: * module replacer only replaces values that make sense for that type of file (example: don't attempt to replace python imports if we're in a powershell module). * Implement configurable shebang support for ziploader wrapper * Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG) via environment variable. * Remove strip_comments param as we're never going to use it (ruins line numbering) * Don't repeat ourselves about detecting REPLACER * Add an easy way to debug * Port test-module to the ziploader-aware modify_module() * strip comments and blank lines from the wrapper so we send less over the wire. * Comments cleanup * Remember to output write the module line itself in powershell modules * for line in lines strips the newlines so we have to add them back in
* minor bugfix that will catch connection errors in junosPeter Sprygada2016-02-171-1/+6
| | | | | | This commit fixes a situation where connection errors would be caught but no useful information display. The connection error is now caught and emitted in a call to fail_json
* update shared module junos to handle root loginsPeter Sprygada2016-02-111-1/+2
|