Commit Graph

702 Commits (ea3177e24a820ca3d7e79c07ce4b299333f45bb4)

Author SHA1 Message Date
James Cammarata 3511e2dfeb Expanding unit tests for module_utils/basic.py 10 years ago
Devananda van der Veen f921306b9c Send empty command before recv
On some switches, starting an SSH connection and immediately calling
recv() will result in a connection timeout. The switch requires some
input on the channel before it provides any prompt.

As such, this patch sends an empty command immediately upon connection,
triggering the switch to send a prompt which the shell can then
interpret.

Signed-off-by: Devananda van der Veen <devananda.vdv@gmail.com>
10 years ago
Matt Martz 3ba54becd8 Fix redirects for get_url
* fetch_url shouldn't both accept follow_redirects and support follow_redircts via module.params
* Default follow_redirects for open_url should be 'urllib2'
* Add redirect test for get_url
10 years ago
Brian Coca d30c3b282b clarified message 10 years ago
Brian Coca 45d070ba3a reject extraneous data passed to mode
strictly permissions are allowed, file type info should not be passed in
alternate fixes #14771
10 years ago
Matt Martz 068e322610 Support SSL validation with redirect control for python versions without ssl context 10 years ago
James Cammarata 435924f3de Fixing bug in setup related to StringIO fixes 10 years ago
James Cammarata d5801d76e8 Changing location of reduce import to not use six.moves 10 years ago
James Cammarata e36834bd52 Adding py3 stub for reduce from six.moves 10 years ago
nitzmahone a74e97fa31 don't lock file when calculating checksum 10 years ago
Toshio Kuratomi 924fff7c85 Use io.StringIO and io.BytesIO instead of StringIO.StringIO for compat with py3 10 years ago
Matt Martz 4655ab88b3 Add RedirectHandler class and factory function for controlling redirects in urllib2 10 years ago
Brian Coca 45317ec205 fix lsb fact gathering
was erroring out when rc !=0 also fixed redundant paths
fixes #14965
10 years ago
Daniel Kempkens ca35822aaa Check return value of get_distribution()
On none-Linux systems `get_distribution()` returns `None`, which fails in `fetch_url`, because the return value of `get_distribution()` is not checked before calling `lower()` on the result.
10 years ago
Brian Coca ed4cf3d54b don't raise exceptoins on bad hosts files
fixes #14969
10 years ago
Matt Martz 8b52e57529 Strip proc_1 before testing it. Fixes #14858 10 years ago
Brian Coca 76bcb9d0e2 avoid basename on none 10 years ago
Brian Coca 3ee95f2d33 dont erase previous nameservers in fact gathering
fixes #14806
10 years ago
Etherdaemon 8b381ba248 Fixup boto3_conn as commit 6ea772931f broke commit 27398131cf 10 years ago
Brian Coca 0782f33f0f dont error out on new internal vars 10 years ago
Marc Pujol b399fd64d4 Avoid duplicate /bin/lsblk calls in the setup module.
The setup module calls /bin/lsblk once for each device appearing in the /etc/mtab file. However, the same device appears there mutliple times when the system uses bind-mounts. As a result, /bin/lsblk is being called repeatedly to get the uuid of the same device.

On a system with many mounts, this leads to a TimeoutError in the get_mount_facts function of the setup module as described in #14551.

Fixes #14551
10 years ago
Marcus Furlong 31ce8bc3a2 fix ansible_os_family fact on openSUSE Leap
ansible_os_family on openSUSE Leap has the wrong value:

        "ansible_os_family": "openSUSE Leap",

It should be:

        "ansible_os_family": "Suse",

This change fixes that by adding the relevant key and ensuring that dict
lookups replace ' ' with '_' so the key does not contain a space.
10 years ago
Brian Coca 1b88366905 really only want to prevent None typep here
false is sometimes needed
10 years ago
Brian Coca 83a08b2a64 avoid errors from possible None/False args 10 years ago
Brian Coca e5b5b78d3c hide internal params once used 10 years ago
Paul Calabro 233f4fc455 Adding a hyphen in the perms pattern section, since doing something like
go=- is a quick way to strip all permissions for non-owners.
10 years ago
Brian Coca 21ed250623 better init detection 10 years ago
Toshio Kuratomi 9c049b757f Revert "Module params should default to str in most cases."
This reverts commit 9fae8501e2.

