Commit graph

6974 commits

Author SHA1 Message Date
Kei Nohguchi
2043c32551 openswitch.py: Fix the OpenSwitch REST authentication
It's a cookie based authentication, that we get it
through /login endpoint, called by connect() method
and save the cookie for the rest of the call.
2016-05-18 00:17:32 -07:00
Toshio Kuratomi
73a2bddf84 Update submodule refs 2016-05-17 10:51:14 -07:00
Peter Sprygada
7cb7132b24 Merge pull request #15891 from privateip/fixes-ansible-modules-core-3502
bugfix for issue with trying to eval contains with non-string
2016-05-17 06:43:42 -04:00
Michael Scherer
fb2355e47d Port rax.py to python3 compatible syntax (#15875)
Since the pyrax website say that only python 2.7 is tested,
I do not think it is worth to aim for python 2.4 compatibility
for the various rackspace modules.
2016-05-16 17:30:25 -07:00
Peter Sprygada
83d0a15588 bugfix for issue with trying to eval contains with non-string
fixes ansible/ansible-modules-core#3502
2016-05-16 14:54:26 -04:00
Brian Coca
c648c95eb7 made format more flexible and allow for non dict entries 2016-05-16 14:39:49 -04:00
Peter Sprygada
8f7c879574 Merge pull request #15629 from privateip/fix-15496
make netcfg preserve command order
2016-05-16 13:59:46 -04:00
Rob
ba63ccb880 Handle case of both Key and key (#15468) 2016-05-16 12:19:41 -04:00
Michael Scherer
8680cc7156 Fix pkgin detection on NetBSD 6 and 7 (#15834)
Since this is now the default package manager, it got moved
to another location on Netbsd :

  netbsd# type pkgin
  pkgin is a tracked alias for /usr/pkg/bin/pkgin
  netbsd# uname -a
  NetBSD netbsd.example.org 6.1.4 NetBSD 6.1.4 (GENERIC) amd64

But since the package manager is also used outside of NetBSD, we
have to keep the /opt/local path too.
2016-05-16 10:13:49 -04:00
Kei Nohguchi
8de25db681 net_template.py: Fix jinja2 template file search path (#15134)
The change is needed to support the multiple include statements
inside the jinja2 template file, as in '{% include ['another.j2'] %}'.
statement.  I need this capability, as OpenSwitch `switch` role needs
to handle multiple *.j2 files and supporting the include statement
inside jinja2 file is essential, otherwise I need to combine multiple
template files into a single file, which easily causes conflicts
between developers working on different parts of the teamplate, ports
and interface.
2016-05-16 10:05:08 -04:00
Michael Scherer
10edaabed5 Port module_utils/ec2.py to python 3 syntax (#15879)
Since boto is considered as python 2.6 only (cf
https://github.com/ansible/ansible/blob/devel/test/utils/run_tests.sh#L15 ),
no need to use the 2.4 compatible syntax.
2016-05-16 08:44:51 -04:00
Michael Scherer
eb52dc9af0 Port azure_rm_common.py to py3 syntax (#15880)
Since the rest of the file already use a non 2.4 syntax
(such as format), I didn't bother using the 2.4 syntax for
exceptions.
2016-05-16 08:42:28 -04:00
Michael Scherer
cdef2f5db6 Port the gce snippet to a python 2.6 to 3 compatible syntax (#15872)
Since it depend on libcloud and libcloud requirements include python 2.6
since libcloud 0.4.0 (https://libcloud.apache.org/about.html), which
was released in 2011 Q2, and GCE drivers were added in 2013,
we can't run a libcloud version with GCE support on 2.4.
2016-05-16 08:11:31 -04:00
Michael Scherer
fae492324e Port the rest of the file to the 2.4/3 compatible syntax (#15873)
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.
2016-05-16 08:11:15 -04:00
Michael Scherer
a4f6fc0dc2 Port docker_common.py to py3 compatible syntax (#15877)
Since docker-py depend on python 2.6 (cf their tox.ini),
we do not need to make it python 2.4 compatible.
2016-05-16 08:10:35 -04:00
Michael Scherer
97f16b7700 Port shell snippet to python3/2.4 compatible syntax (#15874) 2016-05-16 08:10:07 -04:00
Michael Scherer
127a37f67c Port the module snippet to python3 (#15870)
vca depend on pyvcloud, who depend on PyYAML 3.10, which
support python 2.5 as a minimum, cf https://github.com/vmware/pyvcloud/blob/master/requirements.txt
and http://pyyaml.org/wiki/PyYAML

vmware.py depend on PyVIM, who depend on python 2.6.

So we can use the modern syntax for both of them.
2016-05-16 08:04:43 -04:00
Michael Scherer
e539b2003d Make the facts module run on netbsd (#15833)
It currently fail with

 ansible/module_utils/facts.py\", line 357, in get_service_mgr_facts\r\nKeyError: 'distribution'\r\n"

Since self.facts['distribution'] is used after, we need to make sure
this is set by default and if needed, corrected somewhere for Linux.
2016-05-16 08:02:38 -04:00
feliksik
95cf095222 hashi_vault lookup: be more rebust, and allow fields with other name than 'value' (#13690)
* more robust hashi_vault module, and allow querying specific field in secret-dict

* allow fetching entire secret dict with trailing ':'

* process comment by bcoca for PR #13690
2016-05-14 21:48:31 -04:00
Toshio Kuratomi
0cb05d8ac9 Some Python-3 module_utils support 2016-05-14 07:51:13 -07:00
chouseknecht
56bb3ec680
Bump core submodule ref. 2016-05-14 09:37:27 -04:00
chouseknecht
7f8a6d11c2
Bumping core submodule ref. 2016-05-14 09:26:32 -04:00
camradal
4bb4c7e68e vCloud module utils error handling bug fixes (#15859)
* Fix AttributeError that hides login errors

* Typo fixes for vca error messages
2016-05-13 23:57:08 -07:00
James Cammarata
6f6456dff5 Adding a deprecation message for accelerated mode 2016-05-13 17:01:07 -04:00
Thomas Quinot
a2c905c32e Fix uninitialized distribution fact on FreeBSD (#15842)
Initialize facts['distribution'] with self.system so that this fact does
not remain uninitialized on systems_platform_working platforms (FreeBSD,
OpenBSD).

Fixes #15841
2016-05-13 16:57:17 -04:00
Nathaniel Case
043e910652 Check for jxmlease when using netconf on JUNOS. (#15835) 2016-05-13 16:26:07 -04:00
James Cammarata
4f0be29d65 Reworking retry/until logic to fix bugs
Prior to this patch, the retry/until logic would fail any task that
succeeded if it took all of the alloted retries to succeed. This patch
reworks the retry/until logic to make things more simple and clear.

Fixes #15697
2016-05-13 16:09:38 -04:00
Toshio Kuratomi
03d33f0905 Start adding required to docs 2016-05-13 11:01:52 -07:00
jctanner
e083fa3d11 Disable sftp batch mode if sshpass (#15829)
Make use of the -oBatchMode=no option to force password prompts from sftp

Addresses #13401
2016-05-13 13:39:04 -04:00
Toshio Kuratomi
119baba6b1 Update submodule refs 2016-05-13 10:17:20 -07:00
Toshio Kuratomi
c1cc9f1f23 Merge pull request #15845 from abadger/ziploader-constants
Ship constants to the modules via internal module params rather than a secondary dict
2016-05-13 10:03:16 -07:00
Matt Martz
878b0dca68 Use .code instead of .getcode() as py24 does not have .getcode(). Fixes https://github.com/ansible/ansible-modules-core/issues/3608 2016-05-13 09:44:00 -05:00
James Cammarata
d2bade6daf Make sure setting facts with run_once makes copies of the data
When using run_once, there is only one dict of facts so passing that
to the VariableManager results in the fact cache containing the same
dictionary reference for all hosts in inventory. This patch fixes that
by making sure we pass a copy of the facts dict to VariableManager.

Fixes #14279
2016-05-13 10:05:19 -04:00
Toshio Kuratomi
186337db28 Ship constants to the modules via internal module params rather than a secondary dict. 2016-05-12 20:30:05 -07:00
Toshio Kuratomi
a404d0ffe2 Update submodule refs 2016-05-12 17:01:25 -07:00
Matt Martz
a521b70217 Merge pull request #15306 from sivel/ansible-modules-core/issue/3370
Cascade ssh_*args configurations in synchronize
2016-05-12 18:59:37 -05:00
Matt Martz
196453b9b2 Merge pull request #13771 from sivel/binary-modules
First pass at allowing binary modules
2016-05-12 18:36:34 -05:00
Matt Martz
72b6f8244c Merge pull request #15337 from sivel/ignore-profile-crap
Guard against a shell profile printing extraneous data
2016-05-12 18:32:02 -05:00
James Cammarata
ae09648068 Merge pull request #15812 from cThrice/patch-3
Fixes #15745 playbook include: Conditional scoping
2016-05-12 15:02:17 -04:00
Toshio Kuratomi
b4e78caf25 Merge pull request #15825 from abadger/fix-squashing-traceback
If we can't squash for any reason, then simply do not optimize the items loop.
2016-05-12 10:59:48 -07:00
Matt Martz
ca22783086 modify_module does not need to return module_path, as the calling code already has access to it 2016-05-12 12:53:49 -05:00
Matt Martz
34adb54734 Make _is_binary use already read module_data, move _is_binary check to the top of the stack 2016-05-12 12:53:49 -05:00
Matt Martz
0faddfa168 Move binary module detection into executor/module_common.py 2016-05-12 12:25:09 -05:00
Matt Martz
ddf3c3838f Re-implement/move some code lost due to merge conflicts 2016-05-12 12:25:09 -05:00
Matt Martz
35246abb2e Don't register new vars that aren't needed 2016-05-12 12:25:09 -05:00
Matt Martz
1e038e5043 Update for py26 2016-05-12 12:25:09 -05:00
Matt Martz
0a8d016642 Get binary modules working for windows, assuming .exe for windows 2016-05-12 12:25:08 -05:00
Matt Martz
d8a243bef0 First pass at allowing binary modules 2016-05-12 12:25:08 -05:00
Toshio Kuratomi
292f0ed0d6 If we can't squash for any reason, then simply do not optimize the items loop.
Also add more squashing testcases

Fixes #15649
2016-05-12 10:06:18 -07:00
Matt Martz
1cee3f35b1 Guard against a shell profile printing extraneous data 2016-05-12 11:43:37 -05:00