Commit Graph

2210 Commits (0b250016b09e759a1e0e4e01bb561ae9580bca38)

Author SHA1 Message Date
Peter Sprygada 392d9e2aa6 updates prepare_nxos_tests to use nxos_nxapi module (#22150)
replaces nxos_config with nxos_nxapi
8 years ago
Dag Wieers 52959ebdc1 wait_for_connection: Wait for system to become reachable (#20011)
* WIP: wait_for_connection: Wait for system to be reachable

This action plugin allows to check when a system is back online and
usable by Ansible.

As an example, when doing a SysPrep and running Enable-WinRM.ps1, it
takes between 10 to 20 seconds between the WinRM TCP port to open, and
it actually being able to server Ansible requests. This time is variable
and depends on the boot process.

Current implementation is specific for Windows (WinRM) only, this will
be fixed shortly.

This fixes #19998

* Support other transport types

* Various improvements

- Fix reported typo
- Add transport_test support in accelerate plugin
- Ensure port is an integer

* Improve examples

* Small fixes

- Use correct ConfigureRemotingForAnsible.ps1 script name
- Only use win_ping when remote shell is known to be Powershell
- Add integration tests to CI framework
8 years ago
Toshio Kuratomi 49194a66c8 Fix log_invocation function to pass unittests on python3
Normalize this function to use native strings.  Native strings won't
display an extra "u" or "b" character to denote py2 unicode or py3 bytes
types.
8 years ago
Matt Martz 6e8e90ceb4 Warn when using the deprecated HEADER_ arguments (#20236)
* Make sure the uri module warns about using the deprecated HEADER_ arguments, so that we can actually deprecate in a future version

* Use module.deprecate

* No need to de-dupe ourselves, looks like it is done somewhere I didn't initially see
8 years ago
Gaurav Rastogi 61288b14fd Renamed the avi_ansible_utils to avi. Fixed the import error and clea… (#22112)
* Renamed the avi_ansible_utils to avi. Fixed the import error and cleaned up code.

* Refactored all new modules to use the new module_utils.avi

* Added module_utils.avi to python 2.4 skip list
8 years ago
mikedlr 7ab0f28e80 [cloud] Fix AWS Lambda module tests (#21950)
* Revert "Disable broken tests."

This reverts commit 0d455037a2.

* lambda module - tests - fix year in copyright

* lambda module - tests - mod arguments in each test and eliminate pytest dependency

* lambda module - tests - broaden mocking to protect calls to get_aws_connection_info

* lambda module - tests - refactoring and cleanup
8 years ago
John R Barker 2f6213a219 result.commands (not .updates) (#22139) 8 years ago
Matt Martz f761949cca Ensure that a deprecated module has DOCUMENTATION.deprecated (#22090) 8 years ago
Matt Clay 4f3dade266 Add retries for ansible-test docker run. 8 years ago
Matt Clay ae2d2860f5 Reduce CI output processing code coverage. 8 years ago
Matt Clay 45cec93e99 Disable newer shellcheck tests which don't pass. 8 years ago
Matt Clay a7bb04800d Add boto to units requirements for s3 test. 8 years ago
Matt Clay a5e3d13adc Remove shebangs from unit tests. 8 years ago
Matt Clay fcac261eef Run unit tests in isolation w/ coverage support. 8 years ago
Matt Clay c87ebb6215 Deduplicate arcs when combining coverage data. (#22022) 8 years ago
Wittmer, Christian 52fbfa00f9 fix for #21729, use VERSION_ID instead of PRETTY_NAME to get release (#21730)
* fix for #21729, use VERSION_ID instead of PRETTY_NAME to get release
8 years ago
Matt Clay 2797cff773 Run destructive win tests when creating instances. 8 years ago
Ryan Brown ce150a8295 [cloud] S3 tests check for boto, but then ask for boto3 in error message (#22002) 8 years ago
Slezhuk Evgeniy e12daee5eb jira: comply with current pep8 rule set 8 years ago
Will Thames ebfc7bac94 cloudfront_facts module improvements
* Make more use of AWS Exception information
* Use pythonic dict assignments
* Improve documentation formatting to make option names clearer
  in descriptions
* Meet ansible line length requirements
* Tidy up flake8 messages
8 years ago
John R Barker 9f49d4b8f4 iosxr tests to work with 2.3 (#21998) 8 years ago
Peter Sprygada f95a11a9db fixes eos_eapi to error on wrong transport (#21993) 8 years ago
jhawkesworth a1047e6273 Adds integration test steps to win_regedit test to cover Extras 2090 (#15641)
* Adds integration test steps to win_regedit test to cover Extras 2090

* Fixed merge conflict and error in win_regedit integration tests

* fixed pep8 space after comma requirement discovered by ci build
8 years ago
Peter Sprygada 1c3d448a29 updates eos_facts integration test cases (#21988) 8 years ago
Dag Wieers a66d5dcc43 win_chocolatey: Add integration tests (#21930)
And also fix a known issue.
8 years ago
Peter Sprygada 216877c6ca adds system_mtu argument to nxos_system (#21970)
* updates argument_spec
* adds unit test case
8 years ago
Peter Sprygada 8dbb12a9c4 adds integration tests for nxos_mtu (#21969) 8 years ago
Peter Sprygada 4c354c9c70 adds integration tests cases for nxos_feature (#21966) 8 years ago
Peter Sprygada 10b23f3a00 adds unit test cases for nxos_command (#21959) 8 years ago
Peter Sprygada 0cb2019293 roll up of bug fixs for nxos_evpn_global (#21961)
* updates nxos_evpn_global module
* adds integration test cases
* adds unit test cases
8 years ago
René Moser 06acf8ac2e nginx_status_facts: fix pep8 (#21963)
* nginx_status_facts: fix pep8

* remove from legacy files
8 years ago
Peter Sprygada 21880b9742 adds nxos_config unit test cases (#21960) 8 years ago
Nathaniel Case 9b9ed59d98 Vyos config fixes (#21862)
* Fix vyos signatures to match new versions

* Fix test cases referring to 'updates' instead of 'commands'

* I think this is an artifact of `connection: network_cli`?
8 years ago
Peter Sprygada a284c3f7ea roll up of fixes for nxos_facts (#21954)
* fixes commands to work with nxapi
* updates test case timeouts
8 years ago
Peter Sprygada 16a39639f5 fixes minor bugs in eos_eapi module (#21925)
* module will now check protocol running state before return
* warns on config argument no longer being needed
* lots of integration test cases updated
* updates unit and integration test cases for state check

fixes #21908
8 years ago
Peter Sprygada 7c3957cc0c fixes nxos_template integration test case (#21953)
* test case implemented invalid argument: match
* changed argument to force: yes
8 years ago
Peter Sprygada 1f9b503e89 fixes issue with config parents on eos modules (#21923)
eos_config module wasn't respecting config block path (parents).  This
patch fixes that problem.  Also fixes a number of integration tests
cases

fixes #21903
8 years ago
Peter Sprygada 14c05d9e2b roll up of fixes for nxos_config (#21949)
* fixes provider to not log entries
* fixes nxapi send_request with config statements
* fixes nxapi get_config()
* updates nxos_config integration tests
8 years ago
Peter Sprygada 01ac1bc6e5 roll up of fixes from nxos integration tests (#21948)
* now fails nxos_nxapi if the transport=nxapi
* fixes typos in nxos_nxapi integration tests cases
8 years ago
René Moser d26c57f938 exoscale: pep8 and python3 fixes (#21821)
* exoscale: pep8 fixes

* exo_dns_record: remove from pep8 test legacy

* exoscale: fix python3 support
8 years ago
Matt Clay 2804d2e848 Split up unit tests on Shippable. (#21931)
* Add more verbose output to coverage combine.
* Run unit tests on CI separately by version.
8 years ago
Matt Clay 0d455037a2 Disable broken tests. 8 years ago
Matt Martz 305c88700d PEP8 E712 fixes (#21916) 8 years ago
Matt Clay c448a418fd Treat deprecated modules as old during validation. 8 years ago
Matt Davis 7798297317 temp disable Windows batch test 8 years ago
Matt Martz 97e12b0898 Check for imports to be between last doc line and first callable (#21863)
* Check for imports to be between last doc line and first callable

* Small readme update
8 years ago
Adrian Likins 6c6b647182 Fix 'ansible-vault edit /some/symlink' (#20417)
Since vault edit attempts to unlink
edited files before creating a new file
with the same name and writing to it, if
the file was a symlink, the symlink would
be replaced with a regular file.

VaultEditor file ops now check if files
it is changing are symlinks and instead
works directly on the target, so that
os.rename() and shutils do the right thing.

Add unit tests cases for this case and
assorted VaultEditor test cases.

Fixes #20264
8 years ago
Adrian Likins 8830cde28d Fix 'task name is not templated in retry callback' (add task_name property to TaskResult) (#21214)
Fix 'task name is not templated in retry callback'

Add a task_name property to TaskResult that knows to
check in TaskResult._task_fields.

Add integration test for v2_retry_runner callback

Fixes #18236
8 years ago
Adrian Likins a2907c4d5c Add smoke/intg tests for vault cli (#21679)
Add smoke/intg tests for vault cli
8 years ago
Dag Wieers b1f6344ecb win_chocolatey: Clean up parameter handling (#21533)
Changes include:

- Use Get-AnsibleParam with -type/-validateset
- Replace $result PSObject with normal hash
- Deprecate 'upgrade' parameter by using state=latest
8 years ago
Matt Martz 36e6c7973d pep8 fixes for module_docs_fragments (#21876) 8 years ago
Dag Wieers aebf6c8c92 powershell.ps1: Ensure Fail-Json() works with Hashtables (#21697)
Without this change a dictionary $result object would be emptied if it
is anything but a PSCustomObject. Now we also support Hashtables.
8 years ago
Peter Sprygada 381f7209f8 fixes issue in nxos_config when retrieving current config (#21843)
When parsing the configuration, the wrong indent level was set so the
configurations could not be properly compared.  Also noted that
defaults: yes needed to be added to the integration tests to make the
test cases valid, which is also included in this patch

fixes #21828
8 years ago
mikedlr 34d9415d6d [cloud][tests] AWS lambda module unit tests (#21768)
First pass at unit tests; demonstrates no update when only one parameter changed bug that was fixed in 22701806.
8 years ago
Toshio Kuratomi 08a752faea Add some unittests for lib/ansible/constants.py 8 years ago
Matt Martz 4b320ce0e4 Add checks for from module_utils import * (#21800) 8 years ago
Matt Clay cba91c7f44 Test placement (#21801)
* Fix test placement and update messaging.
* Add note about group selection.
8 years ago
Matt Clay b5e0eb0985 Fixes for missing aliases files sanity test. (#21798)
* Refine test for missing aliases files.
* Fix formatting of missing aliases message.
8 years ago
Toshio Kuratomi 45251f910c Make BaseFileCache into an abstractbaseclass so it's a proper interface
Push the opening and closing of files into the _load and _dump methods
so that we don't invoke the slow codec machinery without reason.
8 years ago
Brian Coca 374af06cbf added pickle and yaml cache plugins
added new base class for file based cache plugins as 99% of code was common
now also catches unexpected decoding exceptions
allows per module file modes and encoding
moved jsonfile code to base
8 years ago
Ricardo Carrillo Cruz ab4e83f288 Remove superfluous include on iosxr filesystems fact gathering (#21775)
The regex will catch only lines that start with 'Directory of' regardless.
Also, fixing unit tests while at it.
8 years ago
Matt Clay b2bd75a408 Restore 2008-SP2 and 2008-R2_SP1 CI testing. 8 years ago
Matt Clay 9462707f21 Test www.redhat.com instead of docs.ansible.com. 8 years ago
Matt Martz b143fdea54 DOC options must be a dict when used with extends_documentation_fragment (#21745)
* Fix string formatting
* Provide better tracebacks
* When options is None and extends_documentation_fragment is in use, add an error that options must be a dict
* If options was specified and not a dict, then error
8 years ago
Ryan S. Brown 5fd3b9dd75 Revert "[cloud] add unit tests for lambda module (#21710)"
This reverts commit bedf0279a9 after the
tests fail due to overlapping mocks in shippable.
8 years ago
mikedlr bedf0279a9 [cloud] add unit tests for lambda module (#21710)
* lambda module - some tests; demonstrates no update when only one parameter changed fixed in 22701806.

* lambda module - tests - code clean up

* lambda module - tests - fix update usage assertions

* lambda module - rework mocking in region warning test
8 years ago
Veaceslav Mindru cdcdc1d81b #19587 add yum skip-broken (#21475)
* #19587: refactor to PEP8

* Issue: #19587: add skip_broken option to yum module
PNTSYSOPS-1901 - internal reference

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* Issue: #19587: fix line break, attempt to make readble

        things at line 646 look ugly ..
        trying to make them look a bit more human readble
        though the entire approach should be rewriten

PNTSYSOPS-1901 - internal reference

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* #19587: fixing typo, skip-broken has to be passed as list

* PR: #21475: peer review changes
            relates to: revert comment deletion https://github.com/ansible/ansible/pull/21475#discussion_r101574146
            relates to: remove irelevant var https://github.com/ansible/ansible/pull/21475#discussion_r101573388
            relates to: reformat https://github.com/ansible/ansible/pull/21475#discussion_r101572840

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* PR: #21475: peer review changes
            relates to: https://github.com/ansible/ansible/pull/21475#discussion_r101573736

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* Issue: #21475: fixing typo in the Man section

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* PR: #21475 - Peer review: revert variable a
        Relates to: https://github.com/ansible/ansible/pull/21475#pullrequestreview-22404868

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* Issue: 19587 - small correction

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
8 years ago
Barry Peddycord III d1efc8e19e New Networking Module: NCLU (#21101)
* Adding Cumulus NCLU module

* Delete incorrect testing folder

* wrong import location for nclu test

* another wrong import location for nclu test

* unittest library doesn't support 'skip', removing 'real' nclu tests

* Don't need stringio since I'm not doing real tests

* got rid of unnecessary shebang in test_nclu

* version set to 1.0

* Documentation fixes
8 years ago
Matt Clay bc8186543a Pass base branch to module validator on delegate. 8 years ago
Matt Martz c160ede789 Validate modules json output (#21680) 8 years ago
Peter Sprygada e4a2c804be partial revert of changes introduced in d5f7a0181b (#21688) 8 years ago
Jordan Borean a80251ff02 Added win_region module (#19147) 8 years ago
Peter Sprygada d5f7a0181b roll up of eos fixes (#21629)
* fixes error where eos would close the cli shell
* fixes network_cli connection plugin to check before calling open_shell()
* fixes json commands being sent over eapi
8 years ago
Peter Sprygada 76c9ad9dfc new module nxos_system (#21627)
* provides declarative config support for nxos system attributes
* adds unit test cases for new module
8 years ago
Matt Martz 9b1bd2eb7e Re-enable module comparisons in validate-modules (#21582)
* Re-enable module comparisons, specifically for new module detection and for finding new options/arguments
* Only do new module checks in shippable, local will display warning
8 years ago
Matt Clay 1ce2ea0b6c Fix ansible-test handling of deleted test targets. 8 years ago
Peter Sprygada a6cecef6bc clean up of terminal plugins (#21549)
* removes unneeded supports_multiplexing var
* refactors terminal_prompts_re to terminal_stdout_re
* refactors terminal_errors_re to terminal_stderr_re
* updates network_cli unit test cases
8 years ago
Matt Davis 8527013fbe Complete rewrite of Windows exec wrapper (#21510)
* supports pipelining for faster execution
* supports become (runas), creates interactive subsession under WinRM batch logon
* supports usage of arbitrary module_utils files
* modular exec wrapper payload supports easier extension
* integrates async wrapper behavior for pipelined/become'd async
* module_utils are loaded as true Powershell modules, no more runtime modifications to module code
8 years ago
Toshio Kuratomi eeaec56ed5 Use isinstance instead of type() comparisons. isinstance is more robust 8 years ago
Matt Clay 2192c1eb02 Fix ansible-test selection of inventory file. 8 years ago
Tom Melendez 8dcec1b659 [GCE] gce_net integration test (#21502) 8 years ago
Ted Timmons 5d9df86b42 Postgres ssl mode prefer (#21498)
* refactor postgres,
* adds a basic unit test module
* first step towards a common utils module
* set postgresql_db doc argument defaults to what the code actually uses

* unit tests that actually test a missing/found psycopg2, no dependency needed

* add doc fragments, use common args, ansible2ify the imports

* update dict

* add AnsibleModule import

* mv AnsibleModule import to correct file

* restore some database utils we need

* rm some more duplicated pg doc fragments

* change ssl_mode from disable to prefer, add update docs

* use LibraryError pattern for import verification

per comments on #21435. basically LibraryError and touching up its usage in pg_db and the tests.
8 years ago
Adrian Likins 718b786157 Fix test failures if 'future' package is installed (#15005)
The python 'future' module provides a 'builtins' package
to emulate the py3 'builtins' modules. If installed, the
unit tests that reference builtins.__import__ fail because
the future 'builtins' is imported and it is missing __import__.

Use ansible.compat.six.moves.builtins instead of importing
'builtins' or __builtin__

Fixes #14996
8 years ago
Peter Sprygada 02d2b753db refactors junos modules to support persistent socket connections (#21365)
* updates junos_netconf module
* updates junos_command module
* updates junos_config module
* updates _junos_template module
* adds junos_rpc module
* adds junos_user module
8 years ago
Will Thames f42ffe6de3 [cloud] Ensure that s3_bucket module always enables/disables versioning if it is specified (#21320)
If versioning is not enabled, then `get_bucket_versioning`
can return an empty dict.

If that happens, the code to enable versioning should still
run!

The logic for suspending versioning was also incorrect, so
have updated that too.

Fixes #20491
8 years ago
Dave Kasberg dbb452100a New module: cnos_vlan and various utility files (#21107)
* First set of CNOS network modules

Two modules: cnos_vlan and cnos_command.  First 2 of 17 CNOS modules

* Revert "First set of CNOS network modules"

This reverts commit 63da68b2a857e622b449f514050eed25fbcf0a35.

* cnos_vlan module

First of 17 CNOS modules

* Modify playbook for cnos_vlan module testing

* fix issue found by shippable in cnos.py

* cnos_backup module

* Fix Python3.5 compilation error

* remove cnos_backup module from this PR

* add aliases file so that testing of the cnos_vlan module will be skipped.

* Use empty aliases file

* utility scripts under module_utils changed to BSD license.

* clean up PEP8 issues, add cnos_vlan tests

* remove blank lines from yml files

* remove more blank lines

* remove even more blank lines

* Revert "remove even more blank lines"

This reverts commit bb3998661ce387260340bca39d5f146f5ec54f44.

* re-submit last commit

* fix blank lines in this file under parsing

* fix yamllint errors in doc section of cnos_vlan

* Fix errors reported by Sanity check using validate-modules

* change test playbook to include tasks for all modules

* fix additional pep8 errors

* more fixes, plus fix for python3

* fix for empty options section, removed unnecessary documentation

* fix up documentation section

* Correct options capitalization

* fix example section, add options

* Fix example section of the documentation
8 years ago
Matt Martz 7c00346714 Validate EXAMPLES as YAML 8 years ago
Adrian Likins 499d3a1b53 add a intg test for issue #19835 (#21487)
(postgresql_user changing role_attr_flags with no_password_checks
fails)
8 years ago
Michael Scherer 6fae1d2bbf Make password lookup treat /dev/null as a special case
I have from time to time a need of random password without
wanting to write them down (one example is mailman list creation,
that requires a password to be given to be sent to the list owner).

But using /dev/null do not return null, but the empty string, which
doesn't generate a password at all and so do not achieve my use case.
8 years ago
Will Thames 103ede26df Ensure ssh hostkey checks respect server port (#20840)
* Add tests for `get_fqdn_and_port` method.

Currently tests verify original behavior - returning default `ssh-keyscan` port
Add test around `add_host_key` to verify underlying command arguments
Add some new expectations for `get_fqdn_and_port`
Test that non-standard port is passed to `ssh-keyscan` command

* Ensure ssh hostkey checks respect server port

ssh-keyscan will default to getting the host key for port 22.
If the ssh service is running on a different port, ssh-keyscan
will need to know this.

Tidy up minor flake8 issues

* Update known_hosts tests for port being None

Ensure that git urls don't try and set port when a path
is specified

Update known_hosts tests to meet flake8

* Fix stdin swap context for test_known_hosts

Move test_known_hosts from under basic, as it is its own library.
Remove module_utils.known_hosts from pep8 legacy files list
8 years ago
Toshio Kuratomi e4a80965de Test the slurp module 8 years ago
Toshio Kuratomi 99fd2328af Fix hash filter for non-ascii strings and Python3
hashlib hashes operate on byte strings.  When given a text string on
Python3, hashlib backtraces.  When given a text string on Python2,
hashlib will backtrace if the string contains non-ascii characters.
Encode the text string to utf-8 prior to hashing to avoid this problem.

Fixes #21452
8 years ago
Peter Sprygada 48b02336ab code clean of old code from network modules updates (#21469)
* removes unused code
* removes module_utils/local.py
* removes plugins/action/network.py
* removes action_handler from connection plugins
* removes code to use action_handler in task_executor
* updates action plugins to subclass from normal
8 years ago
Tim Rupp 2a9778e320 Change the f5 modules to use f5_utils file (#21466)
The f5 module utils were using a file name that appeared to
conflict with the f5 python SDK's namespace. This patch just changes
the name of the included class to be f5_utils to avoid the issue
of namespace collisions
8 years ago
Peter Sprygada eb1453a366 updates iosxr modules to support socket (#21231)
* updates all iosxr modules to support persistent socket
* adds iosxr action plugin to connect to device
* adds exec_command() to iosxr shared module
* fixes iosxr_config and iosxr_template local action
* update all unit test cases
* adds base test module for iosxr module testing
8 years ago
Toshio Kuratomi d7b7cbac1a Move to using a requirements.txt to install the python packages. (#21430)
Move to using a requirements.txt to install the python packages.

This makes it easy to keep the documentation and actual package
dependencies in sync.

Fixes #18453
8 years ago
John R Barker 5e28d3a15c network_cli shouldn't be specified anymore (#21458) 8 years ago
John R Barker 53ac312382 validate-modules --arg-spec (#21331)
* validate-modules --arg-spec

* Update developing_modules_documenting.rst

* Never mock out ansible or ansible.module_utils

* No more false positives
8 years ago
Tim Rupp 6fc989a902 Adds a factory function for getting REST api tools (#21423)
I plan on converting most all f5 modules to use the rest api, so
this is part of that conversion. it adds a factory method to get
the various rest management root apis provided in the f5 sdk
8 years ago
Matt Clay 9389fafae8 Enable MySQL tests on FreeBSD. 8 years ago