Reverting for 2.0.1 -- this has been broken in the 2.0 tree for long
enough that some modules are relying on the broken behaviour.  This fix
will definitely return for 2.1.0 and may return in 2.0.2 (impact needs
to be evaluated).
10 years ago
Robin Roth eafc46512d fix typo 10 years ago
Robin Roth 39a53c5623 add ismount function from python Lib/posixpath.py
needed for https://github.com/ansible/ansible-modules-core/pull/2737
10 years ago
Toshio Kuratomi 9fae8501e2 Module params should default to str in most cases. 10 years ago
Etherdaemon fa88d0770c Proposed fix for ansible/ansible-modules-extras#1348 due to datetime.datetime type not being matched 10 years ago
Alexey Shabalin 9196a72c3f Add support ssh configs from /etc/openssh.
In Altlinux system config dir for openssh is /etc/openssh.
10 years ago
Toshio Kuratomi 76ab1d2afc Allow setting run_command environment overrides for the life of an AnsibleModule 10 years ago
Toshio Kuratomi a6c25f143a Explicitly set validate_certs=False as the boto default is True
Fixes #14089
10 years ago
Bernhard Lichtinger 8d7056220d Fix for SLES 11.4, which has now also an /etc/os-release file. 10 years ago
Matt Martz 3db2073909 Only use os.path.basename if get_file_content returned a value, and ensure that service_mgr has line endings stripped. Fixes #14026 10 years ago
Toshio Kuratomi 826f42a153 For synchronize, fix sudo to execute on the remote end of the connection
* In 2.0.0.x become was reversed for synchronize. It was happening on
  the local machine instead of the remote machine. This restores the
  ansible-1.9.x behaviour of doing become on the remote machine.
  However, there's aspects of this that are hacky (no hackier than
  ansible-1.9 but not using 2.0 features).  The big problem is that it
  does not understand any become method except sudo.  I'm willing to use
  a partial fix now because we don't want people to get used to the
  reversed semantics in their playbooks.
* synchronize copying to the wrong host when inventory_hostname is
  localhost
* Fix problem with unicode arguments (first seen as a bug on synchronize)

Fixes #14041
Fixes #13825
10 years ago
Alexey Shabalin d18cc79873 add detect Altlinux distributive 10 years ago
Toshio Kuratomi 63404821da rework run_command's env setting to not change os.environ for the rest of the module.
New param to run_command to modify the environment for just this invocation.
Documentation and comment adjustments.
10 years ago
Brian Coca 2ec31c2c79 fixed exception handling to be 2.4 compatible
previous 'fix' broke on 2.4
10 years ago
Rene Moser 1cae019c79 cloudstack: fix case insensitivity
cloudstack: fix has_change reports changed for case insensitivity values
10 years ago
Peter Sprygada 28fecc9ce1 bugfix in nxos shared module for including defaults 10 years ago
Peter Sprygada 2c647f18e5 bugfix in ios shared module for including defaults 10 years ago
Peter Sprygada 4e087bb14f bugfix in eos shared module for including defaults 10 years ago
Peter Sprygada 0681c2fd8f deletes nxapi from shared modules
The nxapi module has been superseded by the nxos shared module and is not longer needed. This commit removes (deletes) nxapi from module_utils.  All custom modules that have used nxapi should be using nxos instead.
10 years ago
Peter Sprygada 4a6235e320 adds network config file parser to shared modules
This commit adds a new shared module that parses network device configuration
files.  It is used to build modules that work with the various supported
network device operating systems
10 years ago
Peter Sprygada 94f13c7271 adds shared module shell for creating cli based transports
This commit add a new shared module shell that is used to build connections
to network devices that operate in a CLI environment.  This commit supercedes
the issh.py and cli.py commits and removes them from module_utils.
10 years ago
Peter Sprygada 93eb60161c initial add of openswitch shared module
This commit adds a new shared module openswitch for building modules that
work with OpenSwitch.  This shared module supports connectivity to
OpenSwitch devices over SSH, CLI or REST.  It also adds an openswitch
documentation fragment for use in modules
10 years ago
Peter Sprygada 2f1fc85002 adds shared module nxos for building cisco nxos modules
This commit refactors the nxapi into a new shared module nxos that supports
connectivity over both ssh (cli) and nxapi.  It supercedes the nxapi shared
module and removes it from module_utils.  This commit also adds a
documentation fragement supporting the nxos shared module
10 years ago