Commit graph

28570 commits

Author SHA1 Message Date
Dag Wieers
35d97c1e6d Windows: Add-Warning() and Add-DeprecationWarning() (#20903)
* Windows: Add Warn() and Deprecate() mechanisms

Similar to what already exists for python modules.

* Turn deprecations from list of strings, to list of dicts

Since #20884 the internal representations of deprecation messages is
changed from a list of strings to a list of dicts.

* Rename to Add-Warning() and Add-DeprecationWarning()

Implemented as discussed.
2017-02-09 10:41:57 -08:00
Tatsuya Hoshino
41f3680dfd Mask login_password in log (#21199) 2017-02-09 10:16:54 -08:00
Damien
a995fa43a6 New dynamic inventory for Apstra AOS (#21045)
* Initial release of dynamic inventory for AOS
2017-02-09 13:10:36 -05:00
stigchristian
27d1286780 Fixed typo "tempalated" => "templated" (#21187) 2017-02-09 09:13:22 -08:00
Dylan Silva
719b1fecfc [WIP] Added in bullet of Python 2.4+2.5 support discontinuation (#19264)
* Added in bullet of Python 2.4+ support discontinuation

* Update ROADMAP_2_4.rst

* Update ROADMAP_2_4.rst
2017-02-09 15:57:00 +00:00
Ryan S. Brown
9794bd8c35 [cloud][docs] Add more EC2 dynamic inventory stack_filter docs 2017-02-09 09:13:10 -05:00
Ilya Kalinin
259b05dd8e [cloud] Add stack_filters option to EC2 inventory script 2017-02-09 09:13:10 -05:00
Brian Coca
2f1ab29855 add url_password to 'cleanse' list 2017-02-09 08:53:04 -05:00
DavidVentura
c5a8b78956 fix merge conflicts (#19481) 2017-02-09 12:55:25 +00:00
Adam Friedman
1a28a48176 Refactor dimensiondata_network module (#21043)
* Refactor dimensiondata_network to use shared base class for common functionality.

* Experiment: remove the assignments in the "except ImportError:" block that keep PyCharm happy. If this fixes the build, then I reckon there's a bug in the validate-modules script (https://github.com/ansible/ansible/blob/devel/test/sanity/validate-modules/validate-modules#L322).

* Remove unused imports.

* Changes based on feedback from @gundalow for ansible/ansible#21043.

- Use no_log=True for mcp_password parameter.
- Collapse module parameter definitions.

* Use shared definitions and doc fragments for common module arguments (ansible/ansible#21043).

* Make default network plan "ESSENTIALS", rather than "ADVANCED" (this is consistent with our other tooling).
Tidy up module parameter documentation.

* Simplify dimensiondata module documentation fragments (didn't know you could include multiple fragments).

* Change 'verify_ssl_cert' module parameter to 'validate_certs'.
2017-02-09 11:30:31 +00:00
DavidVentura
b5811ccb8a proxmox: Add public key support: fix #19487 (#21142)
* fix #19487

* add 'version_added'

* Check for version compatibility, Ignore keys if incompatible

* add comment about version support

* remove 'type' as requested

* fix merge error
2017-02-09 09:45:41 +00:00
Tuomas-Matti Soikkeli
829f3bd019 Fix default value for remote_src (#21136)
Default value is clearly False, fixed it to correct value.
2017-02-09 00:25:27 -08:00
Jordan Borean
1c885cb848 Added fix for win_file with broken symlinks (#19146) 2017-02-08 18:49:49 -08:00
Matt Clay
4e19adb919 Restore FreeBSD 11.0 tests for CI. 2017-02-08 17:01:17 -08:00
Jordan Borean
719e1840da Added info on ntlm and credssp, updated configure script for credssp (#21175) 2017-02-08 17:00:58 -08:00
Matt Clay
4b90f9cf89 Remove obsolete test requirements file. 2017-02-08 15:40:18 -08:00
Matt Clay
91526cd9f2 Enable process isolation for unit tests. 2017-02-08 14:36:42 -08:00
Jordan Borean
1ce5fcf061 Added win_find module (#19144) 2017-02-08 22:19:08 +00:00
Matt Clay
57a5490c41 Fix test which fails on some python 2.6 installs. 2017-02-08 14:06:40 -08:00
s-hertel
65815c3875 Refactoring Galaxy unit tests for uniformity (#20828)
* Making tests more uniform

Removing unnecessary GalaxyCLI arguments/patching of the command line since parsing of the CLI args has been modified.

Run GalaxyCLI.parse() without saving the returned value to be uniform with the rest of the code.

Fix test_execute_remove to use the correct path

Use GalaxyCLI.run() instead of super(GalaxyCLI, gc).run() and GalaxyCLI.api = ansible.galaxy.api.GalaxyAPI(gc.galaxy).

* Refactor so one unit test checks one thing instead of multiple.

Improve readability by using a dict instead of lots of elifs

* Removing import used for debugging

* Fixing PEP 8 issues.

* Fix PEP 8 issues
2017-02-08 16:35:06 -05:00
Adrian Likins
df3e4cd7f4 Don't check for var._obj in template._clean_data (#20868)
* Don't check for var._obj in template._clean_data

AnsibleUnsafe or other unsafe vars used to have a
'_obj' slot but no longer do. This was causing attribute
errors if a object was 'unsafe' but not a string.

Add tests for AnsibleUnsafe, lookups, and AnsibleContext
2017-02-08 16:09:34 -05:00
Adrian Likins
e511326222 Fix 'yum skips updates' bug (#21113)
* Fix 'yum skips updates' bug

When the 'yum check-update' output is parsed, the regex used
to stitch wrapped lines together would fail on the first package.

It would fail because there is an empty line before the first
package, and this triggered the regex. To avoid a more complicated
regex, preprocess the check-update output to strip out any
empty lines.

The regex is also updated to include a group on the non whitespace
match to be used in the sub.

Add test cases based on info provided in the bug reports.

Fixes #20608
2017-02-08 16:07:43 -05:00
Justin Mayer
fda131504b Support multiple vault passwords in keyring script
Allows users to specify a key name in a given project’s `ansible.cfg`
file and thus handle keyring integration with vaults with different
passwords. If no key name is specified, the original default `ansible`
key name will be used.

Other improvements:

* `username` is now optional; defaults to user that invokes the script
* change string interpolation to new `.format()` style
* clean up and expand upon documentation
* enforce PEP 8 compliance
2017-02-08 16:05:36 -05:00
stephane
1b8c2a2b0b Restore "skipping: no hosts matched" message
In 159aa26b36
the result of _get_serialized_branches when no hosts were matched
changed from [[]] to []. Thus, the v2_playbook_on_no_hosts_matched
callback would not fire. Change the check so we get the error message
again. Fixes #17706
2017-02-08 16:03:29 -05:00
Matt Clay
1293ec85dd Convert unit test yield to pytest parametrize. 2017-02-08 12:56:23 -08:00
jerry
bd19a9e847 removing unwanted variables and using to_native instead of str()
(cherry picked from commit c4b09cbcb4)
2017-02-08 15:53:58 -05:00
jeronimog
4f85e4831d Adding self.log() on IOErrors and OSErrros
(cherry picked from commit ef1ecfd2c2)
2017-02-08 15:53:58 -05:00
Brian Coca
300718e811 use new 'warn' method
this also prevents warnings from being lost
2017-02-08 15:53:58 -05:00
Matt Clay
46f9648aa1 Fix type() usage check in validate-modules.
This avoids false positives when 'if' or 'or' are in a string
preceding the use of type() on the same line.
2017-02-08 12:17:10 -08:00
Tim Rupp
43ae12757e Adds CLI classes for some F5 modules (#21119)
To support the _command module for F5 products, this class is needed.
2017-02-08 18:25:20 +00:00
Ralph Rodkey
b1f06f6555 [cloud] make ec2_asg honor 'wait_for_instances' on delete 2017-02-08 12:57:59 -05:00
Brian Coca
5f29117e59 become options dont qualify as new anymore 2017-02-08 11:51:15 -05:00
Matt Martz
c3fb4c837b Fix module validation errors for avi_api_session (#21154) 2017-02-08 10:32:13 -06:00
Pilou
4e5c9c3d0d default and minimal callback: display warnings in a consistent manner (#21144)
* default/minimal callback: don't display warnings twice

* minimal callback: display warnings raised by MODULE_NO_JSON modules
2017-02-08 10:58:39 -05:00
Marius Gedminas
2efb692cc4 known_hosts: support --diff (#20349)
* known_hosts: support --diff

* known_hosts: support --diff also without --check

* Add unit tests and fix incorrect diff in one corner case

Tests are good!

* Refactor for readability

* Python 3 compat

* More Python 3 compat

* Add an integration test for known_hosts

* Handle ssh-keygen -HF returning non-zero exit code

AFAICT this is a bug in ssh-keygen in some newer OpenSSH versions
(>= 6.4 probably; see commit dd9d5cc670):
when you invoke ssh-keygen with -H and -F <host> options, it always
returns exit code 1.  This is because in ssh-keygen.c there's a function
do_known_hosts() which calls

  exit (find_host && !ctx.found_key);

at the end, and find_host is 1 (because we passed -F on the command line),
but ctx.found_key is always 0.  Why is found_key always 0?  Because the
callback passed to hostkeys_foreach(), which is known_hosts_hash(),
never bothers to set found_key to 1.

* This test does not need root

* Avoid ssh-ed25519 keys in sample known_hosts file

Older versions of OpenSSH do not like them and ssh-keygen -HF
aborts with an error when it sees such keys:

  line 5 invalid key: example.net...
  /root/ansible_testing/known_hosts is not a valid known_hosts file.

* Fix Python 3 errors

Specifically, the default mode of tempfile.NamedTemporaryFile is 'w+b',
which means Python 3 wants us to write bytes objects to it -- but the
keys we have are all unicode strings.
2017-02-08 09:56:03 -05:00
Brian Coca
d0bc98bddb added url and metadata 2017-02-08 09:48:59 -05:00
Brian Coca
82337cf52a remove warning/deprecation keys after usage 2017-02-08 09:47:10 -05:00
Brian Coca
942ed146c3 errors to stderr 2017-02-08 09:47:10 -05:00
Gaurav Rastogi
798972c72a Avi Networks Ansible modules. (#20415)
* Avi Networks Ansible modules.
Avi Version: 16.3.4

* Fixed Review comments
1. Changed description to be full sentences
2. Fixed Pep8 warnings.
3. Fixed comments and descriptions.

* 1. Fixed descriptions and messages as per review comments.
2. Added descriptions for the missing parameters.

* Fixed the shippable break due to the incorrect description format

* Removed the extra modules so that there is a single module for the first commit

* Updated license to BSD based on review comments

* updated comments based on review feedback

* Refactored code to handle POST and PUT scenarios where playbook does not need to check whether object is present.
Moved ansible helper utilities to module_utils as now roles can be patched with module_utils as well.

* fixed pep8 warnings
2017-02-08 09:47:18 -05:00
Thomas Krahn
9f3870ddcd IPA: Remove duplicated code and fix a bug that occurs if empty lists were passed and IPA didn't know the value before (#19210)
* ipa: Add method get_diff and modify_if_diff to class IPAClient

* ipa_*: Use method get_diff and modify_if_diff from class IPAClient
2017-02-08 14:16:44 +00:00
Kevin Kuhls
534dbb094b adding support for no candidate config (#20821)
commit fails for devices with no candidate config, such as when configuraion is written to running-config store.  Commit is set to True in main's call of netconf_edit_config.  The simple edit is to add the additional logic around sending the commit.  Otherwise you could change commit could be set to (if ":candidate" in m.server_capabilities) in the call of netconf_edit_config.  Either way would work.  I'll defer for the decision of which.
2017-02-08 08:58:23 -05:00
Robert Simmons
b7e78656ac [cloud] gce_net fix for unsetting firewall rule properties in the project. (#20483) 2017-02-08 08:49:04 -05:00
Ricardo Carrillo Cruz
64ed9bcfd7 Add unit tests for ios_facts module (#21114) 2017-02-08 12:24:25 +01:00
René Moser
a6f887ce6e cloudstack: cs_portforward: implement vpc support (#19044)
* cloudstack: cs_portforward: implement vpc support

* cloudstack: cs_portforward: add vpc and network to returns

* cloudstack: cs_portforward: networkid must not be used for rule listing

* cloudstack: fail for get_network when vpc but no network name

This seem to be a global pattern for get_network, we want to enforce a
network name to be set if a vpn param is given.

This is used for cs_portforward.

* cloudstack: cs_portforward: doc: fix defaults for vpc, network
2017-02-08 07:57:36 +01:00
Marius Gedminas
577d0e43ba apt_repository: check for enabled repositories correctly
Fixes #20754.

Details: UbuntuSourcesList.add_source() had a quick check for PPAs being
already present in the source lists.  The check was looking for the PPAs
URL to be present in self.repo_urls, which should contain all valid and
enabled repositories.

The enabled check in repo_urls was incorrect.  It was checking the tuple's
2nd item (which means "valid") and ignoring the 3rd item (which means
"enabled").

self.files contains tuples (line_number, valid, enabled, source_line,
comment_text).  Ideally it would be using named tuples instead of
indexing, to avoid bugs like that, but Python 2.4 didn't have named
tuples, so we can't do that (yet).
2017-02-07 18:42:57 -08:00
Matt Clay
f16ee2841b Add retries to Shippable CI scripts. (#21108)
* Add retry.py for auto-retry in CI scripts.
* Add retries to other and units CI scripts.
2017-02-07 16:33:45 -08:00
Dag Wieers
4f96ee5e27 Add missing iteritems definition (#21106)
Also moved most imports out of try-except block.
2017-02-07 18:31:40 -05:00
Toshio Kuratomi
a3eab4fc48 Add 2.3.0 entries for module_utils via pluginloader, selectors, and py3 (#21019)
* Add 2.3.0 entries for module_utils via pluginloader, selectors, and py3

* Add roadmap-2.3 updates and an item for roadmap-2.4
2017-02-07 15:27:14 -08:00
Matt Clay
189fee4853 Fix vyos unit tests. 2017-02-07 15:21:34 -08:00
Ryan S. Brown
d12e9f5748 Convert error to the native text type before writing to stderr
Fixes #20588
2017-02-07 18:01:58 -05:00