Commit Graph

707 Commits (9abb1070440337b209433843805e39a7c51b4fee)

Author SHA1 Message Date
Toshio Kuratomi d32a885e98 Make return invocation information so that our sanitized copy will take precedence over what the executor knows. 2015-12-19 11:24:59 -08:00
Toshio Kuratomi 1116bc6ca6 Merge pull request #13191 from Jmainguy/mysql
Add shared connection code for mysql modules
2015-12-16 10:47:49 -08:00
Jonathan Mainguy 34e88e48a5 Add shared connection code for mysql modules 2015-12-16 13:36:18 -05:00
Toshio Kuratomi 7d519127fe Merge pull request #13573 from ansible/ssl-context-with-proxy
Fix a few problems with url handling.
2015-12-16 08:00:59 -08:00
Toshio Kuratomi 33863eb653 Conditionally create the CustomHTTPSConnection class only if we have the required baseclasses.
Fixes #11918
2015-12-16 07:47:09 -08:00
Toshio Kuratomi 72a0654b81 Fixes for proxy on RHEL5 2015-12-16 07:47:07 -08:00
Toshio Kuratomi 73ead4fbba First attempt to fix https certificate errors through a proxy with python-2.7.9+
Fixes #12549
2015-12-16 07:46:54 -08:00
Toshio Kuratomi d203438a2c Merge pull request #13554 from Yannig/devel_fix_python3_tests
Use six lib to import urlparse properly.
2015-12-15 07:55:56 -08:00
Brian Coca a0842781a6 renamed ssh.py shared module file to clarify 2015-12-15 08:45:12 -05:00
Yannig Perré be4d1f9ee3 Fix a part of python 3 tests (make tests-py3, see https://github.com/ansible/ansible/issues/13553 for more details). 2015-12-15 13:37:35 +01:00
Peter Sprygada 27cd7668c1 the ssh shared module will try to use keys if the password is not supplied
The current ssh shared module forces only password based authentication.  This
change will allow the ssh module to use keys if a password is not provided.
2015-12-15 07:16:28 -05:00
Michael Scherer a7ac98262d Make module_utils.known_hosts.get_fqdn work on ipv6 2015-12-14 19:30:54 +01:00
James Cammarata 80d23d639c Use an octal representation that works from 2.4->3+ for known_hosts 2015-12-14 10:43:30 -05:00
James Cammarata 6312e38133 Fixing up some non-py3 things for unit tests 2015-12-14 10:35:58 -05:00
Charles Paul a6a58d6947 fix default host for non vcd service types 2015-12-10 16:39:27 -05:00
David L Ballenger cdc3c88018 Merge remote-tracking branch 'ansible/devel' into issue_13438 2015-12-08 07:42:49 -08:00
Peter Sprygada 2d5b4b1799 Merge pull request #13273 from privateip/nxapi
adds new device argument to nxapi command arguments
2015-12-08 10:24:07 -05:00
David L Ballenger 970d7cadb7 Add ssh_host support for MacOSX El Capitan.
OS X El Capitan moved the /etc/ssh_* files into /etc/ssh/. This fix
adds a distribution version check for Darwin to set the keydir
appropriately on El Capitan and later.
2015-12-08 07:11:02 -08:00
Brian Coca 17b334d4a5 Merge pull request #13450 from privateip/feature_ios_shared_module
bugfix for ios.py shared module argument creation
2015-12-07 09:59:04 -05:00
Peter Sprygada 41773630ed adds new device argument to nxapi command arguments
The device argument allows a dict of nxapi parameters to be passed to
the module to simplify passing the nxapi parameters
2015-12-05 22:51:40 -05:00
Toshio Kuratomi c8fd599e14 Merge pull request #13373 from no2a/boolean
BOOLEAN should contain boolean literals
2015-12-04 12:17:12 -08:00
Peter Sprygada 29f5c5db71 bugfix for ios.py shared module argument creation
This patch fixes a bug in module_utils/ios.py where the the wrong shared
module arguments are being generated.  This bug prevented the shared module
from operating correctly.  This patch should be generally applied.
2015-12-03 12:53:07 -05:00
Toshio Kuratomi 9b81c35d06 Don't compare or merge str with unicode
Fixes #13387
2015-12-02 20:53:50 -08:00
Peter Sprygada 2491afc8b6 fixes a syntax issue with module_utils/eapi.py
This patch fixes an issue with the common args dict in the eapi shared
module.  This patch is required for the eapi shared module to be properly
imported and is therefore should be applied to all instances.
2015-12-01 23:34:59 -05:00
Brian Coca 8c630406c9 Merge pull request #13357 from privateip/feature_ssh_shared_module
initial add of ssh shared module.
2015-12-01 19:15:03 -08:00
Brian Coca 923b5467e3 Merge pull request #13354 from privateip/feature_eapi
adds device common argument to shared module
2015-12-01 19:14:07 -08:00
Brian Coca 574d7be8d5 Merge pull request #13358 from privateip/feature_ios_shared_module
Feature ios shared module
2015-12-01 19:04:24 -08:00
Peter Sprygada 93cd7a2a5f adds module create function for eapi.py shared module
This commit changes the way modules create an instance of AnsibleModule to
now use a common function, eapi_module.  This function will now automatically
append the common argument spec to the module argument_spec.  Module
arguments can override common module arguments
2015-12-01 20:00:41 -05:00
Peter Sprygada 8638e0ccf8 initial add of the ios shared module
This adds shared module support for building modules that connect to Cisco
IOS devices.  It builds on the module_utils/ssh.py shared module.
2015-12-01 19:55:41 -05:00
Toshio Kuratomi 30094912eb boto is expecting that we pass it unicode strings.
The secret_key parameter especially can contain non-ascii characters and
will throw an error if such a string is passed as a byte str.

Potential fix for #13303
2015-12-01 07:03:57 -08:00
Arata Notsu 6d6d4f0c8e BOOLEAN should contain boolean literals
It is natural that an argument_spec with choises=BOOLEAN accepts
boolean literal (True, False) though the current implementation
allows only string or int.
2015-12-01 23:51:39 +09:00
Toshio Kuratomi 19d5759771 raise AnsibleAWSError instead of StandardError.
* StandardError doesn't exist in python3
* because it is the root of builtin expections, we can't catch it
  separate from the builtin exceptions
* It doesn't tell us anything about the error being thrown as it's too
  generic
2015-11-30 19:05:33 -08:00
Toshio Kuratomi e2ddc2f6ab Call the function :-)
Fixes #13330
2015-11-30 12:34:20 -08:00
Peter Sprygada c087160652 initial add of ssh shared module.
This ssh shared module is used for building modules that require an
interactive shell environment such as those required for connecting
to network devices
2015-11-29 21:48:52 -05:00
Brian Coca db27541a0e Merge pull request #13053 from Etherdaemon/fix_13010_boto3_aws_profile
Fixes #13010 by updating boto3 methods
2015-11-16 09:46:26 -08:00
nitzmahone 4163655099 fix gce module error reporting
Error reporting was broken for GCE modules- pprint didn't work with exceptions, so you'd always get "Unexpected response: {}" instead of the real error.
2015-11-12 16:30:46 -08:00
Peter Sprygada 2e98f7f429 add initial support for Arista eAPI
This commit adds the shared module support for Arisat EOS devices
running eAPI.  The shared module builds on top of module_utils/urls.py.
2015-11-10 07:59:59 -06:00
Etherdaemon 27398131cf Fixes #13010 by updating boto3 methods to update boto3_conn to check for profile_name and if detected, remove from params and set a new variable of profile which is passed into Session separately 2015-11-10 15:22:07 +10:00
Brian Coca 37ae243587 made get_file_lines rely on get_file_content which deals with many error
conditions that the former did not.
2015-11-10 13:22:45 -08:00
ghislainbourgeois eb850d7e5b Fix get_dns_facts on inexistent resolv.conf 2015-11-09 15:02:03 -05:00
Brian Coca 240acb1924 Merge pull request #13092 from privateip/nxapi
initial shared module support for nxapi
2015-11-09 08:43:30 -08:00
Peter Sprygada f88273eb87 changes the nxapi argument spec to require url_password 2015-11-09 09:45:26 -05:00
Peter Sprygada d3d36eb766 fixes conditional statement for py24 compatibility 2015-11-09 09:36:17 -05:00
Peter Sprygada 64e139adb1 add initial support for Cisco NXAPI
This commit adds the shared module support for Cisco NXAPI.  The shared
module builds on top of the urls shared module.  The urls module provides
the http/s transport.  This module only supports the JSON request message
format.
2015-11-09 09:18:38 -05:00
Rene Moser 1d59caed07 cloudstack: change order of tags handling, fixes update of tag value does not work 2015-11-08 20:27:01 +01:00
Rene Moser 3410a855b0 cloudstack: use jop polling in tag handling, fixes outdated tags returned.
In some cases the async job did not finish fast enough, causing returning an unexpeded result.
2015-11-08 20:23:06 +01:00
Alexander Gubin 215fc12234 Add SLES_SAP as a Suse family 2015-11-06 09:42:39 +01:00
Toshio Kuratomi 9ce3adbeb1 remove assigned but unused variables in module_utils.
These were mostly saving exceptions but not using them.  Getting rid of
those will help with eventually running modules via either python2.4 or
python3.x.
2015-11-03 09:53:18 -08:00
Toshio Kuratomi c08648999d Remove some more unused stdlib deps. 2015-11-03 09:53:18 -08:00
Eric Johnson dfad7c64fb Allow PATCH to list of valid HTTP methods 2015-11-03 17:38:52 +00:00
Brian Coca 8d3da20302 fixed bsd service_mgr_facts using removed check_init fucntion 2015-11-03 11:43:50 -05:00
Brian Coca eb04650ffb Merge pull request #12162 from bcoca/service_mgr_facts
fact gathering service_mgr info
2015-11-02 15:34:43 -05:00
Brian Coca a1a5dadef6 remove uneeded module 2015-11-02 15:36:11 -05:00
Toshio Kuratomi 3219744d32 One more stdlib import in module_utils 2015-11-02 12:25:18 -08:00
Brian Coca d194e2c788 check_systemd is not inline but a private fact function now 2015-11-02 15:23:47 -05:00
Brian Coca e9efd008ed moved distutils import to mac, darn solaris would complain in certain cases 2015-11-02 15:23:47 -05:00
Brian Coca 99d775a0c1 fact gathering service_mgr info
also added dragonfly facts support
2015-11-02 15:23:47 -05:00
Toshio Kuratomi 1bc75374dc Add imports for stdlib modules that are used.
This is cleanup that will aid us when we get ziploader implemented for 2.1
2015-11-02 12:02:26 -08:00
Rene Moser c09a34bb10 cloudstack: clean up unneeded ";" 2015-11-01 17:13:46 +01:00
Brian Coca f528ad1848 added xbps pkg mgr to facts 2015-10-31 22:03:12 -04:00
James Cammarata 0e447e3f41 Merge branch 'devel' of https://github.com/mathieumd/ansible into mathieumd-devel 2015-10-21 13:59:51 -04:00
Toshio Kuratomi 6e5055e786 Update the use of no_log values to cover everything that heuristic_log_sanitize does.
Fixes #12792
2015-10-21 08:15:46 -07:00
gduke 744679601f Remove mutable default arguments. 2015-10-20 22:13:23 -07:00
Toshio Kuratomi c2d188baff Hide values in json returns which were given in parameters marked no_log. 2015-10-20 12:42:36 -07:00
Mathieu 260a3e5ce7 Fixes #11055 - Set locale via LC_ALL 2015-10-19 21:25:30 +02:00
Toshio Kuratomi 28c933ce5e properly fail_json when we don't have ssl on a non-redhat distro 2015-10-16 08:06:32 -07:00
Brian Coca c57200925f made syslog import optional as intel's edison custom compiles python w/o it 2015-10-14 09:12:02 -04:00
Toshio Kuratomi 15d7f53846 AnsibleModules.log() fix for python3
Also add unittests for AnsibleModules.log()

