Commit Graph

976 Commits (46b821d51fd372392d4ecca31fa62cb268949690)

Author SHA1 Message Date
Felix Fontein fc4bbff6e1
AWS: _facts -> _info (part 2) (#57626)
* Rename cloudwatchlogs_log_group_facts -> cloudwatchlogs_log_group_info.

* Rename elasticache_facts -> elasticache_info.

* redshift_facts -> redshift_info.

* Rename route53_facts -> route53_info.

* Rename rds_instance_facts -> rds_instance_info.

* Rename rds_snapshot_facts -> rds_snapshot_info.

* Rename iam_mfa_device_facts -> iam_mfa_device_info.

* Rename iam_role_facts -> iam_role_info.

* Rename iam_server_certificate_facts -> iam_server_certificate_info.

* Rename elb_application_lb_facts -> elb_application_lb_info.

* Renaming elb_classic_lb_facts -> elb_classic_lb_info.

* elb_target_facts -> elb_target_info.

* Rename elb_target_group_facts -> elb_target_group_info.

* Update porting guide.

* Add changelog.

* Fix module defaults (both for this PR and #57613).

* Two fixes.
5 years ago
xuxiaowei0512 05e6339c49 option is marked as required but specifies a default (#57257)
* required and default are conflicting
5 years ago
Kevin Breit 919f70c357 New module - meraki_malware (#56929)
* Initial commit for meraki_malware module
- Allows for manipulation of malware configuration

* Add full documentation and improve code coverage

* Add diff support

* Type change

* Sanity check fixes

* Convert org_id from str to int for consistency

* Sanity fixes again

* Fix argument type errors

* Remove ignore items for some Meraki modules so shippable is happy
5 years ago
ShachafGoldstein f137527201 $result.reboot_required = $feature_result.RestartNeeded (#56419)
* $result.reboot_required = $feature_result.RestartNeeded

* Update relevent PSLint ignores

* CI Problem with pslint and ignore.txt
5 years ago
Matt Martz 9c5b72147e
Validate types before asserting lengths (#56882) 5 years ago
Gonéri Le Bouder 32620b7e00 vsphere_copy: fix the E309 error (#56537)
Resolve the two following errors:

ERROR: lib/ansible/modules/cloud/vmware/vsphere_copy.py:0:0: E309 version_added for new option (host) should be '2.9'. Currently None
ERROR: lib/ansible/modules/cloud/vmware/vsphere_copy.py:0:0: E309 version_added for new option (login) should be '2.9'. Currently None
5 years ago
Pilou 98246f6032 consul modules: update documentation (#56408)
* consul modules: Python 2.6 is always required on managed node, document all types, improve parameter descriptions, fix typos
* consul_kv: add doc for retrieve parameter
5 years ago
Matt Clay a910d19533 Temporary fix for vsphere_copy CI failure. 5 years ago
Alicia Cozine 118cf3ece6
Cloud dev docs to rst (#56485)
* Moves developer docs for AWS, ovirt, and openstack modules out of lib/ansible/, integrates them with dev_guide, with abadger's fix to make python snippets pass rstcheck
5 years ago
Abhijeet Kasurde 5ef2c5314e Fixed error handling in github_issue module (#39652)
* Fixed error handling in github_issue module

Due to recent changes in github3.py library module stopped working.
This fix adds extra error handling for new changes in library.

Fixes: #39627

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Check version

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Refactor github_issue

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Matt Clay f9b56a5b56 Add sanity test to check for unwanted files. 5 years ago
Brian Coca deae5b1bce
remove deprecated get_md5 from stat (#55659)
* remove deprecated get_md5 from stat

  fixes #55309

* removed get_md5 from tests involving stat

* keep get_md5 but hide it

* rst it

* ammended comment

* ws

* added ignore for hidden md5
5 years ago
Toshio Kuratomi 3161a91d7e
Implement a framework for having common code for release scripts (#55893)
* Implement a framework for having common code for release scripts

* Release scripts will go through hacking/build-ansible.  build-ansible is
  a pluggable script which will set a directory that has common code for
  non-enduser scripts.  It will then invoke the plugin which implements
  that subcommand.  Uses straight.plugin for loading each sub-command.

* We're going to add tools which are needed to test ansible (the changelog
  generation, for instance) so we need to include the pieces relevant to
  that in the tarball.

* Add straight.plugin to the sanity test requirements for the same
  reason

* Skip compile test just for build-ansible plugins which won't be run as
  part of sanity tests.
5 years ago
Martin Krizek 8e82baba4a
zfs: deprecate key=value 'option' (#55699)
* zfs: deprecate key=value 'option'

Fixes #55318

* Not needed to ignore these anymore
5 years ago
Toshio Kuratomi b71133eeb5 Use LooseVersion instead of StrictVersion as StrictVersion doesn't understand "rc1" 5 years ago
Felix Fontein c8a15b9dbc crypto modules: use module_utils.compat.ipaddress when possible (#55278)
* Use module_utils.compat.ipaddress where possible.

* Simplify reverse pointer computation.

* Use dummy for unused variables.

* Remove from ignore list.

* Adjust fix.

* Fix text handling for Python 2.

* Add changelog.
5 years ago
Alex Stephen e298de0986 GCP deprecations (#53355)
* gcdns_record deprecation

* gcdns_zone deprecation

* gcp_forwarding_rule deprecation

* gcp_url_map deprecation

* gcspanner deprecation

* gcp_healthcheck deprecation

* porting guide

* test failures

* forgot to rename

* deprecating

* porting guide changes

* unit test fixes

* changing ignores
5 years ago
Matt Martz 07443a2bcd
Address 2.9 uri deprecations (#55330)
* Address 2.9 uri deprecations. Fixes #55310

* Add changelog fragment
6 years ago
Matt Martz 9f83139dcb
Don't register tests as filters (#55332)
* Don't register tests as filters. Fixes #55319

* Remove tests for deprecated functionality

* Remove no-tests-as-filters sanity tests

* Remove docs too

* Revert "Remove docs too"

This reverts commit 7daf457a74.

* Make no-tests-as-filters doc an orphan
6 years ago
Martin Krizek 4ec8599c38 apt: remove deprecated installed/removed aliases (#55338)
* apt: remove deprecated installed/removed aliases

Fixes #55311
6 years ago
Dag Wieers 9495ddbc21
ACI: Cleanup deprecated boolean behaviour (#55207)
* ACI: Cleanup deprecated boolean behaviour

* Remove from sanity ignore list
6 years ago
Jordan Borean 04cae4134f
Bump deps for ntlm-auth and PSScriptAnalyzer (#55269) 6 years ago
Toshio Kuratomi a1c8fc37e8 Remove modules which have ended their deprecation cycle
* Remove code but leave the metadata so that they can be listed as
  removed in documentation.
* Remove removed modules from validate-modules ignore
* Remove unittests for the removed nodules
* Remove links to removed modules and add list of removed moduels to the
  2.9 porting guide
6 years ago
Toshio Kuratomi e5a31e81b6 Add a script to generate a new porting guide
* porting-guide.py is allowed to be Python-3.6+ as it will only be run
  by release engineers
6 years ago
Swartz, Nathan 5e3a7ec1f5 Improve netapp_e_volume module and add unit tests.
netapp_e_volume was refactored for maintainability and its documentation
was improved for better clarity.
6 years ago
Matt Davis 1dc8436ed9
module_utils fixes in collections (#55118)
* module_utils fixes in collections

* fixed Windows module_utils in collections
* fixed more Python module_utils cases (from X import module)
* "medium style" Ansiballz modules now work properly with collections (ie, non-replacer but also not using basic.py)
* added more tests
* split Windows/POSIX exec

* sanity
6 years ago
Dag Wieers 025e9afe58 Windows pslint: Re-enable PSPossibleIncorrectComparisonWithNull (#55065)
* pslint fixes

* Fix up remaining sanity issues

* now fix silly errors I made
6 years ago
Micah Hunsberger 2b049238d6 win_firewall_rule only change arguments passed by user (#54297)
* win_firewall_rule only changes specified arguments
defaults are controlled by com object
integration test for built in rule

* removed ignore psaliases for win_firewall_rule

* direction and action are no longer required
program and service respect default values
documentation updated to reflect that defaults apply to rule creation
added test to disable a rule and verify other values have not changed

* fixed extra whitespace

* Move each description sentance to a new entry
6 years ago
Matt Davis 97446f0eca
Revert "Add a force_replace_host flag to win_domain_membership (#53542)" (#55056)
This reverts commit 85d836171b.

As discussed in WWG IRC meeting, we don't want Get-ADObject to be a dependency of win_domain_membership, and we need to be able to authenticate to the DC in some configs. We can revisit this change a different way for 2.9.
6 years ago
Felix Fontein df72317b29 Don't complain if type() is used. (#54849) 6 years ago
Sam Doran 3cd98a9fcc Use ansible.module_utils.six in inventory scripts (#55000)
* Use six from ansible.module_utils for inventory scripts

Remove skips from sanity test

* Change all imports of ConfigParser to use module_utils.six.moves

* Remove commented out lines

* Fix six imports
6 years ago
Andrey Klychkov 3eff72e886 postgresql_user: fix doc formatting, added return value, aliases, misc code changes (#54768)
* postgresql_user: refactoring

* postgresql_user: removed line from ignore.txt

* postgresql_user: removed lines from ignore.txt

* postgresql_user: removed lines from ignore.txt, fixes

* postgresql_user: removed lines from ignore.txt, fixes

* postgresql_user: removed lines from ignore.txt, fixes
6 years ago
Zim Kalinowski 69ca89858c
Renaming azure_rm_managed_disk for consistency (#54825) 6 years ago
Andrey Klychkov 40f65a54ec Postgresql privs reformat (#54717)
* postgresql_privs: fix doc format, pgutils

* postgresql_privs: added pgutils, ret value

* postgresql_privs: fix test

* postgresql_privs: fixes

* postgresql_privs: fixes

* postgresql_privs: fixed CI
6 years ago
René Moser 01f63ee871
cloudstack: fix E326 (#54657)
* cloudstack: remove choice list for hypervisor param

* cloudstack: streamline network_type with returned value by the API

* cloudstack: remove E326

* add changelog fragment
6 years ago
Kevin Subileau 09979e899f win_nssm: refactor to fix issues, support check mode and add more features (#45693)
* win_nssm: rename cmdlets to use approved verbs, rename service name parameters

* win_nssm: improve code style and cmdlets ordering

* win_nssm: always escape all command line parameters with Argv-ToString

fix error when the service name contains quotes

* win_nssm: use Fail-Json instead of exceptions and remove global try/catch

* win_nssm: small refactoring, inline some functions

* win_nssm: refactoring - add a generic cmdlet to idempotently set any nssm service parameter

* win_nssm: refactoring - inline some functions

To make the code more malleable for future changes

* win_nssm: change application, stdout_file and stderr_file options type to path

* win_nssm: deprecates app_parameters, rename app_parameters_free_form to arguments, and add support for list of parameters

* win_nssm: add support of check mode

* win_nssm: add working_directory option

* win_nssm: add display_name and description options

* win_nssm: minor changes

* win_nssm: remove some sanity exclusions

* win_nssm: avoid using aliases and minor style fixes

* win_nssm: doc and ui improvements

* win_nssm: remove sanity exclusions

* win_nssm: minor revision

* win_nssm: deprecates dependencies, start_mode, user and password parameters and some choices of state in favor of win_service

* win_nssm: fix style

* win_nssm: add executable option to specify the location of the NSSM utility

* win_nssm: add missing parameter types

* win_nssm: add diff mode support

* win_nssm: avoid displaying depreciation warning if default value is assigned

* win_nssm: fix variable scope

* win_nssm: use the explicit -LiteralPath parameter name instead of -Path

* win_nssm: fix documentation

* win_nssm: add porting guide entries

* win_nssm: add changelog fragment
6 years ago
David Passante eff1f8851c cloudstack: streamline modules doc (part 6) (#54641)
* Parameter types added
* Copyright format fixes
* Doc style fixes
* Examples format fixes
* validate-module errors fixes
6 years ago
David Passante 7f57d88f00 cloudstack: streamline modules doc (part 5) (#54523) 6 years ago
David Passante 601d20117d cs_service_offering: update params in arg spec and documentation (#54511)
* cs_service_offering: update params in arg spec and documentation

* fix documentation formatting error
6 years ago
Slava Maslennikov 85d836171b Add a force_replace_host flag to win_domain_membership (#53542)
* Add a force_replace_host flag to win_domain_membership

Satisfies https://github.com/ansible/ansible/issues/53539

* Rework backticks

* Bump version_added

* Check for existence of current hostname as well; use LDAPFilter during search

* Rename $force_replace_host to $allow_existing_computer_account

* Added docs, porting guide and minor nit in code
6 years ago
Jordan Borean e2d2874d81
win_user_right - fix non json output issue (#54495) 6 years ago
Toshio Kuratomi 5fb416ae34 Add a script to generate twitter and mailing list announcements
Announcements taken from https://github.com/ansible/community/wiki/RelEng:-ReleaseProcess
and then cleaned up:

* Update issue reporting blurb from feedback from acozine and gundalow
* Add a subject and to line for email output
* Ignore long line tests on the jinja templates (as jinja doesn't give
  enough control to get rid of newlines when text wrapping)
* Skip shebang and compile tests for older pythons since this is a
  release engineer-only script.  (ok'd by mattclay)
6 years ago
Matt Clay ade6977d66 Fix typo in doc_fragments path. 6 years ago
Ben Carter f99f88b034 fixing status option in documentation (#53785)
changing status option to statuses in the documentation

Adding choices to the argument spec to match the documentation from AWS.
Adding 'REVOKED', 'FAILED' to statuses documentation to match implementation.

Removing E322, E323 ignores for aws_acm_facts
6 years ago
Matt Clay 39bbadb2fd
Replace no-underscore-variable test with pylint. (#54140)
* Replace no-underscore-variable test with pylint.
* Update orphan handling for sanity test docs.
* Update command for listing tests.
6 years ago
Matt Clay 47f2101e8d Fix no-underscore-variable test. (#54137)
* Ignore lines with comments.
* Detect variables at the start of the line.
6 years ago
Jordan Borean 0bf14d61d0
Add PSCustomUseLiteralPath and update PSSA for pslint (#54080) 6 years ago
Toshio Kuratomi f5f4948480
Remove nose from unittests (#54055)
* Remove nose from unittests

This PR migrates the last of our unittests from using nose to using
pytest.  We don't need to install nose in our testing environments
anymore
6 years ago
Matt Clay 63ce588382 Update pylint and split runs more to avoid hangs. 6 years ago
David Passante ef6da8ec5c cloudstack: streamline modules doc (part 4) (#53874)
* cloudstack: streamline modules doc (part 4)

* Parameter types added
* Copyright format fixes
* Doc style fixes
* Examples format fixes
* validate-module errors fixes

* cs_network_offering: Rollback of the deletion of the choice list for supported_services param
6 years ago
David Passante 244a9a83aa cs_iso: fix missing param "is_public" (#53740)
* cs_iso: fix missing param "is_public"

* add changelog fragment
6 years ago
David Passante 495c197770 cloudstack: streamline modules doc (part 3) (#53412)
* cloudstack: streamline modules doc (part 3)

* Parameter types added
* Copyright format fixes
* Doc style fixes
* Examples format fixes
* Remove cs_loadbalancer_rule from ignore.txt

* cs_loadbalancer_rule: add "version_added" for params added into the documentation

* cs_loadbalancer_rule: ignore E309 for now

* cs_loadbalancer_rule: remove E309 from ignore.txt
6 years ago
Jordan Borean f297229b52
Add arg and doc validation for PowerShell modules (#53615)
* Add arg and doc validation for PowerShell modules

* Verify if pwsh exists before running it
6 years ago
Jordan Borean 830a11dd38
test: optimize win_psmodule tests (#53431) 6 years ago
Matt Clay 40318b49b2 Check extensions on changelog fragments. 6 years ago
Matt Clay 7c0bc9e4ac Fix no-assert code-smell regex. 6 years ago
Brian Coca b94bfed1a6
scan_packages: made adding package managers easier (#49079)
* made adding package managers easier

  added portage support

* moar pkg mgrs and moar info

 - added 'pkg' pkg manager (freebsd)
 - added pip
 - more apt info

* updated clgo

* Updates from feedback

Co-Authored-By: bcoca <bcoca@users.noreply.github.com>

* incorporated more feedback and added docstrings

* moar from feedback

  - made manager list dynamic and names based on class
  - better not found msg
  - made abstract metaclass again
  - test is now init exception
  - module to global
  - better dedupe comments

* more targetted errors/warnings

* added strategy, reordered to conserve priority

* rpm > apt

* move break to top

* fix trate

* piping it

* lines and meta

* refactored common functions

 - moved pip into it's own module
 - cleaned up base clases
 - ensure 'lower' match in package_facts

* missing license

* avoid facts

* update clog

* addressed feedback

* fix clog

* cleanup

* upd

* removed pip as that was removed

* renamed cpan

* added a single line since 2 lines are needed to be

readabnle instead of just 1 line, it is a huge problem otherwise

* fix internal ref

* not intended in this round

* updated as per fb
6 years ago
Dag Wieers c44e83ee13 rhevm: Fix validate-modules issues (#52436)
This PR includes:

* Adding parameter types
* Fix validate-modules issue
* Improve parameter types and resulting changes

This PR needs to be verified and tested by maintainer(s).
6 years ago
Wojciech Sciesinski 8136e2e4fe Extend win_psmodule - the second attempt, the previous was #46516 (#50621)
* Extend win_psmodule - rebased at 2019-01-07

* Change a way how defined parameters are added to the list

* Correct registering a repository

* Change way how tests for the check_mode: true are run

* Post-review updates

* Post-review updates -2

* Post-review updates -3

* Switch to PowerShell loop

* Minor updates

* Remove variants of an exception handling

* Change error handling
6 years ago
Jordan Borean 6b294eab4d
win_dsc - Add argument validation and other fixes (#53093)
* win_dsc - Add argument validation and other fixes

* Fix doc issues
6 years ago
Matt Martz a639dc6d88
Add a new check to ensure that module arguments are valid python identifiers (#53278)
* Add a new check to ensure that module arguments are valid python identifiers

* Move the check up higher, out of the if docs block

* Skip validate-modules on py2

* Remove errant alias
6 years ago
Viktor Utkin b2a7561a7f [win_get_url] feature: Add support `checksum` to module win_get_url (#51986)
* set valid_until equal to current time + spot_wait_timeout

* Add checksum check for downloaded file.

* refactoring

* fix typo

* add fixes

* mart try,catch handling

* revert lib/ansible/modules/cloud/amazon/ec2.py from upstream

* refactoring

* remove empty lines

* add checksum verification for existing file

* fix current file check

* refactoring destination file check

* add handling exceptions

* refactoring

* Added download file hash data from url

* fix string aligning

* fix bug with uri

* Added get hash from multy-string file

* Added URI support for checksum file location

* refactoing

* Remove any non-alphanumeric characters for hash from url

* fix discussions; add support for PS3

* refactoring

* add size return value

* checkout from upstream for lib/ansible/modules/cloud/amazon/ec2.py

* add Ansible.ModuleUtils.Legacy support; refactoring

* Copyright added

* Checking files size before and after downloading added.

* remove unused code

* Corrected regexp for dotted slashed file name prefix in hash-file

* hotfix typo error; add int tests

* remove legacy module support; split checksum to checksum, checksum_algorithm, checksum_url

* changed default hash algorithm

* Fixed case for ContentLength = -1

* Old comment removed

* fix typo

* Remove file size check before downloading

* add alias to ; fix tests

* adjust tests; fix lint warnings from PSScritpAnalyzer

* workaround for bug in win_chocolatey module on win2008

* remove win_get_url.ps1 from /test/sanity/pslint/ignore.txt

* add checksum_algorithm as retuen value

* first normalise before return Result

* resolve discussions

Signed-off-by: Viktor Utkin <viktor.utkin7@yandex.ru>

* fix discussions
fix http tests as discussed

* fix last discussions

* Reduce code duplication and add idempotency check

* fix sanity issue and remove testing code

* move back to using tmp file for checksum comparison
6 years ago
Matt Martz f0a63e783d
validate-modules improve empty version_added handling (#53177)
* Improve empty version_added handling

* Remove unrelated ignore
6 years ago
Matt Clay 29c9b4001d Remove invalid validate-modules ignore entry. 6 years ago
Mariusz Mazur fb4d0d84ec Add kubevirt_cdi_upload module (#52990) 6 years ago
Matt Martz 35f5ca8295 Don't allow an empty version_added 6 years ago
Matt Martz 7f2e724203 Don't document a type for an argument which uses a callable (#53008)
* Don't document a type for an argument which uses a callable
* Update ignore.txt.
6 years ago
Dag Wieers 3ced545d06
validate-modules: Fix some files modules (#52440)
This PR includes:
- fixes to validate-modules issues

All modules already include parameter types.

The remaining files-modules have action plugins, so comparing to the arg_spec only is incorrect.
6 years ago
Dag Wieers 4670e41a30
validate-modules: Fix net_tools modules (#52489)
This PR includes:

* Fixes to open validate-modules issues
* Adding parameter types
6 years ago
Rhys Campbell 7f50f467fe mongodb_replicaset module and test exception (#49690)
* Clean up from previous fork

* Minor doc update

* Fix doc string return type

* Minor doc updates

* Keeping fresh

* Various changes to documentation, cosmetics and code logic

Please test :-)

* Fix typo

* Various small changes as requested

* Remove traceback ref

* try catch changes

* Tidy description

* Correct data type in documentation

* Fix for 4.0
6 years ago
Matt Martz df5b8f65ca
Don't worry with type changes, just compare strings (#52827) 6 years ago
John R Barker f6c2104d79
Update validate-modules/ignore to make devel green (#52820)
Need to fix the modules, though need CI green first
6 years ago
Dag Wieers cd77ea3eb3 serverless: Fix validate-modules issues (#52435)
This PR includes:

* Adding parameter types
* Fix validate-modules issue
* Improve parameter types and resulting changes

This PR needs to be verified and tested by maintainer(s).
6 years ago
Dag Wieers 365ded2df6 nmcli: Fix known validate-modules issues (#52493)
This PR includes:
- Adding parameter types
- Fix validate-modules issue
- Improve parameter types and resulting changes

This PR needs to be verified and tested by maintainer(s).
6 years ago
Dag Wieers 1f9da61bce cyberark_user: Fix validate-modules issue (#52515)
This PR includes:
- validate-modules fixes
- fix parameter types
- code bugfix
6 years ago
Dag Wieers 0d1aebe064 kubernetes: Clean up parameter types (#52543)
This PR includes:
- Parameter types added
- Copyright format fixes
- Short license statement

This breaks out PR #52182
6 years ago
Matt Martz b54086ef02
Merge doc fragments in earlier (#52193)
* Merge doc fragments in earlier

* Move it even higher

* Remove errant docs key

* Fix type
6 years ago
Dag Wieers 8c74df5e67
validate-modules: Fix all system modules (#52384)
This PR includes validate-modules fixes for all system modules.
Except a few that are deliberately implemented like this.
6 years ago
Matt Martz 60255efc32
Don't error on type changes, cast to string and compare (#52505) 6 years ago
Alex Stephen 6ae04017d8 GCE deprecation warning (#52116)
* GCE deprecation warning

* porting guide typo

* fixing ignores

* moving error code back

* underscore marking on gce

* forgot to change status
6 years ago
Dag Wieers d3bebb661c validate-modules: Harmonize error messages (#52385)
When fixing known errors, the error messages did not make it easy to
find what parameter was having issues (because it was not in the errpr).

Now it consistently starts with the parameter name, and then shows first
the argspec and then the documentation values.

This helps quick assessments.
6 years ago
Felix Fontein ef3d86255d docker_* modules: remove from validate-modules ignore list (#52402)
* Remove docker_* modules from validate-modules ignore list.

* Adjust types of cacert_path, cert_path and key_path.

* Fix type of update_failure_action in docker_swarm_service.
6 years ago
Abhijeet Kasurde e0d8d9c2bf validate-modules: Documentation bool (#50085)
* validate-modules: Documentation bool

This check allows to catch cases where type of argument is different than documentation does.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Wrong comparison for 'str'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Add ignore.txt

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Fix logic and clean up ignore.txt
6 years ago
Dag Wieers 677c04c01d
Sanity fixes to parameter types (#52325) 6 years ago
Dag Wieers f9ab9b4d68 Assorted pylint fixes 6 years ago
Dag Wieers 203caf2570
Fix module issues (#52209) 6 years ago
Dag Wieers cedd9d9926
crypto: Fix known issues in modules (#52302)
* crypto: Fix known issues in modules

This fixes a few issues reported by 'validate-modules'.

* Fix whitespace
6 years ago
Dag Wieers 27dfdb6a6a doc_fragments: Clean up parameter types (database) (#52178)
* module_utils: Clean up parameter types (database)

This PR includes:

- Parameter types added
- Copyright format fixes
- Short license statement
- Description fixes (only for a few files, then I stopped :-))

* Fix validate-modules test ignores
6 years ago
Dag Wieers cd9471ef17 Introduce new 'required_by' argument_spec option (#28662)
* Introduce new "required_by' argument_spec option

This PR introduces a new **required_by** argument_spec option which allows you to say *"if parameter A is set, parameter B and C are required as well"*.

- The difference with **required_if** is that it can only add dependencies if a parameter is set to a specific value, not when it is just defined.
- The difference with **required_together** is that it has a commutative property, so: *"Parameter A and B are required together, if one of them has been defined"*.

As an example, we need this for the complex options that the xml module provides. One of the issues we often see is that users are not using the correct combination of options, and then are surprised that the module does not perform the requested action(s).

This would be solved by adding the correct dependencies, and mutual exclusives. For us this is important to get this shipped together with the new xml module in Ansible v2.4. (This is related to bugfix https://github.com/ansible/ansible/pull/28657)

```python
    module = AnsibleModule(
        argument_spec=dict(
            path=dict(type='path', aliases=['dest', 'file']),
            xmlstring=dict(type='str'),
            xpath=dict(type='str'),
            namespaces=dict(type='dict', default={}),
            state=dict(type='str', default='present', choices=['absent',
'present'], aliases=['ensure']),
            value=dict(type='raw'),
            attribute=dict(type='raw'),
            add_children=dict(type='list'),
            set_children=dict(type='list'),
            count=dict(type='bool', default=False),
            print_match=dict(type='bool', default=False),
            pretty_print=dict(type='bool', default=False),
            content=dict(type='str', choices=['attribute', 'text']),
            input_type=dict(type='str', default='yaml', choices=['xml',
'yaml']),
            backup=dict(type='bool', default=False),
        ),
        supports_check_mode=True,
        required_by=dict(
            add_children=['xpath'],
            attribute=['value', 'xpath'],
            content=['xpath'],
            set_children=['xpath'],
            value=['xpath'],
        ),
        required_if=[
            ['count', True, ['xpath']],
            ['print_match', True, ['xpath']],
        ],
        required_one_of=[
            ['path', 'xmlstring'],
            ['add_children', 'content', 'count', 'pretty_print', 'print_match', 'set_children', 'value'],
        ],
        mutually_exclusive=[
            ['add_children', 'content', 'count', 'print_match','set_children', 'value'],
            ['path', 'xmlstring'],
        ],
    )
```

* Rebase and fix conflict

* Add modules that use required_by functionality

* Update required_by schema

* Fix rebase issue
6 years ago
Matt Clay 1f3a74c0c8
Improve import sanity test output handling. (#52136)
Handling of unexpected output for the following is improved:

- stdout
- stderr
- warnings
6 years ago
Matt Clay 6cba471958 Remove unnecessary validate-modules ignore entry. 6 years ago
Mariusz Mazur 34671a64b3 k8s_auth: new k8s module for handling auth (#50807)
* k8s*: add a reference to k8s_auth in all the modules' descriptions

* k8s_auth: new k8s module for handling auth

* k8s_auth: ignore E203

Can't use module_utils.urls, since that lacks user CA support, which is
a critical feature of what this module does.
6 years ago
Guillaume Martinez 959939b866 Refactor gitlab modules (#51141)
* gitlab_group: refactor module

* gitlab_user: refactor module

* gitlab_group, gitlab_user; pylint

* gitlab_project: refactor module

* gitlab_group, gitlab_project, gitlab_user: Enchance modules

- Add generic loop to update object
- Enchance return messages
- PyLint

* gitlab_runner: refactor module

* gitlab_hooks: refactor module

* gitlab_deploy_key: refactor module

* gitlab_group: enchance module and documentation

- Enchange function arguments
- Add check_mode break
- Rewrite module documentation

* gitlab_hook: enchance module and documentation

- Rewrite documentation
- Enchance function parameters
- Rename functions

* gitlab_project: enchance module and documentation

- Rewrite documentation
- Enchance function parameters
- Add try/except on project creation

* gitlab_runner: enchance module and documentation

- Rewrite documentation
- Fix Copyright
- Enchance function arguments
- Add check_mode break
- Add missing function: deletion

* gitlab_user: enchance module and documentation

- Rewrite documentation
- Enchance function parameters
- Add check_mode break
- Add try/except on user creation

* gitlab_deploy_key, gitlab_group, gitlab_hooks, gitlab_project,
gitlab_runner, gitlab_user: Fix residual bugs

- Fix Copyright
- Fix result messages
- Add missing check_mode break

* gitlab_deploy_key, gitlab_group, gitlab_hooks, gitlab_project, gitlab_runner, gitlab_user: pylint

* gitlab_runner: Add substitution function for 'cmp' in python3

* unit-test: remove deprecated gitlab module tests

- gitlab_deploy_key
- gitlab_hooks
- gitlab_project

Actually, they can't be reused because of the modification of the way that the module communicate with the Gitlab instance. It doesn't make direct call to the API, now it use a python library that do the job. So using a pytest mocker to test the module won't work.

* gitlab_deploy_key, gitlab_group, gitlab_hooks, gitlab_project, gitlab_runner, gitlab_user: add copyright

* gitlab_deploy_key, gitlab_group, gitlab_hooks, gitlab_project, gitlab_runner, gitlab_user: Support old parameters format

* module_utils Gitlab: Edit copyright

* gitlab_deploy_key, gitlab_group, gitlab_hooks, gitlab_project,
gitlab_runner, gitlab_user: Unifying module inputs

- Rename verify_ssl into validate_certs to match standards
- Remove unused alias parameters
- Unify parameters type and requirement
- Reorder list order

* gitlab_deploy_key, gitlab_group, gitlab_hooks, gitlab_project, gitlab_runner, gitlab_user: Unifying module outputs

- Use standard output parameter "msg" instead of "return"
- Use snail_case for return values instead of camelCase

* validate-module: remove sanity ignore

* BOTMETA: remove gitlab_* test

- This tests need to be completely rewriten because of the refactoring
of these modules
- TodoList Community Wiki was updated

* gitlab_user: Fix group identifier

* gitlab_project: Fix when group was empty

* gitlab_deploy_key: edit return msg

* module_utils gitlab: fall back to user namespace is project not found

* gitlab modules: Add units tests

* unit test: gitlab module fake current user

* gitlab_user: fix access_level verification

* gitlab unit tests: use decoration instead of with statement

* unit tests: gitlab module skip python 2.6

* unit tests: gitlab module skip library import if python 2.6

* gitlab unit tests: use builtin unittest class

* gitlab unit tests: use custom test class

* unit test: gitlab module lint

* unit tests: move gitlab utils

* unit test: gitlab fix imports

* gitlab_module: edit requirement

python-gitlab library require python >= 2.7

* gitlab_module: add myself as author

* gitlab_modules: add python encoding tag

* gitlab_modules: keep consistency between variable name "validate_certs"

* gitlab_modules: enchance documentation

* gitlab_runner: fix syntax error in documentation

* gitlab_module: use basic_auth module_utils and add deprecation warning

* gitlab_module: documentation corrections

* gitlab_module: python lint

* gitlab_module: deprecate options and aliases for ansible 2.10

* gitlab_group: don't use 'local_action' is documentation example

* gitlab_module: correct return messages

* gitlab_module: use module_util 'missing_required_lib' when python library is missing

* gitlab_module: fix typo in function name.

* gitlab_modules: unify return msg on check_mode

* gitlab_modules: don't use deprecated options in examples
6 years ago
Matt Martz dfee94dfc7
Validate modules prevent version change (#51549)
* Add logic to catch version changes in docs

* Add in doc fragments before doing doc comparisons

* Handle new module scenario

* historical is only allowed in alreay present modules

* Don't repr StrictVersion
6 years ago
Toshio Kuratomi 0ec4e0a842 Disable the update-bundled test during normal operation
This is enabled once per release cycle in a PR so that the release
manager can open bugs for the Ansible team to update the bundled code.
6 years ago
Toshio Kuratomi dfd8b659c0 Have update-bundled check for updates to all bundled code
Add a test for whether we have bundled code inside of ansible that needs to be updated
6 years ago
Matt Davis 6654c7aeea
fix string_format sanity check (#51780)
* newer version of Pylint moved the impl; use conditional import to find for new/old
6 years ago
Matt Clay 06d83bae05 Support `ignore_changes` in code-smell tests. 6 years ago
Dennis Lerch e3006e8443 add diff_mode_enabled to documentation
option 'diff_mode_enabled' is not mentioned in documentation

+label: docsite_pr
6 years ago
Jordan Borean f27078df52
win_power_plan: fix for Windows 10 and Server 2008 compatibility (#51471) 6 years ago