Commit graph

2240 commits

Author SHA1 Message Date
Matt Clay
7d79105cf4 Overhaul ansible-test import analysis. (#22888)
- Add support for module_utils packages for better organization.
- Add support for "virtual" module_utils packages such as `six`.

(cherry picked from commit 4fdeade389)
2017-03-22 23:02:44 -07:00
Brian Coca
4e6cdf8989 better handling of parsed
updated tests to match new result output

(cherry picked from commit 5e98be2e62)
2017-03-22 12:03:34 -04:00
Ricardo Carrillo Cruz
3db0bbe76c Fallback to show-run on ios_banner for devices where show banner does not work (#22793)
On switches 'show banner' command doesn't work, fallback to show run|begin banner
and extract the banner text in case that fails.
2017-03-22 11:07:49 +01:00
Ricardo Carrillo Cruz
89a2d1d6ad Add ios_banner module (#22687)
With unit and integration tests.
2017-03-21 12:29:45 +01:00
Matt Clay
0c2c19edb4 Fix metadata handling for shell command. (#22801)
(cherry picked from commit 042e387f27)
2017-03-20 15:32:35 -07:00
Matt Clay
3f8e8a3390 Add missing needs/root alias to file test. (#22800)
(cherry picked from commit 3585d3d368)
2017-03-20 14:14:16 -07:00
Matt Clay
b73a1be03a Disable failing MySQL tests on FreeBSD. (#22798)
(cherry picked from commit b7c80dbb7e)
2017-03-20 09:54:16 -07:00
Matt Clay
5ae1967aea Fix ansible-test base branch handling on merge. (#22759)
(cherry picked from commit 991bf0a1c3)
2017-03-17 23:34:27 -07:00
Matt Clay
0e864fd81b Fix uri options test to work again.
(cherry picked from commit 93d9b04f1d)
2017-03-17 22:31:22 -07:00
Matt Clay
0ca10bf3d5 Fix ansible-test base branch usage on Shippable.
(cherry picked from commit 47887a2edd)
2017-03-17 17:36:16 -07:00
Matt Clay
c935d2f038 Do not run win_chocolatey in CI tests.
The test is failing repeatedly.

(cherry picked from commit 011b324638)
2017-03-17 09:01:31 -07:00
Matt Clay
dc8ad50eaa Fix ansible-test PR diff handling.
Permits use of PRs on branches other than devel.

(cherry picked from commit f7c83ccdc0)
2017-03-16 10:37:10 -07:00
Matt Clay
c72ac9b230 Add test verification to ansible-test. (#22636)
* Add unified git diff parser.
* Add metadata and diff handling.
* Add test confidence/verification to bot output.

(cherry picked from commit 869449e288)
2017-03-15 14:48:53 -07:00
Matt Clay
c9ea993c88 Verify SHA in Shippable change detection.
(cherry picked from commit 5e9a2b8528)
2017-03-15 11:32:41 -07:00
Dag Wieers
72e7927dd5 win_scheduled_task: Added frequency: once and check_mode support (#22611)
* win_scheduled_task: Added frequency: once and check_mode support

This patch includes:
- Renamed `execute:` parameter to `executable:`
- Renamed `argument:` parameter to `arguments:`
- Implemented `frequency: once` support
- Implemented check_mode support
- Fix idempotency issue related to empty description
- Added integration tests

* Improve the integration test structure

I think this is a great way to test normal mode and check-mode from the same playbook.

* Small fixes after review
2017-03-15 07:11:24 -07:00
Jordan Borean
6ce338d29c win_service Added -Force option and minor cleanup (#22598)
* win_service Added -Force option and minor cleanup

* Changed parameter and fixed typos
2017-03-14 18:53:31 -07:00
Matt Davis
ce56da69b2 make windows async ... async (#22624)
Fixes #22575 - issue under new exec wrapper where unconstrained handle inheritance (for stdin) caused WinRM to block on breakaway processes. Uses explicit handle inheritance to ensure that only stdin read handle gets inherited. Adds test to ensure that async is actually async.
2017-03-14 16:37:55 -07:00
Matt Clay
89559f78de Add --failure-ok option to ansible-test. (#22623) 2017-03-14 16:32:21 -07:00
Ricardo Carrillo Cruz
604a38cac1 Implement eos_banner for EAPI (#22609)
On EAPI, the multi-line commands are expected to be a dict,
with key/value pairs 'cmd'/'input' .
This change implements that behaviour and fixes the idempotency
on EAPI as well.

Fixes #22494
2017-03-14 21:00:17 +01:00
Toshio Kuratomi
eb1214baad New metadata 1.0 (#22587)
Changes to the metadata format were approved here:
https://github.com/ansible/proposals/issues/54
* Update documentation to the new metadata format
* Changes to metadata-tool to account for new metadata
  * Add GPL license header
  * Add upgrade subcommand to upgrade metadata version
  * Change default metadata to the new format
  * Fix exclusion of non-modules from the metadata report
* Fix ansible-doc for new module metadata
* Exclude metadata version from ansible-doc output
* Fix website docs generation for the new metadata
* Update metadata schema in valiate-modules test
* Update the metadata in all modules to the new version
2017-03-14 09:07:22 -07:00
Matt Clay
771b14acb2 Sort test messages for deterministic output. (#22581) 2017-03-13 20:45:10 -07:00
John R Barker
04e816e13b Stricter module documentation validation (#22353)
Raise the bar for module `DOCUMENTAION`
This validator update was used to find the issues in https://github.com/ansible/ansible/pull/22297/files

**Validation**
* Updated Validation and docs to enforce more (items fixed in https://github.com/ansible/ansible/pull/22297/files)
* Use `suboptions` to document complex options 
* Validate module name
* Validate deprecated modules have correct ANSIBLE_METADATA

**Module Documentation Generation**
* Document `suboptions:` Example https://gist.github.com/gundalow/4bdc3669d696268328ccc18528cc6718
* Tidy up HTML generation (valid HTML, no empty lists, etc)
 
**Documentation**
* Clarify the steps for deprecating a module
* Use correct RST headings
* Document `suboptions:` (options)
* Document `contains:` (returns)


**Details**
The aim is to get this (and corresponding module updates) complete by the time `devel` becomes `2.4`, as this allows us to raise the bar for new modules

Example `suboptions` https://gist.github.com/gundalow/4bdc3669d696268328ccc18528cc6718

The aim is to get this PR integrated into `devel` *before* we branch `stable-2.3`, this will allows us to:
* Raise the bar for new modules in 2.4
* Ensure the generated module documentation for 2.3 and higher is improved, important as we will be doing versioned docs moving forward.
2017-03-13 19:49:27 +00:00
Peter Sprygada
39c38bf30d fixes candidate var type in junos shared lib (#22551)
* candidate var can now be string, list or element
* fixes minor bug in junos_template for backup argument
* disabled invalid integration test for junos_template
2017-03-13 07:27:45 -04:00
Peter Sprygada
2b2072a8c9 roll up of fixes and updates for junos modules (#22543)
* removes cli functions
* adds comment and confirm to arguments
* implements zeroize argument
* fixes get_diff function in junos shared lib to return diff
* lots of minor bug fixes in junos_config
* minor syntax fixes in junos_netconf
* updates netconf integration tests
2017-03-12 11:45:00 -05:00
Peter Sprygada
3f0f7c4f4e updates junos shared lib and action handler (#22541)
* removes cli functions from shared lib
* adds cli functions to junos_netconf module
* statically pins junos_netconf to cli transport
* all other modules use netconf transport
* adds command rpc function to junos shared
2017-03-12 08:37:45 -05:00
John R Barker
89e4226051 add missing files (#22496) 2017-03-10 15:29:36 +00:00
John R Barker
5dac2ee00c Test eos_banner (#22201)
* eos_banner docs improvements

* run eos_banner tests

* basic eos_banner tests

* remove trailing newlines

* remove hack

* Various eos_banner fixes

No unicode tests, as the device doesn't support it
Correctly set provider
result.command should be empty list if no changes

* test eos_banner over eapi

* revert docs changes, moved to separate PR
2017-03-10 15:20:09 +00:00
Ricardo Carrillo Cruz
c57729944b Fix the eos_banner idempotency (#22413)
The map_config_to_obj calls the run_commands  helper function,
which returns a list of results.
However, the map_params_to_obj return a single string.
Therefore, the comparison between the two datasets could never be equal,
breaking idempotency.
Also, the 'no banner' command should be run on absent only if there's a banner
text set.

Fixes #22194
2017-03-09 12:43:54 +00:00
Matt Clay
cfd313bced Disable ansible color output on sanity tests. 2017-03-08 12:18:16 -08:00
John R Barker
41f5648c44 Test system (#22420)
* ios_system

* tests for ios_system

* tests for *_system

* working ios_system on cli

* Typo

* Loopback10 (single word, upeprcase)

* Revert docs changes

* Working iosxr_system tests

* eos, not nxos

* nxos_system
2017-03-08 12:21:45 -07:00
Dave Kasberg
8102e66425 Fixes for idempotent issue in cnos_vlan module and fixes for vlag/portchannel tests. (#22385)
* misc fixes for idempotent issue in cnos_vlan

* Fix up hyperlinks in module documentation

* spell correction
2017-03-08 17:09:17 +00:00
Matt Clay
a64665ae91 Fix error handling in CI other script. 2017-03-08 01:31:53 -08:00
Matt Clay
3ab344e8bd Use lint/junit output for compile test. (#22395)
* Refactor sanity classes for use in all tests.
* Use lint/junit output for compile test.
* Add missing options for compile test.
* Fix early bailout on requirements install.
2017-03-08 00:47:21 -08:00
Matt Clay
fbf55886ba Use lint friendly output for python syntax checks. (#22390) 2017-03-07 20:27:50 -08:00
Matt Clay
9acf551674 Run all other tests on Shippable before failing. 2017-03-07 20:26:10 -08:00
Matt Clay
8f463fcdd2 Create bot friendly sanity output. (#22381) 2017-03-07 14:59:50 -08:00
Alex Lo
8e910cce8a ec2_group: description is only required when group state is present (#19791)
* description is only required when group state is present

also note that AWS requires a non-empty description when creating a security group

* clarify description requirement
2017-03-07 20:55:17 +01:00
René Moser
e0d38fb137 composer: fix escape working_dir (#22363)
* composer: fix escaping of path working_dir

* composer: fix pep8
2017-03-07 20:51:04 +01:00
Lujeni
d942196666 Use a dedicated directory for the mongodb modules (#22187)
* Use a dedicated directory for the mongodb modules
* Missing the RETURN documentation in mongodb_user
2017-03-06 13:14:14 -08:00
Matt Clay
3e4be156d7 Pre-compile regexes to speed up target processing.
Without this, changing a large number of files results in target
processing taking a very long time due to repeatedly compiling
the same patterns in a loop over many targets.
2017-03-06 12:35:12 -08:00
Marius Gedminas
15c7288ab9 Show diff when file: state=link changes the symlink target (#22243)
* Show diff when file: state=link changes the symlink target

* Integration test for symlink target change

* Also check soft link idempotency
2017-03-06 11:29:20 -05:00
Michał Masłowski
228131d1cd lambda: Fix adding environment variables to functions previously not having any (#22313) 2017-03-06 11:10:40 -05:00
René Moser
c1730c21ce cloudstack: cs_sshkeypair: fix fingerprint not used as identifier (#22276)
* cloudstack: cs_sshkeypair: fix fingerprint not used as identifier

* remove from legacy

* fix for 2 keys, one with name and one with fingerprint
2017-03-05 22:47:19 +01:00
Pilou
addedb12cf Inventory default groups 'all' and 'ungrouped': add tests and documentation (#21728)
* inventory: test 'all' & 'ungrouped' groups created by default

* Mention default groups 'all' & 'ungrouped'

* Update intro_inventory.rst

Minor grammatical edit.
2017-03-05 01:24:41 -08:00
Matt Clay
72c96b3ac3 Fix encoding issue in shippable downloader. 2017-03-03 16:38:36 -08:00
Matt Clay
673bfc06b9 Support option renaming in validate-modules. 2017-03-03 16:37:12 -08:00
Matt Martz
293e624235 Support matching original path for a moved module location 2017-03-03 15:13:14 -08:00
Adrian Likins
694c57de2e add python version info to --version (#22089)
* add python info to ansible --version
* Add unit tests for cli.CLI.version
2017-03-03 16:41:54 -05:00
Matt Martz
958ce4a252 Create custom JSONEncoder to stringify Exceptions 2017-03-03 11:12:37 -08:00
Matt Martz
d34153a61e Re-enable ssh retry tests with isolation fixes (#22221)
* Re-enable ssh retry tests with isolation fixes
* Don't use mock, use monkeypatch instead
2017-03-02 20:09:06 -08:00