Fixes #12586
2015-10-12 13:30:27 -07:00
Charles Paul 3d533cb423 fixing calls to fail_json 2015-10-12 08:50:18 -05:00
Brian Coca 50372eecc9 Merge pull request #12455 from privateip/devel
added methods for retrieving vapp and vm
2015-10-12 09:37:47 -04:00
Brian Coca ec02b255c3 Merge pull request #12689 from soarpenguin/bugfix
Remove some warning of undefined name and fix classmethod syntax error.
2015-10-09 11:09:50 -04:00
Shayne Clausson 55b3f9e4e5 Use AWS_DEFAULT_REGION env var if none specified 2015-10-09 10:27:36 +02:00
soarpenguin 5efa4d29e3 fix some warning of undefined name. 2015-10-09 12:43:42 +08:00
= 345ce424c6 Explictly set the version of strict mode to use for powershell modules. 2015-10-07 06:24:37 +01:00
Peter Sprygada ab3239ecd7 added methods for retrieving vapp and vm 2015-10-02 18:01:35 -04:00
Brian Coca 1a56a5c442 created debug method, renamed debug attribute to _debug 2015-10-01 10:17:41 -04:00
Toshio Kuratomi 4cfcf5d61b Merge pull request #12568 from mgedmin/py3k
Python 3: fix most tests for ansible.module_utils.basic
2015-09-30 12:47:29 -07:00
Trond Hindenes 94cfbe7ee9 Get-AnsibleParam 2015-09-30 21:02:12 +02:00
Marius Gedminas cc1e1648f5 Tweak comment style 2015-09-30 18:46:50 +03:00
Marius Gedminas 213029a21e Python 3: don't convert unicode to unicode 2015-09-30 18:46:49 +03:00
Marius Gedminas c7be004c19 Python 3 has no dict.iteritems()
(Reminder: cannot use six here, module_utils get shipped to remote
machines that may not have six installed -- besides six doens't support
Python 2.4.)
2015-09-30 18:46:49 +03:00
Marius Gedminas 9f3e5ceb14 Make sure 'basestring', 'bytes' and 'unicode' are defined
Python 3 doesn't have 'basestring' and 'unicode'.

