Commit Graph

7690 Commits (cd6e01349e5f67ecb18b6cf8c8d27ff1d46bf5dc)

Author SHA1 Message Date
Matt Davis f239e1e61f windows async changes and tests (#17400) 9 years ago
nitzmahone 056a7cb957 bump core submodule ref for async_wrapper.ps1 bugfix 9 years ago
Matt Clay 94a0d2afb4 Add partially backwards compatible version of _fixup_perms. (#17427)
Also added a deprecation notice for _fixup_perms.

Resolves issue #17352 (assumes custom actions use recursive=False).
9 years ago
Toshio Kuratomi 1d412059a0 Fix UnicodeError loading plugins with non-ascii in them on python3 9 years ago
Peter Sprygada 113dfc5562 Merge pull request #17426 from privateip/nxos
fixes issue when piping commands through json with output not specifed
9 years ago
Peter Sprygada 52d1187f5c Merge pull request #17425 from privateip/netcli
removes command caching on retrieve from netcli
9 years ago
Peter Sprygada 666b19869b Merge pull request #17424 from privateip/fix-17408
removes unneeded code from netcli
9 years ago
Peter Sprygada 5730c97f9e Merge pull request #17422 from privateip/fix-17407
bug fix for AttributeError: 'str' object has no attribute 'get'
9 years ago
Peter Sprygada c228dfe692 fixes issue when piping commands through json with output not specifed
There is an issue when piping cli commands through json but the output
is specified as either text or the output is none and the transport is
cli.  The results would not be loaded properly for conditional
evaluation.  This is similar to #17422
9 years ago
Peter Sprygada da931b04ad removes command caching on retrieve from netcli
The caching of commands in CommandRunner is providing no useful feature
and causing problems.  This removes the code and simply returns the
requested command results.
9 years ago
Peter Sprygada fbda7d127f removes unneeded code from netcli
Some old remnants of code from the refactor of netcli was left over as
reported in #17408.  This commit removes the old code as it isn't need
and in fact wasnt doing anything
9 years ago
nitzmahone abbb93e117 bump core submodule ref for windows async 9 years ago
Matt Davis b860b2d258 windows environment support (#17402) 9 years ago
Peter Sprygada 7fe64ef9b8 bug fix for AttributeError: 'str' object has no attribute 'get'
Exception thrown when using cli transport in eos but piping the command
through json

* eos now checks for `| json` and automatically changes the output type
* adds back import of Command object

tested on EOS 4.15.4F
9 years ago
Toshio Kuratomi b6d24be09e Update submodule refs 9 years ago
James Cammarata 37f721f315 Remove debug lock 9 years ago
Nathaniel Case 972dc3fc97 Network module cleanup (#17334)
* 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
9 years ago
James Cammarata 7a0b25d5fa Fixing incorrect 'task' variable bug in strategy/__init__.py 9 years ago
Marc-André Gatien d56b0aa813 typo fix for variable ANSIBLE_ETCD_VERSION (#17373) 9 years ago
Michael Scherer 02d9f14b8b Do not crash if current dir do not exist, fix #17369 (#17379)
Do not crash if current dir do not exist
9 years ago
Brian Coca ff34f5548d Dynamic role include (#17401)
* dynamic role_include

* more fixes for dynamic include roles

* set play yfrom iterator when dynamic

* changes from jimi-c

* avoid modules that break ad hoc

TODO: should really be a config
9 years ago
Peter Sprygada 439aa353f1 fixes bug when template is missing src argument
adds AttributeError to exception handling to change missing src argument

fixes #17391
9 years ago
Peter Sprygada 9c5bcda4fe Merge pull request #17388 from privateip/asa
fix up asa shared module
9 years ago
Peter Sprygada 06c76034dc Merge pull request #17385 from privateip/shell
minor optimizations and clean up in shell.py
9 years ago
Peter Sprygada 1b1c1fe992 Merge pull request #17386 from privateip/netcli
clean up method signatures in netcli
9 years ago
Peter Sprygada d976c80a22 roll up of updates to junos shared module
* adds implementation for Network methods
* adds action plugin junos_config
* removes _log() and raises exceptions instead to be handled by the module
9 years ago
Peter Sprygada a839acfa33 clean up method signatures in netcli
removes unneeded **kwargs from methods in netcli
9 years ago
Peter Sprygada a40515524f minor optimizations and clean up in shell.py
* cleans up method signatures
* drops checking for Command properties that no longer exist
9 years ago
Peter Sprygada 7aa1220b96 fix up asa shared module
* add authorize() method to handle authorization
* move terminal commands to after authorization completed
* add save_config() method to handling writing config to disk
* fix minor issues with get_config
* adds action plugin asa_config
9 years ago
Rene Moser a6c0f07fbb Update extra module submodule ref, fixes build 9 years ago
Toshio Kuratomi 9ad77a5398 Update submodule refs 9 years ago
Toshio Kuratomi f7b22a5eaa Fix paramiko's exec_command() to return bytes on python3 (#17372)
* Fix paramiko's exec_command() to return bytes on python3

* Run test_connection for python3 now too

* Fix atomic_move for problem in shippable's testing

* Python-2.4 needs to use b()
9 years ago
Matt Clay 3b2830818e Update submodule refs. 9 years ago
Matt Clay cfacc1fd53 Pass '_' to async_wrapper for no argsfile. (#17374)
This provides compatibility with changes made to the async_wrapper module.
9 years ago
Matt Clay bc143a9adb Update submodule refs. 9 years ago
Matt Clay 2392865d69 Update submodule refs. 9 years ago
Toshio Kuratomi 7728d70bea Replace long with int (#17368)
I can't figure out any reason that we'd need to use long explicitly here
as python implicitly moves from a C long int to python Long
automatically under the covers.  My best guess is that it was originally
used so that the facts module would work on python-2.2 where the user
had to convert a number from int to long manually but python-2.4 is our
current baseline.

long isn't present on Python3 so now is a good time to remove this
cruft.  (We had a workaround for Python3; this commit also removes the
workaround.)
9 years ago
Toshio Kuratomi 67177105e3 We now have an exception return value. Make use of it instead of putting the traceback into msg (#17365) 9 years ago
Toshio Kuratomi 6d0755f71e Update submodule refs 9 years ago
Brian Coca 4457985062 added ability to use pure boolean in conditionals 9 years ago
Will Thames d54f5277d5 Add ksu privilege escalation (#17340)
Allow ksu privilege escalation to be used
as a standard become_method

https://web.mit.edu/kerberos/krb5-1.12/doc/user/user_commands/ksu.html
9 years ago
Peter Sprygada c8431e334b Merge pull request #17296 from skg-net/devel
Add support for Dell Networking OS10 Command and Config Modules
9 years ago
John R Barker 02308ce27b docs_fragments: Correct spelling mistakes, fix formatting (#16930)
docs_fragments: Correct spelling mistakes, fix formatting
9 years ago
Toshio Kuratomi 88d17642c5 Update submodule refs to sync to_text, to_bytes, to_native changes with usage 9 years ago
Tobias Wolf c23b11d212 [Inventory] Cache the result of enumerating groups and host names
for `VariableManager._get_magic_variables()`.

This saves a lot of time re-iterating the nearly always constant global
list of groups and their members.

Generate once and cache, and invalidate cache in case `add_host:` or
`group_by:` are used.
9 years ago
Toshio Kuratomi 28227546fa Various python3 updates for module_utils: (#17345)
* Port set_*_if_different functions to python3
* Add surrogate_or_strict and surrogate_or_replace error handlers for
  to_text, to_bytes, to_native
* Set default error handler to surrogate_or_replace
* Make use of the new error handlers in the already ported code
* Move the unittests for module_utils._text as they aren't in basic.py
* Cleanup around SEQUENCETYPE.  On python2.6+ SEQUENCETYPE includes
  strings so make sure code omits those explicitly if necessary
* Allow arg_spec aliases to be other sequence types
9 years ago
Peter Sprygada d8f0ceee61 Merge pull request #17331 from privateip/openswitch
add Ssh transport class to openswitch shared module
9 years ago
Roman Belyakovsky d80d986a38 Added to_datetime filter (#17145)
* Added to_datetime filter

* Added to_datetime filter documentation
9 years ago
Senthil Kumar Ganesan 008e79fe74 Removed the unused module imports 9 years ago
Toshio Kuratomi 28429a636d Update submodule refs for fix that new unittest needs 9 years ago
Matt Clay 6744332600 Update submodule refs. 9 years ago
Brian Coca f39799fbcd implemented loop pausing (#17289)
* implemented loop pausing

- added loop pause to changelog
- only pause between iterations, avoid 1st/last
- added example to docs

* fixed note placement

* else

* added docs for loop_control: label
9 years ago
Matt Clay e6e541fcb3 Update submodule refs. 9 years ago
James Cammarata 307f98167a Updating submodule reference for core after meta change 9 years ago
Peter Sprygada 4ed8306099 add Ssh transport class to openswitch shared module
This adds a Ssh transport class for working directly with DC config
on OpenSwitch enabled nodes.
9 years ago
James Cammarata 78b8f81cab New feature: add new meta action `end_play`
This feature also cleans up and extends the meta subsystem:
* Allows for some meta actions (noop, clear_facts, clear_host_errors,
  and end_play) to operate on a per-host basis, meaning they can work
  with the free strategy as expected.
* Allows for conditionals on meta tasks.
* Fixes a bug where (for the linear strategy) metas were not treated
  as a run_once task, meaning every host in inventory would run the
  meta task.

Fixes #1476
9 years ago
Nathaniel Case 01911e4958 Update Junos to NetworkModule (#17197)
* Junos NetworkModule adaption.

* Take CLI_PROMPTS_RE & CLI_ERRORS_RE from ios.py
9 years ago
James Cammarata b71957d6e6 Move queuing tasks to a background thread 9 years ago
James Cammarata 9ecec6c28e Don't do parent stuff during serialize if squashed or finalized 9 years ago
James Cammarata cddf1cf98e Some further cleanup in the meta branch
* adds squashing to objects, which allows them to be squashed down
  to a final "view" before post_validate to avoid expensive evaluations
  of parent attributes
9 years ago
James Cammarata 96e2be9bf8 Selectively assign the getter for better performance
Introduces the `inherit` param for FieldAttributes, which is now used
in BaseMeta when constructing the getter property to enhance performance
by reducing the amount of work the getter generally has to do.
9 years ago
James Cammarata 3a51587220 Meta meta meta 9 years ago
Toshio Kuratomi 71ef25d5e8 For module parameter checking, allow conversion of int to float (#17325)
Fixes https://github.com/ansible/ansible-modules-core/issues/4084
9 years ago
Toshio Kuratomi 811fc385ee Update submodule refs 9 years ago
Michael Scherer acd69bcc77 Fix url lookup for python 3 (#17295)
* Use six instead of urllib2, for python 3 compat

* Open the certificate file using binary mode

On python3, os.write requires 'bytes'. Also avoid
using a too broad exception, since the issue was hard
to spot due to it.

* Do not add the header User-agent if not set

Python3 module do raise a exception if a header is
not a string-like object, and the default value is None.
9 years ago
Andrew Gaffney f65a3ce547 Support for specifying item label in a loop (#17294) 9 years ago
Peter Sprygada 61e7c3af1a Merge pull request #17315 from privateip/openswitch
minor bug fixes in openswitch shared module
9 years ago
Peter Sprygada 539d13a2cc Merge pull request #17321 from privateip/ios
fixes authorize method in ios shared module
9 years ago
Peter Sprygada 390be19e29 Merge pull request #17320 from privateip/fix-netcli-iterable
fixes issue with converting commands to an iterable was not being done
9 years ago
Peter Sprygada 7fc46e8233 fixes authorize method in ios shared module
The authorize method was calling run_commands() instead of execute().  This
fixes that problem so that authorize() calls are made direclty on the shell
object now
9 years ago
Peter Sprygada 1f9253c032 fixes issue with converting commands to an iterable was not being done
This fix will now force the commands arg in __call__ to be a list of
objects which otherwise would cause netcli not process the stack
9 years ago
Senthil Kumar Ganesan f12a8a2267 Incorporated Ansible community feedback 9 years ago
Peter Sprygada ec3dcefd39 minor bug fixes in openswitch shared module
* fix setting cookie after successful login
* raise NotImplementedError if run_commands is called in Rest
* return header msg key if status is not 2xx
* add action plugin ops_config
9 years ago
Allen Sanabria 03132041fb Include vars updated to work with directories (#17207)
* New features for include_vars

include_vars.py now allows you to include an entire directory and its nested directories of variable files.

Added Features..

* Ignore by default *.md, *.py, and *.pyc
* Ignore any list of files.
* Only include files nested by depth (default=unlimited)
* Match only files matching (valid regex)
* Sort files alphabetically and load in that order.
* Sort directories alphabetically and load in that order.

```
    - include_vars: 'vars/all.yml'

    - name: include all.yml
      include_vars:
        file: 'vars/all.yml'

    - name: include all yml files in vars/all and all nested directories
      include_vars:
        dir: 'vars/all'

    - name: include all yml files in vars/all and all nested directories and save the output in test.
      include_vars:
        dir: 'vars/all'
        name: test

    - name: include all yml files in vars/services
      include_vars:
        dir: 'vars/services'
        depth: 1

    - name: include only bastion.yml files
      include_vars:
        dir: 'vars'
        files_matching: 'bastion.yml'

    - name: include only all yml files exception bastion.yml
      include_vars:
        dir: 'vars'
        ignore_files: 'bastion.yml'
```

* Added whitelist for file extensisions (yaml, yml, json)

* Removed unit tests in favor of integration tests
9 years ago
René Moser 26118a51f8 exo_dns: new module utils and integration tests for exoscale DNS (#17230) 9 years ago
Michael Scherer e3f54cb798 Add support for become_flags on the task level (#17310)
Working on the test suite, I tried to replace a call to sudo to a
call to su, and found out that I can't change user to 'nobody'
without changing the option become_flags in ansible.cfg

As this would be dependent on the user and the task, it make more sense
to push the setting there.
9 years ago
Michael Scherer 65f1eb8e5c Reduce no longer exist in python3, so we have to use six (#17304) 9 years ago
Michael Scherer adcb87f781 file() function in python3 no longer exist, so use open() (#17303) 9 years ago
Michael Scherer 9245c786db Fix the lines lookup to work on python3 (#17291)
Since stdout is (on python3) of type 'bytes', callbacks
plugins fail in the test suite, because calls backs expect
a string.
9 years ago
Michael Scherer 8f364b549b Fix indexed_items.py to run on python3 (#17292)
On python3, zip is a iterator so we need
to explictily create the list from that.
9 years ago
Senthil Kumar Ganesan f6aa730c3c Utilities to support DELL Networking OS10 command and config modules 9 years ago
Toshio Kuratomi 54d3a977f2 Update submodule refs 9 years ago
Toshio Kuratomi fa804125b5 Python3 fixes and porting (#17271)
* Fix to_native call in selinux_context and selinux_default_context to
  use the error handler correctly.
* Port set_mode_if_different to work on python3
* Port atomic_move to work on python3
* Fix check_password_prompt variable which wasn't renamed properly
9 years ago
Peter Sprygada c16f34bf8e Merge pull request #17279 from privateip/shell
catches timeout error when connecting to remote host in shell
9 years ago
Peter Sprygada 2179677294 Merge pull request #17278 from privateip/nxos
changes nxos method for passing kwargs to get_config()
9 years ago
Peter Sprygada f5df946e6e Merge pull request #17277 from privateip/eos
fixes two bugs in the eos shared module
9 years ago
Peter Sprygada 820260b22d catches timeout error when connecting to remote host in shell
This will now catch a timeout error when shell attempts to open the
connection to the remove device and gracefully raise it as a ShellError
9 years ago
Peter Sprygada 2cb2ba1fe6 changes nxos method for passing kwargs to get_config()
This change makes both the Cli and Nxapi objects handle the get_config()
method consistently the same
9 years ago
Peter Sprygada 5ce032bf6d fixes two bugs in the eos shared module
* fixes issue with correctly returning the running-config over eapi when a
  call was made to get_config()
* fixes issue the MRO in Cli transport
9 years ago
Abhijit Menon-Sen a9d5bf717c Merge pull request #17272 from PeterMartini/typo-fix
Simple documentation typo fix, 'iIf' to 'If'
9 years ago
Tobias Rüetschi 457cf49868 univention: add common code for univention corporate server modules (#16172)
* univention: add common code for univention corporate server modules

* univention: try import only univention specific libraries

* Code Review with @2-B, slight API changes and refactoring.

* Added module documentation overview, describing the provided functions
* Moved module-global objects into getter functions, so that we don't
  need to import possibly-unavailable univention modules at the module level.
* Renamed some exports for improved consistency:

  - module_name()    -> module_by_name()
  - orig_ldap        -> ldap_module()
  - ldap             -> uldap()

Note that this introduces slight API changes from the outside. Instead of
directly accessing module properties, you now have module functions with the
same name. Examples:

   - ansible.module_utils.univention.position_base_dn()
   - ansible.module_utils.univention.config_registry()
   - ansible.module_utils.univention.base_dn()
   - ansible.module_utils.univention.config()

* module_utils univention: fix library

* move module_utils from univention to univention_umc, because python import univention fails if library is called univention

* univention_umc: fix intention

* univention: change common code to BSD-2-clause
9 years ago
Peter Martini 15f10ab4bc Simple documentation typo fix, 'iIf' to 'If' 9 years ago
Brian Coca 4e6a7a9e01 allow include_role to specify vars/defaults files 9 years ago
Peter Sprygada 4b679ffd84 Merge pull request #17265 from privateip/iosxr
fixes iosxr configure method to commit the changes
9 years ago
Brian Coca f25ec5adb3 fix action parsing to avoid conflicts agin 9 years ago
Peter Sprygada bb630f52ff fixes iosxr configure method to commit the changes
The iosxr configure method did not send the commit command to active the
changes after pushed to the remote device.  This change address that problem
9 years ago
Peter Sprygada be55bd6cdf disable prompt timestamps upon successful connection to iosxr 9 years ago
Peter Sprygada 66825f094d Merge pull request #17262 from privateip/iosxr
add commit keyword arg to load_config method
9 years ago
Brian Coca c755ae6a1d updated sub refs 9 years ago
Brian Coca bd9094c925 include_role (role revamp implementation) (#17232)
* attempt #11 to role_include

* fixes from jimi-c

* do not override load_data, move all to load

* removed debugging

* implemented tasks_from parameter, must break cache

* fixed issue with cache and tasks_from

* make resolution of from_tasks prioritize literal

* avoid role dependency dedupe when include_role

* fixed role deps and handlers are now loaded

* simplified code, enabled k=v parsing

used example from jimi-c

* load role defaults for task when include_role

* fixed issue with from_Tasks overriding all subdirs

* corrected priority order of main candidates

* made tasks_from a more generic interface to roles

* fix block inheritance and handler order

* allow vars: clause into included role

* pull vars already processed vs from raw data

* fix from jimi-c blocks i broke

* added back append for dynamic includes

* only allow for basename in from parameter

* fix for docs when no default

* fixed notes

* added include_role to changelog
9 years ago
Peter Sprygada eac7caefd8 add commit keyword arg to load_config method
this adds a new keyword arg to the load_config method that will control
whether or not a loaded configuration is committed on the device
9 years ago
Michael Scherer a30f545a62 Do not convert Nonetype to "None" (#17261)
If someone use a task with a empty name like this:

  - name:
    command: true

This will result in displaying 'None' as a task name instead of
'command'.
9 years ago
Brian Coca 1139d61d59 simplified logic paths 9 years ago
Patrik Lundin b4f338bca7 Add OpenBSD virtualization facts. (#17227)
* Add OpenBSD virtualization facts.

Patch written by @jasperla.

Tested by various people on:
- virtualbox
- vmware esx(i) + fusion
- kvm (smartos + plain linux + a random cloud provider)

This patch is already present in the OpenBSD port of ansible.

* Rework diff to get rid of extra returns.

Requested by @bcoca.

While here, use four-space indentations of all code blocks.

* Set facts even if no match is found.

Discussed with @bcoca.

* Find sysctl via get_bin_path().

Requested by @bcoca.

* Fail if we do not find a sysctl binary.

* Do not fail if a sysctl binary is not found.

Just set empty fact values instead.
Requested by @bcoca.
9 years ago
Abhijit Menon-Sen b4a035718e Make _display_plugin_load much less noisy
There was general consensus that displaying every plugin load on -vvv
was *way* too noisy. This commit reformats the log message to be less
verbose, and drops it down to debugging-only level.
9 years ago
Alexander Stock 238cccf166 Fix "Text file busy" exception in atomic_move (#9526) (#17204)
tempfile.NamedTemporaryFile keeps a file handle causing os.rename() to fail with windows based vboxfs: [Errno 26] Text file busy.
Changed NamedTemporaryFile to mkstemp() and added a finally block to unlink the temp file in each and every case.
9 years ago
Michael Scherer a942758a07 Fix wrong error class (#17259)
AnsibleError is not imported in that file, and since that's
a parsing time issue, better raise AnsibleParserError like the
rest of the file.

Issue signaled on irc by gordon`
9 years ago
Toshio Kuratomi 4a3a9c0f2d Fix for run_command on py3 and enable lineinfile test on py3 (#17257)
* run_command needed a bit of tweaking to its string handling of
  arguments.
* The run_command change fixes the last bit of lineinfile so we can
  enable its tests
9 years ago
Toshio Kuratomi 9ac20e231d Update core submodule to pull in lineinfile py3 fix 9 years ago
Toshio Kuratomi f57f33a8e7 Fix fetch idempotence (#17255)
Fetch always follows symlinks when downloading so it needs to always
follow symlinks when getting the checksum of the file as well.
9 years ago
Peter Sprygada fb9b98a543 Merge pull request #17254 from privateip/netcli
adds new property command_string to Command object
9 years ago
Peter Sprygada 9f1ac47f70 adds new property command_string to Command object
This adds a new property to the Command object that is used to hold
modified command strings that could be different from the command used
to create the object.  This allows for seamless switch between text and
json enabled commands.
9 years ago
Peter Sprygada 5036bba2e0 implements command_string property when preparing commands
* commands that need | json added now use command_string property
* adds additonal keyword args in exception handling for json commands
9 years ago
James Cammarata e375bfd6a5 Use post_validated play for serial calculations in TQM
Fixes #17185
9 years ago
Toshio Kuratomi 0a39700b36 Fix octal output in a few more places (#17250)
Fix filetree lookup plugin for python3 (octal output and selinux API
takes native strings)
9 years ago
Toshio Kuratomi 2dd5e13098 Update submodule refs 9 years ago
Toshio Kuratomi bd68c324ce Get the ssh plugin working with python3 (#17234) 9 years ago
Chris Faulkner dbab23e68f Fix context_demo callback plugin. (#17235) 9 years ago
Yann Autissier 8fd3935029 Fix get_distribution for Alpine Linux (#17224)
To override a generic class that is subclassed based on platform, the
subclass must define platform and distribution.

The load_platform_subclass() calls the get_platform() and
get_distribution() methods to detect the platform and the distribution.

On Alpine Linux, get_distribution() method returns None and it is not
possible to have different implementations based on detected platform.
9 years ago
Abhijit Menon-Sen 3ab9dddb3a Make the extract filter return Undefined on KeyError
groups['x']|map('extract', hostvars, 'somevar') would break if any host
didn't have 'somevar' set. With this change, it will return Undefined
instead. This change permits |map('extract', …)|map('default', 42) to
set a default value in such cases.
9 years ago
Peter Sprygada 24e8e3b03f initial add of shared modules for supporting Nokia SROS devices
This adds a cli transport, netcfg, and netcli implementations for working
with devices running Nokia SROS.  There is also an update to netcfg
to support the sros config file format.
9 years ago
Matt Clay 178292d2cd Fix file and copy modules on py3 and enable tests. (#17239)
- Fix octal formatting of file mode in module response on py3.
- Convert file path to unicode in copy action.
- Enable file and copy module tests for py3 now that they pass.
9 years ago
Toshio Kuratomi 44d979c8f5 Enable most unittests on python3 (just some vault unittests and a logging one left) (#17240)
Make some python3 fixes to make the unittests pass:

* galaxy imports
* dictionary iteration in role requirements
* swap_stdout helper for unittests
* Normalize to text string in a facts.py function
9 years ago
Abhijit Menon-Sen 1a62fe3874 Merge pull request #13739 from chrrrles/ipaddr_empty_string
ipaddr filter properly handle addresses on /31 networks
9 years ago
Peter Sprygada c7924ab04e Merge pull request #17231 from privateip/ios
update ios doc fragments
9 years ago
Peter Sprygada 09eda7e206 update ios doc fragments
removes invalid shared arguments from fragment
9 years ago
Toshio Kuratomi 7b4f808a21 One more izip_longest => zip_longest fix (#17229) 9 years ago
Toshio Kuratomi 51ec35378d xrange and izip_longest aren't available in vanilla python3 (#17226)
Fixes for these are either rewriting to get rid of the need for the
functions or using six.moves to get equivalent functions for both
python2 and python3
9 years ago
Yannig 27b0f3241b new filter human_bytes: convert a string (ex: 1Mo, 1K) into bytes (#12074)
* Rework human_readable and human_to_bytes.
New filter human_to_bytes.

* Fix for python 3.
9 years ago
Ansible Test Runner 733f977ad2 Update submodule refs for more python3 fixes 9 years ago
Nathaniel Case b70e49e749 Relicense module_utils/asa.py (#17223) 9 years ago
Toshio Kuratomi 89f91b1cd7 The former match for a section header included hosts that began with a range. (#17225)
Checking that the line ends with "]" narrows that window somewhat,

Fixes #15331
9 years ago
Toshio Kuratomi 5d865ec1ef Cleanup debug.py (#17222)
* Use isinstance instead of comparing to type.
* Change check against unicode type to check against six.string_types
  for python3 compatibility.
9 years ago
Nathaniel Case 8ac5896889 Provide options for SSH key checking (#15736)
* Provide options for SSH key checking
9 years ago
Peter Sprygada 8f79ea9b1d Merge pull request #17188 from Qalthos/asa_module
Update module_utils/asa.py with NetworkModule
9 years ago
Toshio Kuratomi 300d6482d1 Hashing needs byte strings in python3 (#17221)
First try at porting this passed in string-types as that worked on
python2.  Python3 is more strict so be explicit about converting from
text to bytes
9 years ago
Toshio Kuratomi e098c5ef82 Update submodule refs 9 years ago
Peter Sprygada ce6de1f64d Merge pull request #17220 from privateip/iosxr
updates iosxr shared module
9 years ago
Peter Sprygada fa0d39a1b4 updates iosxr shared module
This completes the refactor of the iosxr 2.2 shared module.  It also
includes the iosxr_config action plugin to be implemented by the
iosxr_config module for 2.2
9 years ago
Chris Houseknecht f717786949 Merge pull request #17202 from chouseknecht/devel
Local variable *choices* referenced before assignment
9 years ago
Toshio Kuratomi 040a38171a Clean up task_executor for python3 (#17219)
ran task_executor through python-modernize and then made changes to the
code pointed out by it:

* Most places where we looped through dict.keys() changed to
      for key in dict:
  Using keys() in python2 creates a list() of keys.  For iterating, we
  can iterate over the dict itself and we'll be handed back each key.
  In python3, doing it this way does not create a new list and thus is
  more memory efficient.
* In one place, use:
      for key in list(dict.keys()):
  because we're deleting elements from the dictionary inside of the
  loop.  So we really do need to iterate over a separate list of the
  keys to avoid modifying the dictionary that we're iterating over.
  (Fixes Python3 bug)
* In one place, change the order of an if-elif-else tree so that the
  most frequent cases are evaluated first. (Optimization)
9 years ago
Peter Sprygada 90ef5bf4a6 updates vyos shared module and moves functions into vyos_config
This update moves many of the functions into the vyos_config
module to conform with the network 2.2 refactor.  This also
fixes the load_config method
9 years ago
Toshio Kuratomi 72cda8ffd7 Update submodule refs 9 years ago
Toshio Kuratomi 58b9f637a1 Workaround for Ubuntu Python3 looking for modules in wrong places (#17211)
* Workaround for Ubuntu Python3 looking for modules in wrong places

* More exact ubuntu version numbers
9 years ago
nitzmahone a9322e8b8b py3-friendly multi-exception fix for missing fileno under debugger 9 years ago
Adrian Likins e396d5d508 Implement vault encrypted yaml variables. (#16274)
Make !vault-encrypted create a AnsibleVaultUnicode
yaml object that can be used as a regular string object.

This allows a playbook to include a encrypted vault
blob for the value of a yaml variable. A 'secret_password'
variable can have it's value encrypted instead of having
to vault encrypt an entire vars file.

Add __ENCRYPTED__ to the vault yaml types so
template.Template can treat it similar
to __UNSAFE__ flags.

vault.VaultLib api changes:
    - Split VaultLib.encrypt to encrypt and encrypt_bytestring

    - VaultLib.encrypt() previously accepted the plaintext data
      as either a byte string or a unicode string.
      Doing the right thing based on the input type would fail
      on py3 if given a arg of type 'bytes'. To simplify the
      API, vaultlib.encrypt() now assumes input plaintext is a
      py2 unicode or py3 str. It will encode to utf-8 then call
      the new encrypt_bytestring(). The new methods are less
      ambiguous.

    - moved VaultLib.is_encrypted logic to vault module scope
      and split to is_encrypted() and is_encrypted_file().

Add a test/unit/mock/yaml_helper.py
It has some helpers for testing parsing/yaml

Integration tests added as roles test_vault and test_vault_embedded
9 years ago
nitzmahone dbf7df4439 fix pycharm debugger issue on missing fileno
Under pycharm debugger, stdin has no fileno, but throws AttributeError instead of ValueError. Account for both.
9 years ago
Peter Sprygada 2a61fa0e79 Merge pull request #17200 from privateip/netcfg
removes invoke method from Config class
9 years ago
chouseknecht fdb5ecd7d1
Fixes 'choices referenced before assignment' error on line #287. 9 years ago
Toshio Kuratomi a22909c226 Migrate basestring to a python3 compatible type (#17199) 9 years ago