Commit Graph

926 Commits (1aa39ae78bc0c3cbb36e2ee6dfa658b98e17024c)

Author SHA1 Message Date
Toshio Kuratomi 7833b5bec4 Merge pull request #15420 from robinro/distribution_version_tests
Distribution version tests
10 years ago
Brian Coca 621b98668f fixed boto.ec2 import
alternative to #15224 and fixes #11755
10 years ago
Ritesh Khadgaray 3608829b1b vmware.py: allow for better search functionality (#15053)
- search entity by path
 - search vm based on folder
 - search for a vm based on given id ( uuid/name/dns_name/ip/inventory_path)
 - search for a cluster by name, in a given datacenter (optionally)
 - search for objects of a given type in a folder

Note: instance uuid is unique to a VM
10 years ago
chouseknecht ea07afe67b
Add missing AD user params. 10 years ago
chouseknecht 47620737fb Adding common utils module for new Azure modules. 10 years ago
Matt Martz a985bf6a31 Don't pass context to urlopen, instead add it to the handlers. Fixes https://github.com/ansible/ansible-modules-core/issues/3437 10 years ago
Robin Roth 37188ea336 cleanup tests
* use nose test generator
* more comments
* move facts import inside the skipped function, fix python3 warning
10 years ago
Robin Roth 2b104fe6ad fix tests for SLES and CoreOS
* include #15230
10 years ago
Brian Coca 7062e086d4 made paging marker configurable as boto differs 10 years ago
Patrick Ogenstad 6c5ea685a2 Allow timeout to be configurable (#14973) 10 years ago
Toshio Kuratomi 78365e206f Merge pull request #15059 from willthames/remove_boto_ec2_requirement
Remove need for unnecessary boto.ec2 import
10 years ago
Brian Coca a5a6bcfbbf updated capabilities to new way of module ref 10 years ago
Michael Scherer 74c83a91ed Add caps facts, fix #10360 (#15292) 10 years ago
Wolfgang Karall 7a9b8e43da get_mount_facts -- find bind mounts and add info to options field (#12036)
* get_mount_facts -- find bind mounts and add info to options field

* get_mount_facts -- only run findmnt if get_bin_path() finds the binary
10 years ago
Toshio Kuratomi 55bb24fb7d Reenable unicode=>byte conversion for module parameters to fix integration tests 10 years ago
Toshio Kuratomi 75546678d9 Fix unittests 10 years ago
Toshio Kuratomi b571ecdfec Move module arg passing from the environment to stdin (from the wrapper to the module) 10 years ago
Nathaniel Case 7290b6282d Update IOS, IOSXR, JUNOS, & OpenSwitch for environment vars. 10 years ago
Nathaniel Case dbc49ad95b First implementation of 'fallback' parameter
Implemented & documented for EOS & NXOS
10 years ago
Bjørnar Ness d868cdc7b8 enable mysql connection via unix socket 10 years ago
Matt Martz dd39f57ae7 Merge pull request #15289 from sivel/sni-urllib3-contrib-try2
Optional Use of urllib3 for SNI verification
10 years ago
Toshio Kuratomi a57a32adcc Revert "Make the 'path' param type also use abspath on the value"
This reverts commit 1ffadbcc80.

Some modules seem to have path listed for things that are "commands"  --
something that may be a path to a command or a bare command that should
be looked up in PATH.  With this change, if they were formerly looked up
inPATH they are now being made into an absolute path in the cwd.
Reverting this until we can think more about whether to do this and
change those modules to not use path for those parameters.
10 years ago
James Cammarata 1ffadbcc80 Make the 'path' param type also use abspath on the value 10 years ago
Nathaniel Case 77e3dc9e6a Fix network modules for ziploader changes 10 years ago
Matt Martz 398218b6ea More intelligent building of the SSLValidationError message based on capabilities 10 years ago
Matt Martz 6e9c09d7f7 Utilize urllib3.contrib.pyopenssl functionality for SNI capability in python versions lacking SNI support
Also add SNI tests, move test_uri to destructive since we are messing with packages for SNI testing
10 years ago
Peter Sprygada 72ce1e8f14 bugfix eos shared module handling config replace
fixes an issue with doing a config replace using eapi where the configuration
wasn't being replaced.
10 years ago
Peter Sprygada b97c8ce8e7 bugfix netcfg return config as str
fixes issue where netcfg would return out of order configuration
10 years ago
Toshio Kuratomi 4b0aa1214c Ziploader
* 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
10 years ago
Peter Sprygada cca084c89d enhancement to ios shared module connection
this enhancement will cause the module to connect to the remote ios device
the first time a command wants to run instead of building a connection
immediately
10 years ago
Peter Sprygada c2fac6c808 enhancement to iosxr shared module to lazy connect to device
this update will only connect to the remote device when the first request
is made to run a command instead of building the connection immediately
10 years ago
Peter Sprygada 39a576697d feature to localize prompt search login to iosxr shared module
this localizes the cli prompt search logic to the iosxr shared module
instead of using the common regexp list in shell.py
10 years ago
Peter Sprygada 73c3f35112 fixes ansible/ansible-modules-core#3304 10 years ago
Peter Sprygada 17f4db19ea adds additional details in exception handling in shell shared module 10 years ago
Peter Sprygada f5bcd38380 adds additional details in exception handling to ios shared module 10 years ago
Peter Sprygada 008395eda2 bugfix for nxos shared module to not immediately send \n
this fixes a bug in nxos shared module to not immediately send a \n when
the connection is made.  this commit also localizes the prompt handling
to the nxos module
10 years ago
Peter Sprygada 4e497b10b0 bugfix in netcfg to handle multilevel commands
this fixes a bug where netcfg would not properly find a statement that was
more than one level deep
10 years ago
Peter Sprygada c0230e6f12 refactors netcfg to pull common functions into shared library
The network config and template modules share a set of common functions that
have been pulled into the netcfg shared module.  This is backwards compatible
with the current implemention in the modules.
10 years ago
Peter Sprygada 437beb001b adds commands key to fail message in eos shared module
The commands the lists the set of commands it tried to configure when
using eapi as a transport
10 years ago
Brian Coca e1461ef792 Merge pull request #15200 from wimnat/feature/handle_lists_in_snake_dict_creation
Handle lists during dict recursion
10 years ago
René Moser c0618794a2 Merge pull request #15213 from resmo/fix/cloudstack-api-secret-arg
cloudstack: fix bug, api_secret always None
10 years ago
Rene Moser 65e61e340a cloudstack: fix bug, api_secret always None
In case if api args are used, api_secret is None in every cloudstack module.
10 years ago
Nathaniel Case e4e913b331 Override params from environment variables, if set.
Fix a typo while I'm in the area.

Handle having None set in module.params more intelligently
10 years ago
Brian Coca c09e085480 Merge pull request #14735 from jsok/open_url-netrc
Lookup netrc for credentials in open_url
10 years ago
Rob White a46de20772 Handle lists during dict recursion 10 years ago
Peter Sprygada fa6464e807 feature to localize prompt search logic for ios shared module
Prompt search logic is now localized to the ios shared module instead
of using the common regexps in the shell module.  This resolves a number
of problems with ios modules functioning properly
10 years ago
Rob White a5b05922ed Some helper functions to work with boto3 10 years ago
Rob White ef8c1124d0 Add function to convert CamelCased key names to snake_names 10 years ago
Brian Coca fdb56e4bad avoid bad path entries 10 years ago
Toshio Kuratomi 917da92e2b Get rid of extra trailing space in log messages 10 years ago
Matthew Gamble 197e590d7c Small comment improvement in AnsibleModule class 10 years ago
Peter Sprygada 5bb876b0e2 fixes issue with getting value with . (dot) in key in netcfg
This commit addresses a problem when attempting to retrieve a value from
the result that includes a dict key using . (dot).
10 years ago
Brian Coca b4b44b2708 Merge pull request #15086 from robinro/patch-2
remove double read of "path" (/etc/SuSE-release) in facts.py
10 years ago
Robin Roth 2c28dcc5cb break after parsing SuSE-release in facts.py
All sections that lead to succesful parsing of the version break afterwards, for SuSE-release this break was missing, potentiall causing #14837
10 years ago
Robin Roth fea5500605 remove double read of "path"
path is already read in line 444, don't reread the file here, but use the existing content
10 years ago
Will Thames f438c074af Remove need for unnecessary boto.ec2 import
Modules shouldn't need to import boto.ec2.
The check was to test if profile_name was supported by boto.
Two years after the introduction of the support, we will now
assume that if people are passing `profile`, they are using
a version of boto that supports it (this requirement is
already documented in the aws documentation fragment)

Also remove even older version check for `validate_certs`

Fixes #1901
10 years ago
RNanney 8bceff5136 Update nxos.py 10 years ago
Abhijit Menon-Sen efdac490ff Merge pull request #14924 from mvgrimes/patch-1
Dynamically add ssl key to the mysql config hash iff needed
10 years ago
Brian Coca d43fc631dd mount facts now include network mounts (nfs) 10 years ago
Abhijit Menon-Sen e5460d6a6e Merge pull request #15002 from camradal/devel
add find_host_portgroup_by_name function to vmware utils
10 years ago
James Cammarata 0e68c6d6fe Cleaning up use of literal_eval in basic.py AnsibleModule.safe_eval 10 years ago
Brian Coca 0cb804f0c2 fix lsb fact gathering
was erroring out when rc !=0 also fixed redundant paths
fixes #14965
10 years ago
Alexey Kalinin 9763e76f6f add find_host_portgroup_by_name function to vmware utils 10 years ago
Daniel Kempkens 696b68f07a 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
Toshio Kuratomi 66328e5200 Merge pull request #14967 from ansible/facts-subset-and-cleanup
Facts subset and cleanup
10 years ago
Brian Coca f3b9449e07 don't raise exceptoins on bad hosts files
fixes #14969
10 years ago
Peter Sprygada ace0c9c5c2 fixes ansible-modules-code#3250
Sets the default value for transport to 'cli'
10 years ago
Peter Sprygada c039ac524d updates to nxos shared module
This commit address a number of minor updates the nxos shared module

* connect() is now lazy loaded
* parse inner output messages when errored
* code syntax cleanup
10 years ago
Toshio Kuratomi 512825455e Make ohai and facter work via module_utils Fact classes rather than in the setup module 10 years ago
Toshio Kuratomi 5a1e35224b Make changes proposed during review of restrict fact gathering feature:
* Make documentation examples into code blocks
* Make code to call the subsets more general.
* Made min subset always execute (cannot disable it).
* Use a passed in modules parameter rather than global modules.  This is needed for ziploader
* Remove unneeded __init__()
* Remove uneeded multiple inheritance from a base class
* gather_facts is now a list type
10 years ago
Yannig Perré 88772b6003 Add a way to restrict gathered facts in Ansible:
- Using gather_subset options
- By ignoring ohai/chef or facter/puppet facts
10 years ago
Peter Sprygada d211b4c962 feature to implement localized cli prompts to eos
This change localizes the cli prompt regexps to the eos shared module
instead of the common prompts implemented in shell
10 years ago
Peter Sprygada 5338d6af28 feature in ios to tell shell not to kickstart
This commit is necessary to tell shell not to kickstart the cli session as
it causes problems in IOS to recognize the prompt.
10 years ago
Peter Sprygada 249caac0d3 feature to allow prompts to be configured at instatiation
This commit adds a new feature to allow implementations of shell to
specify the command prompt regexp to be used.  It allows adds a new
kwarg at instantiation to kick the remote device with a carriage return.
By default the kickstart flag is true but can be disabled by passing
kickstart=False.
10 years ago
Peter Sprygada c55d1c55af Merge pull request #14906 from devananda/fix-shell-for-junos
Send empty command before recv
10 years ago
Brian Coca 00b8b49112 Merge pull request #14873 from bcoca/paging_aws
paging for amazon modules
10 years ago
Brian Coca fdcd80bf87 Merge pull request #13339 from bcoca/retry_rate
draft of common retry and rate limiting decorators for api based modules
10 years ago
Peter Sprygada e3671a8a83 bugfix for eos shared module and new optimization
This commit address to issues in the eos shard module.  The first one
is a bug fix for returning the running config when the transport is eapi.
The shared module will now return config text instead of an object.  The
second is a optimization that delays when the eos module connects to the
remote devices.  This provies a performance enhancement when using
ssh since the module doesn't default to connecting immediately
10 years ago
mvgrimes e613737b80 Dynamically add ssl key to the mysql config hash iff needed
Just including the `ssl` key in the config for MySQLdb.connect, causes it to check for the existence of SSL support. This patch only adds the key if one of the ssl configuration options is included.
10 years ago
David Shrewsbury 336d19d3b0 Set type for OpenStack 'verify' param
The 'verify' param is a bool, so we don't want it to be an assumed
str.
10 years ago
Peter Sprygada a59fe25bb1 bugfix for shared module shell.py
removes get_cli_connection function which was left over from a refactor
but was no longer in use
10 years ago
James Cammarata 16f107a491 Add mysql connection_timeout param to module_utils/mysql.py 10 years ago
Devananda van der Veen 08f270ad71
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
Peter Sprygada ca2871de20 Merge pull request #14697 from privateip/shared_module_openswitch
bugfixes for openswitch shared module
10 years ago
Brian Coca 18e9bc9753 common retry and rate limiting decorators for apis
allows modules to wrap their request functions in common retry and rate limiting
decorators or functions
10 years ago
Brian Coca 33b550fc76 paging for amazon modules
this adds a decorator for use in amazon modules so retrieval functions
can page using the 'marker' that most boto functions return
10 years ago
Matt Martz 2f90a4f4e2 Strip proc_1 before testing it. Fixes #14858 10 years ago
Matt Martz 098333b2ec 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
Jonathan Sokolowski 5ec7adc64d Lookup netrc for credentials in open_url 10 years ago
Brian Coca 5aab158987 removed unused imports 10 years ago
Jay Jahns 3a1944edc1 add find_vm_by_name function to vmware utils 10 years ago
Brian Coca 62ac5c047e clarified message 10 years ago
Brian Coca 8867d73420 reject extraneous data passed to mode
strictly permissions are allowed, file type info should not be passed in
alternate fixes #14771
10 years ago
Brian Coca 27a33a6f18 dont erase previous nameservers in fact gathering
fixes #14806
10 years ago
Brian Coca 13282e29a8 Merge pull request #14500 from yfried-redhat/fix_os_auth
Fix openstack auth type
10 years ago
Toshio Kuratomi 468eea82bd Merge pull request #14765 from sivel/redirect-ssl-validation
Support SSL validation with redirect control for python versions without ssl context
10 years ago
Matt Martz 6ff0b079b4 Support SSL validation with redirect control for python versions without ssl context 10 years ago
James Cammarata 2c7a33f71d Fixing bug in setup related to StringIO fixes 10 years ago
James Cammarata 9acb5aa176 Changing location of reduce import to not use six.moves 10 years ago
James Cammarata b559d0e6ee Adding py3 stub for reduce from six.moves 10 years ago