Python 2.4 doesn't have 'bytes'
2015-09-30 18:40:47 +03:00
Brian Coca ddafed4403 Merge pull request #12528 from bcoca/task_logging
task logging revamp
2015-09-30 11:38:34 -04:00
Brian Coca 7b64126c9d pushed up openvz detection for cases of 'stacked' virtualization 2015-09-30 11:27:50 -04:00
Linus Unnebäck 45f9800754 facts: correctly detect docker inside a xen host 2015-09-30 17:08:21 +02:00
Konstantin Manna 4226e49bc6 bugfix: statement had no effect => statement now has assumed effect 2015-09-28 23:33:48 -04:00
Brian Coca 8d024c3747 Merge pull request #12472 from resmo/for_ansible
cloudstack: improvements and tests
2015-09-28 14:27:22 -04:00
Toshio Kuratomi 056a020357 Do not fail if /proc/uptime is not present
This can happen in chroot environments that don't have all of /proc
available
2015-09-26 10:00:28 -07:00
Brian Coca 37a918438b task logging revamp
* allow global no_log setting, no need to set at play or task level, but can be overriden by them
 * allow turning off syslog only on task execution from target host (manage_syslog), overlaps with no_log functionality
 * created log function for task modules to use, now we can remove all syslog references, will use systemd journal if present
 * added debug flag to modules, so they can make it call new log function conditionally
 * added debug logging in module's run_command
2015-09-25 23:57:28 -04:00
Brian Coca 191ae0831d fixed syntax error 2015-09-25 17:15:26 -04:00
Brian Coca 48412c13b2 fixed copy n paste typo on future code 2015-09-25 17:08:03 -04:00
Brian Coca 1c49e3b842 draft shared service code for modules, part of spliting service module 2015-09-25 11:26:21 -04:00
Toshio Kuratomi dcdcd9e9c5 Move is_executable to the toplevel of basic.py so we can utilize it from other code 2015-09-25 07:48:57 -07:00
Gerben Geijteman 4c20964475 Add Weekday (0-6) as a number and add weeknumber (00-52) 2015-09-24 15:05:44 +02:00
Marius Gedminas 2c4982b58d Python 3: there's no itertools.imap
Because the builtin map() acts like an iterator already.
2015-09-23 10:04:26 +03:00
Marius Gedminas 6708d56a21 Python 3: avoid long integer literals
Even Python 2.4 automatically promotes int to long.
2015-09-23 10:04:25 +03:00
Marius Gedminas f5d4935197 Python 3: treat python as a function in module_utils/basic.py
NB: we can't use 'from __future__ import print_function', but luckily
print(one_thing) works fine on both Python 2 and Python 3 without that.
2015-09-23 10:04:25 +03:00
Marius Gedminas e71a986e16 Python 3: avoid octal constants in module_utils/basic.py 2015-09-23 10:04:25 +03:00
Marius Gedminas d2bec7f81f Python 3: avoid "except ..., e:" in module_utils/basic.py
Make the code compatible with Pythons 2.4 through 3.5 by using
sys.exc_info()[1] instead.

This is necessary but not sufficient for Python 3 compatibility.
2015-09-23 10:04:25 +03:00
Rene Moser b43939dfd6 cloudstack: make tags handling idempotence
Credits to @jeffersongirao, who provided the patch.
2015-09-22 16:12:35 +02:00