Commit Graph

328 Commits (2be2ae366ea3779d247c9c4f0294fa43f3d1ef84)

Author SHA1 Message Date
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
5 years ago
Dag Wieers 677c04c01d
Sanity fixes to parameter types (#52325) 5 years ago
Dag Wieers 203caf2570
Fix module issues (#52209) 5 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
5 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
5 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
5 years ago
Matt Clay 6cba471958 Remove unnecessary validate-modules ignore entry. 5 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.
5 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
5 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
5 years ago
Dennis Lerch e3006e8443 add diff_mode_enabled to documentation
option 'diff_mode_enabled' is not mentioned in documentation

+label: docsite_pr
5 years ago
Sebastian 48107ac212 junos_config documentation missing "update" choice (#51299)
* Update junos_config.py

The current junos_config module documentation only lists "merge","override" and "replace" as update parameter choices. Looking into junos_python.py "update" is another option which is really helpful and in my opinion the most needed option.

'''
update=dict(default='merge', choices=['merge', 'override', 'replace', 'update'])
'''

+label: docsite_pr

* Fixup Update junos_config.py

The current junos_config module documentation only lists "merge","override" and "replace" as update parameter choices. Looking into junos_python.py "update" is another option which is really helpful and in my opinion the most needed option.

'''
update=dict(default='merge', choices=['merge', 'override', 'replace', 'update'])
'''

Co-Authored-By: crab86 <sgesenhoff@gmail.com>
6 years ago
Daniel Speichert 1a105a99dc hpilo_boot: fix module doc to match code and logic (#51360)
* hpilo_boot: fix module doc to match code and logic

There is no explicit nor implied value for media.
In fact, not choosing media makes perfect sense.

* Remove ignored sanity test failure
6 years ago
Jonathan 20936bbc3d module mongodb_user fix roles default value (#46443) (#46526)
* module mongodb_user fix roles default value (#46443)

* mongodb_user remove ignoring test E324

* mongodb_user add changelog (#464443)

* mongodb_user change doc to set parameter roles as None (#464443)

* mongodb_user fix lint in changelog fragment (#464443)

* mongodb_user : remove E325 exception in test
6 years ago
ABond d55479d063 DigitalOcean module deprecation (#47272) 6 years ago
Dag Wieers 30227ace98
Fix parameter types and other fixes (#50111)
* Fix parameter types and other fixes

* Fix issues after review

* Fix Windows-references in system/files modules

This PR includes:
- Replacing version/v with just Ansible X.Y
- Removing Windows-alternatives from notes

* Update lib/ansible/modules/system/parted.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/system/service.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/system/service.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Revert type change, move to separate PR

* Update lib/ansible/modules/files/replace.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/files/replace.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/files/replace.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/files/replace.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/files/replace.py

Co-Authored-By: dagwieers <dag@wieers.com>

* Update lib/ansible/modules/files/replace.py

Co-Authored-By: dagwieers <dag@wieers.com>
6 years ago
Brian Coca 91d8383898 added missing docs for option in acl module (#50775)
* added missing docs for option in acl module
* remove acl from ignore
6 years ago
Matt Martz 9a520b26e3
Make sure to clean up even if an exception occurs (#50620) 6 years ago
Anil Kumar Muraleedharan eab3b02cb3 Refactoring of cnos_interface module like what followed by other vendors (#49927)
* Refactoring of cnos_interface module like what followed by other vendors

* To remove cnos-interface from E326 validation ignore list

* Effect of default parameters impacted UT
6 years ago
Matt Clay 97de7c133e Fix no metadata traceback in validate-modules. 6 years ago
Dag Wieers 05c6ff79f9 Convert to reduced list of known types (#50010) 6 years ago
Matt Martz 6025990fe9
Remove the use of mock from validate-modules (#50098)
* Remove the use of mock from validate-modules

* Monkeypatch AnsibleModule.__init__ not AnsibleModule
6 years ago
Dag Wieers 15d39f9108 Sanity fixes in various modules (#50080) 6 years ago
Toshio Kuratomi e09196f760 Fix validate-modules to not complain about sys.exit in comments 6 years ago
Dag Wieers baf0ad2309 Docs: Add a "seealso" section to the module docs (#45949)
* Docs: Add a separate  "seealso" section to the module docs
to list related modules and/or related references. This clears up the notes
section for things that are actual notes.

So you can add a section in your module documentation and four types of
references are possible.

    seealso:

    # Reference by module name
    - module: aci_tenant

    # Reference by module name, including description
    - module: aci_tenant
      description: ACI module to create tenants on a Cisco ACI fabric.

    # Reference by rST documentation anchor
    - ref: aci_guide
      description: Detailed information on how to manage your ACI infrastructure using Ansible.

    # Reference by Internet resource
    - name: APIC Management Information Model reference
      description: Complete reference of the APIC object model.
      link: https://developer.cisco.com/docs/apic-mim-ref/

This PR also includes:

- Implements ansible-doc support
- Implements schema support for the seealso options
- Updates to the development documentation
- Rename filter convert_symbols_to_format to rst_ify, cfr the existing html_ify and tty_ify filters
  - This makes the existing template a lot easier to read and fixes the confusion I had myself rereading the template (again).
- We fixed the possible suboption types (which was limited to 'bool' only)

* Use latest stable instead of devel docs
6 years ago
Abhijeet Kasurde 1763c8123b
AWS: Add support for available db types (#48703)
Add several database types which are supported by AWS in valid engine type.

Fixes: #48623

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Anil Kumar Muraleedharan 7a81d859c5 Refactoring cnos_vlan in line with ios, eos etc. (#48924)
* Refactoring cnos_vlan in line with ios, eos etc.
6 years ago
Abhijeet Kasurde bc3e7bbeba
E325 Removal - Part II (#49196)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 9b732df436
E325 removal - Part I (#49136)
Remove E325 from Amazon modules

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Martz 46b465283c
Fix metadata comparison (#49133) 6 years ago
Matt Martz 7287d396e2 Prevent metadata changes in a stable branch (#48994) 6 years ago
John R Barker 75407d3e43
Validate DOCUMENTATION.author (#48993)
* Validate DOCUMENTATION.author

Ensure that author line includes a GitHub account
6 years ago
Jordan Borean 501acae5ab
Added basic equivalent to PowerShell modules (#44705)
* Added basic equivalent to PowerShell modules

* changes based on latest review

* Added tests

* ignore sanity test due to how tests are set up

* Changes to work with PSCore

* Added documentation and change updated more modules

* Add some speed optimisations to AddType

* fix some issues in the doc changes

* doc changes
6 years ago
Abhijeet Kasurde 57c9532cad OpenStack: add an alias for name (#47972)
This fix adds an additional alias for name parameter viz. subnet

Fixes: #37352

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
René Moser 064530b72e
cs_network_acl_rule: fix doc and sanity (#47835)
* cs_network_acl_rule: fix doc and sanity

* doc styling
6 years ago
Dag Wieers b7e77c4274 BOTMETA: Move rabbitmq modules to own directory (#46064)
Moving rabbitmq modules to own directory makes it possible to automatically include $team_rabbitmq for new modules.
6 years ago
Matt Clay 8d00afc013 Ignore user module use of subprocess. 6 years ago
Shuang Wang d302485f99 option [others] of get_url is unnecessary (#47005)
* parameters [others] of get_url is unnecessary

* delete a blank line

* test

* delete ignore

* Update get_url.py
6 years ago
Justin England 0bc5b799a6 Update win_scheduled_task.py (#46720)
* Update win_scheduled_task.py to document that the duration of a task trigger can be null, which will cause it to run indefinitely - docs update makes use of suboptions

* Add a fix for the validate-modules schema
6 years ago
Pilou 955579cd72 rabbitmq_user: 'node' parameter: add default value (#38156)
* Remove unnecessary workaround

* add test: set RABBITMQ_NODENAME environment variable

The following error occurs:

  TASK [rabbitmq_user : Add user] ***
  fatal: [testhost]: FAILED! => {
    "changed": false,
    "cmd": "/usr/sbin/rabbitmqctl -q list_users",
    "rc": 69,
    "msg": "Error:********@c65c2bc59398'. Please see diagnostics information and suggestions below.\n\nMost common reasons for this are:\n\n * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)\n * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)\n * Target node is not running\n\nIn addition to the diagnostics info below:\n\n * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more\n * Consult server logs on node test@c65c2bc59398\n\nDIAGNOSTICS\n===========\n\nattempted to contact:********@c65c2bc59398\n * effective user's home directory: /var/lib/rabbitmq\n * Erlang cookie hash: 3MxcYFrJzfhEL+FlUfLlQw==",
    "stderr":  [...],
    "stderr_lines": [
      "Error: unable to perform an operation on node 'test@c65c2bc59398'. Please see diagnostics information and suggestions below.", "",
      "Most common reasons for this are:", "",
      " * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)",
      " * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)",
      " * Target node is not running", "",
      "In addition to the diagnostics info below:", "",
      " * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more",
      " * Consult server logs on node test@c65c2bc59398", "",
          "DIAGNOSTICS", "===========", "",
          "attempted to contact: [test@c65c2bc59398]", "",
          "test@c65c2bc59398:",
      "  * connected to epmd (port 4369) on c65c2bc59398",
      "  * epmd reports: node 'test' not running at all",
      "                  other nodes on c65c2bc59398: [rabbit]",
      "  * suggestion: start the node", "",
      "Current node details:",
      " * node name: rabbitmqcli2@c65c2bc59398",
      " * effective user's home directory: /var/lib/rabbitmq",
      " * Erlang cookie hash: 3MxcYFrJzfhEL+FlUfLlQw==", ""
    ],
    "stdout": "",
    "stdout_lines": []
  }

* node parameter: fix default value

'rabbit' is the default value mentioned in the module documentation.
6 years ago
Sandra McCann 08c392477e made sros_config docs match code for match options (#46135)
* made docs match code for match options

* fixed shippable error
6 years ago
René Moser 7f92a8c94c
cs_staticnat: fix sanity (#46037) 6 years ago
René Moser c09b785a66
cs_instance: doc: fix typo in examples (#46035) 6 years ago
Matt Martz 86e8d21667
Perform full RETURN schema validation in one step, don't try to loop (#46079) 6 years ago
René Moser 83ec418470
cs_loadbalancer_rule_member: fix error handling (#46012)
* make use of query_api
* fix sanity
6 years ago
max-allan-surevine cb460dee74 Update keycloak_client.py (#43547)
* Update keycloak_client.py to document the 'realm' parameter, eliminate E322 ignore
6 years ago
Dag Wieers 2edf20d1ed Docs: Avoid use of 'default: null' (#45795)
Various modules document the default 'null' value, but it causes None to
be shown in the documentation explicitly.
6 years ago
John R Barker 78201d1c32 Allow removed_in: 2.12 (#45732) 6 years ago
Brian Coca 64c594d226
correct and clarify deprecation (#45234)
* correct and clarify deprecation
6 years ago
Matt Martz f89d873698
Stub out modules scheduled for 2.8 removal (#44985)
* Remove modules scheduled for 2.8

* Add changelog and porting guide

* Skip docs test on removed modules

* Don't link to removed modules
6 years ago
newtonne 30fd326953 Various updates to macports module (#44605)
- Add support for installing specific variants of a port.
- Add support for using yaml lists with 'name' parameter, rather than comma-separated lists.
- Add to and clarify documentation and examples.
- Use Macports nomenclature:
  - s/package/port/g
  - Rename update_cache to sync_ports but keep update_cache as an alias. Remove undocumented update-cache alias.
  - Remove undocumented 'pkg' alias for 'name'. Replace with 'port' alias and document it.
- Print stdout and stderr output if `port sync` fails.
- Print stderr output, rather than stdout, if `port install/uninstall/activate/deactivate` fail.
6 years ago
Chris Archibald 7cded31ec9 Depreciate elementsw modules (#44792)
* rename deprecated files
6 years ago
René Moser dd953dbe96
cs_template: implement update and revamp (#37015) 6 years ago
Michael Price f89374bf6d Update the ignore and doc_fragments for E-Series
Make the generic updates to remove unneeded ignores and improve the
documentation for the NetApp E-Series modules.
6 years ago
Toshio Kuratomi 68c60ad307 Change validate-modules for removed modules
Removed modules now don't have documentation.  Need to account for that
when checking them in validte-modules
6 years ago
Aren 9db3e597f3 state: present added in docs (#37197)
* state: present added in docs

* atomic_container.py docs now match argspec, enforce test
6 years ago
Michael Price ad91793428 Resolve issues in NetApp E-Series Host module (#39748)
* Resolve issues in NetApp E-Series Host module

The E-Series host module had some bugs relating to the update/creation
of host definitions when iSCSI initiators when included in the
configuration. This patch resolves this and other minor issues with
correctly detecting updates.

There were also several minor issues found that were causing issues with
truly idepotent updates/changes to the host definition.

This patch also provides some unit tests and integration tests to help
catch future issues in these areas.

fixes #28272

* Improve NetApp E-Series Host module testing

The NetApp E-Series Host module integration test lacked feature test
verification to verify the changes made to the storage array.

The NetApp E-Series rest api was used to verify host create, update, and
remove changes made to the NetApp E-Series storage arrays.
6 years ago
Ondra Machacek 24c26aded8 oVirt: Add depracation warning to all modules (#44440) 6 years ago
/v\atthew L Daniel d7e66f16a6 Correct the default doc for attached in ec2_eni (#44523)
* Correct the default doc for attached in ec2_eni

Also corrected a typo in the summary

* Address ansible-test sanity error about E324

* Fix and remove the E325 suppression for ec2_eni
6 years ago
Chris Archibald 9dceca8a88 Deprecated Old NetApp Cdot Modules (#43781)
* MVP2 Post ElementSW OSRB sync

* Revert "MVP2 Post ElementSW OSRB sync"

This reverts commit c13db2ad962cd56bffce052c2891c558a2240c72.

Undoing bad push

* move deprecated files

* add documentation

* add new line

* Fix version issue

* fix issue with ignore file, hopefully

* Add ontap modules to porting guide

* fix refs

* add _module to ref
6 years ago
René Moser 1fb0e11b56
vultr: rename prefix vr_to vultr_ (#43994)
* vultr: rename modules

* replace string vr_ with vultr_

* add deprecation warning

* fix sanity tests

* add changelog
6 years ago
Chris Archibald 479408330e Adding Common files for NetApp ElementSW release (#43727)
* MVP2 Post ElementSW OSRB sync

* Revert "MVP2 Post ElementSW OSRB sync"

This reverts commit c13db2ad962cd56bffce052c2891c558a2240c72.
6 years ago
Matt Martz 54e4c53f00
Ensure removed_in is StrictVersion before comparing (#43835)
* Ensure removed_in is StrictVersion before comparing

* Catch ValueError with StrictVersion on incompatible versions
6 years ago
Matt Martz 01c0446cb5
Add AnsibleModule signature schema, and fix associated issues (#43512) 6 years ago
Florian Braun 74af52533f Variable Timout for Katello Module + Documentation (#41834)
* Changed Foreman timeout to be setable via a parameter
Added a Parameter to set the timout to wait for the started Foreman actions
by the user instead of using the hard coded 1000 Seconds

* katello module screamed for more docu :)

* fix docu + some ci findings
made docu better and moved chices in relations to other options to the description

* added a quote to description and removed wrong combination of param product

* Removed choices from params
also removed katello from a ignore file
6 years ago
Toshio Kuratomi 52449cc01a AnsiballZ improvements
Now that we don't need to worry about python-2.4 and 2.5, we can make
some improvements to the way AnsiballZ handles modules.

* Change AnsiballZ wrapper to use import to invoke the module
  We need the module to think of itself as a script because it could be
  coded as:

      main()

  or as:

      if __name__ == '__main__':
          main()

  Or even as:

      if __name__ == '__main__':
          random_function_name()

  A script will invoke all of those.  Prior to this change, we invoked
  a second Python interpreter on the module so that it really was
  a script.  However, this means that we have to run python twice (once
  for the AnsiballZ wrapper and once for the module).  This change makes
  the module think that it is a script (because __name__ in the module ==
  '__main__') but it's actually being invoked by us importing the module
  code.

  There's three ways we've come up to do this.
  * The most elegant is to use zipimporter and tell the import mechanism
    that the module being loaded is __main__:
    * 5959f11c9d/lib/ansible/executor/module_common.py (L175)
    * zipimporter is nice because we do not have to extract the module from
      the zip file and save it to the disk when we do that.  The import
      machinery does it all for us.
    * The drawback is that modules do not have a __file__ which points
      to a real file when they do this.  Modules could be using __file__
      to for a variety of reasons, most of those probably have
      replacements (the most common one is to find a writable directory
      for temporary files.  AnsibleModule.tmpdir should be used instead)
      We can monkeypatch __file__ in fom AnsibleModule initialization
      but that's kind of gross.  There's no way I can see to do this
      from the wrapper.

  * Next, there's imp.load_module():
    * https://github.com/abadger/ansible/blob/340edf7489/lib/ansible/executor/module_common.py#L151
    * imp has the nice property of allowing us to set __name__ to
      __main__ without changing the name of the file itself
    * We also don't have to do anything special to set __file__ for
      backwards compatibility (although the reason for that is the
      drawback):
    * Its drawback is that it requires the file to exist on disk so we
      have to explicitly extract it from the zipfile and save it to
      a temporary file

  * The last choice is to use exec to execute the module:
    * https://github.com/abadger/ansible/blob/f47a4ccc76/lib/ansible/executor/module_common.py#L175
    * The code we would have to maintain for this looks pretty clean.
      In the wrapper we create a ModuleType, set __file__ on it, read
      the module's contents in from the zip file and then exec it.
    * Drawbacks: We still have to explicitly extract the file's contents
      from the zip archive instead of letting python's import mechanism
      handle it.
    * Exec also has hidden performance issues and breaks certain
      assumptions that modules could be making about their own code:
      http://lucumr.pocoo.org/2011/2/1/exec-in-python/

  Our plan is to use imp.load_module() for now, deprecate the use of
  __file__ in modules, and switch to zipimport once the deprecation
  period for __file__ is over (without monkeypatching a fake __file__ in
  via AnsibleModule).

* Rename the name of the AnsiBallZ wrapped module
  This makes it obvious that the wrapped module isn't the module file that
  we distribute.  It's part of trying to mitigate the fact that the module
  is now named __main)).py in tracebacks.

* Shield all wrapper symbols inside of a function
  With the new import code, all symbols in the wrapper become visible in
  the module.  To mitigate the chance of collisions, move most symbols
  into a toplevel function.  The only symbols left in the global namespace
  are now _ANSIBALLZ_WRAPPER and _ansiballz_main.

revised porting guide entry

Integrate code coverage collection into AnsiballZ.

ci_coverage
ci_complete
6 years ago
saichint fa5f396a4b nxos_file_copy enhancement (#42424)
* add file_pull option

* typo correction

* fix shippable error

* review comments

* fix for review comments by mwiebe

* possible shippable fix

* remove file_copy from ignore

* more review comments addressed

* review comments

* add localhost for remote scp server in tests

* timeout fix
6 years ago
tomelrod 5eb47066e3 Documentation change for resizefs (#43224)
* Documentation change for resizefs

Changed documentation to match the default value of resizefs set in the code.
Added a note on the resizefs use on the example utilizing it.

* Remove test now it validates fine
6 years ago
Abhijeet Kasurde b02e0c07d8
dnsimple: refactor dnsimple module (#42548)
* Update dnsimple-python minimum version to 1.0.0 as it supports API v2 and API v1 is deprecated.
* Update examples.
* Update documentation.

Fixes: #42495

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Dag Wieers e899824c49
ACI: Add parameter types to module docs (#42893)
* ACI: Add parameter types to module docs

* Update validate-modules ignore list
6 years ago
Sloane Hertel 2c3e6f8bd3 [elb_target_group] fix docs and add default for wait_timeout - fixes #42324 (#42477)
Add default for wait_timeout and version_added flag
6 years ago
Yanis Guenane 593f484d77 Fix E324 for vultr modules. (#42464) 6 years ago
John R Barker d962611528 Allow documentation of module options type (#42285)
* Allow documentation of module options

Pass through the `type` of a modules option so it's displayed on the
html module docs

* docs
6 years ago
fxfitz f92b95b8cb Remove ipa_ modules from sanity ignore; fix the docs 6 years ago
Dag Wieers 57c0471b54
Fix ACI validate-modules issues (#42222) 6 years ago
tstoner db7300904d Enforcing NXAPI default HTTP behavior (#41817)
* nxos_nxapi http default behavior

* Use nxos_nxapi module in prepare_nxos_tests

* Refactor nxos_nxapi configure test to use yaml block

* Extend nxos_nxapi https & http test cases

* Removed NXOS internal release naming

* Resolved ansibot sanity errors

* Fix typo in prepare_nxos_tests

* Address PR comments

* Shippable indicates this is no longer needed

* Add port change logic and testing
6 years ago
John R Barker 6024a766e9
Allow removed_in 2.11 (#42119) 6 years ago
Andrea Tartaglia a342538aba Add shell out checks (#41545)
* Added error codes for shell_out checks

* Added ignore lines for allowed Modules

* Added shell out checks

* Fixed pep8

* Updated regex to only match subprocess.Popen

* Added failing modules to ignore.txt

* Wrong postgresql module in ignore.txt

* Removed bigip from ignore.txt
6 years ago
Abhijeet Kasurde 27b85e732d Argument spec must be dict/hash (#40858)
validate-modules should fail when argument is not dict/hash.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Sloane Hertel 7d2c71462d gluster_volume: add 'volume' alias to 'name' param (#40845)
* gluster_volume: add 'volume' alias to 'name' param

* remove gluster_volume from validate-modules/ignore.txt
6 years ago
Pilou de385560a8 jenkins_jobs: fix typos (#40844)
* jenkins_job: fix typos

* jenkins_job: add type for 'enabled' parameter
6 years ago
Matt Clay 45c6fa9784 Update gluster_volume path in ignore.txt. 6 years ago
Matt Martz b07f779296 Update dnf module argument_spec and docs to match (#39819)
* Update dnf module argument_spec and docs to match. Fixes #39800

* Always evaluate autoremove as boolean
6 years ago
Zim Kalinowski dde48560fb fixing container instance sanity & integration tests (#40774) 6 years ago
Strahinja Kustudic de57fa71c1 Improve timezone module for none systemd Linux distributions (#38032)
* The module now correctly sets the timezone in both the config file and
in /etc/localtime; while hwclock is set in both the config and
/etc/adjtime.
* Module checks if the timezone is actually set by checking
/etc/localtime. Before it only checked if it was set in the config file.
* Fixed module not setting the timezone on RedHat systems if
/etc/localtime was a symbolic link.
* Fixed module failures in case of missing config files or incorrect data
in them.
* Added a lot of integrations tests to cover most of these situations.
6 years ago
René Moser 5dd3aa26ea
cs_instance: implement host migration support (#40309)
* cs_instance: implement host migration support

* fix build

* fail fast on update if user is not admin

* improve tests a bit

* expunge it

* fix typo

* disable temporarly verify for host on starting instance.
6 years ago
Jiri Tyr e6e5e45d7e Fixing choices for transport option in gluster_volume module (#38815) 6 years ago
Zim Kalinowski 8e38668285 fixing disabled azure sanity tests (#40519)
* fixing azure sanity tests

* fixing sanity

* fixing some tags issues

* removed unnecessary things from managed disk

* fixed location problem

* more sanity fixes

* sanity test fixes

* final sanity fixes?

* final fixes again

* undo changes related to container instance

* removed container instance

* readd again

* fixed stupid mistake

* removed _azure from changes

* one more mistake
6 years ago
Matt Clay 8deced3e04
Fix shebangs and file modes and update tests. (#40563)
* Add execute bit sanity test and apply fixes.
* Add shebang test for `lib` dirs and apply fixes.
* Shebang and execute bit cleanup.
6 years ago
Matt Clay 8d39515914 Remove tab check from validate-modules.
It is redundant with the pycodestyle W191 "indentation contains tabs" check.
6 years ago
Strahinja Kustudic 32d6a354d7 postgresql_user: set encrypted as default and fix empty password reporting changed (#36931)
* Set encrypted as default and fix empty password reporting changed

* Starting with Postgres 10 `UNENCRYPTED` passwords are removed and
because of that this module fails with the default `encrypted=no`.
Also encrypted passwords are suported since version 7.2
(https://www.postgresql.org/docs/7.2/static/sql-createuser.html) which
went EOL in 2007 and since 7.3 it is the default. Because of this it
makes a lot more sense to make `encrypted=yes` the default. This won't
break backward compatibility, the module would just update the user's
password in the DB in the hashed format and everything else will work
like before. It's also a security bad practice to store passwords in
plain text. fixes #25823
* There was also a bug with `encrypted=yes` and an empty password always
reported as changed.
* Improved documentation for `encrypted`/`password` parameters, and
removed some obsolete notes about passlib.

* Fix clearing user's password to work with all versions of Postgres

* Add tests for clearing the user password

* Fix documentation atfer rebase

* Add changelog fragment
6 years ago
John R Barker fe4368ce15
removed_in: 2.6 is valid (#40399) 6 years ago
Toshio Kuratomi 46d35d8919 unarchive now passes the E322 test 6 years ago
René Moser de8b6b55f7
cs_vpc: implement state=started (#40319) 6 years ago
Anil Kumar Muraleedharan 1cb4619c9a Modifying cnos-facts, cnos_command and cnos-config in line with the design followed in Ansible. Adding unit test cases for these modules. Added plugins to support them. (#39955)
* Modifying cnos-facts, cnos_command and cnos-config in line with the design followed in Ansible. Adding unit test cases for these modules. Added plugins to support them.

* Removing doc fragment conflicts with other modules

* Replacing show with display
6 years ago
Dag Wieers 3cdd5da247
xml: Fix validate-modules issue (#40121) 6 years ago
Zim Kalinowski b20a88c39d fix problem with documentation and param definition difference (#40067)
* fix problem with documentation and param definition difference

* removed some E324 from ignore.txt

* fixed mistake

* remove one more E324

* removed function app

* fixing append tags

* leaving append tags for later
6 years ago
Tim Rupp 06f76d6407
Removes ignores for f5 (#40038)
Removes ignores for f5 from unit tests and fixes any issues that
are being suppressed by the ignores
6 years ago
Tim Rupp d312c2aed7
Various bigiq fixes (#40024)
Udpdating coding conventions
6 years ago
Tim Rupp 742fd3a91a
Adds misc fixes for gtm facts module (#39966)
Codifies some parameters and fixes f5 coding conventions
6 years ago
Trishna Guha f1103a7a02
remove purge from nxos_logging doc, argspec (#39947)
* remove purge from nxos_logging doc, argspec

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* shippable

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Dag Wieers d7f3d3b867
Fix module validation checks and remove old params (#39926)
This PR includes:
- Fixes to the majority of module validation issues
  (deliberate inconsistencies between docs and arg_spec)
- Removal of deprecated parameters 'method' and 'protocols'
- A few typos in the documentation

There are still some left-over validation errors, some are deliberate
(like doc strings as default to indicate ranges, etc.)
6 years ago
Tim Rupp ad5fdf5eb7
Fixes for bigip_gtm_wide_ip (#39931)
Added the irules parameter. Misc corrections of invalid parameter
names and internal behaviors.
6 years ago
Matt Martz 1663b64e18
Allow subspec defaults to be processed when the parent argument is not supplied (#38967)
* Allow subspec defaults to be processed when the parent argument is not supplied

* Allow this to be configurable via apply_defaults on the parent

* Document attributes of arguments in argument_spec

* Switch manageiq_connection to use apply_defaults

* add choices to api_version in argument_spec
6 years ago
Rob b5cffe8ced [aws] Create classes for Application Load Balancer (#33769)
* Create classes for Application Load Balancer
* Add unsupported CI alias
* Add AWSRetry
* Add integration tests using the ALB
6 years ago
Pilou a5d320f8e7 vdirect modules: fix 'import' sanity test (#39706)
* vdirect modules: fix 'import' sanity test

* Remove passing file from import skip list.

* vdirect modules: fix validate-modules warnings

- Arguments with a default should not be marked as required
- add choices in doc

* vdirect_runnable: use formatting function
6 years ago
Tim Rupp fb264281de
Adds various features and fixes (#39271)
* a refactor of pool member and node modules to be inline with current f5 conventions
* Added priority_group_activation to pools
* various other small convention fixes and bug fixes
6 years ago
saichint 1afec5a48e fix nxos_snmp_community issues (#39258) 6 years ago
Tim Rupp 256b5535ec
Various fixes to F5 modules (#39255)
* Adds gnat provisioning to bigip_provision
* Adds special handling for AFM in bigip_provision
* Add device rebooting for provisioning as necessary
* Refactored route domain module to be inline with current f5 conventions
* Minor refactors across modules
6 years ago
John R Barker 7c4b91844d
More validate module fixes (#39097)
* Fix type bool DOCUMENTATION issues
6 years ago
Tim Rupp 39e4754fc9
Fixes for convention incompatibilities (#39209)
Minor fixes for the f5 modules to use current conventions
6 years ago
Tim Rupp e254121729
Adds minor fixes and features to f5 modules (#39202)
* Add Mac_address parameter to bigip_traffic_group
* Fix docs
* Fix f5 conventions
6 years ago
Pierre-Louis Bonicoli afef20827b openshift_raw & openshift_scale: fix broken import 6 years ago
Tim Rupp 19d229a8e0
Fixes F5 conventions and adds features (#39189)
This patch fixes a number of convention changes in F5 modules.
Additionally, it adds some features to bigip vlan and other modules
6 years ago
Thierry BOUVET 4117b2dd29 Fix documentation fragments for docker (#38378) 6 years ago
saichint 1d975bdc93 fix nxos_ntp_options (#38695) 6 years ago
saichint ed42331105 fix nxos_igmp_snooping issues (#38566)
* fix nxos_igmp_snooping issue

* shippable error fix
6 years ago
René Moser b06dfbec54
cs_user: fix E325 (#38158) 6 years ago
Matt Martz ffbbb5a25b
Use arg_spec type for comparisons on default and choices (#37741)
* Use arg_spec type for comparisons on default and choices

* Further improve type casting

* Make sure to capture output in more places

* Individually report invalid choices

* Update ignore.txt after resolving merge conflicts
6 years ago
saichint 0df5cfd41f fix nxos_static_route issues (#37614)
* fix nxos_static_route issues

* remove nxos_static_route from ignore
6 years ago
Matt Clay 775539a8b8 Fix api_profile choices in Azure docs fragment. 6 years ago
Dag Wieers 51662acc6c
Clean up Grafana docs a bit (#37516)
* Clean up Grafana docs a bit

But more is needed, default values, missing choices, proper
descriptions, actual sentences :-)

* Remove validate-modules entries
6 years ago
Dag Wieers cdd21e2170
Clean up module documentation (#36909)
* Clean up module documentation

This PR includes:
- Removal of `default: None` (and variations)
- Removal of `required: false`
- Fixing booleans and `type: bool` where required

* Fix remaining (new) validation issues
6 years ago
Matt Martz 8980d275a0
Support recursive suboptions schema (#37206)
* Support recursive suboptions schema

* Remove todo line, add voluptuous version constraint
6 years ago
Pilou bc6b96d42e webfaction modules: fix broken import (#35024)
* webfaction_app: fix broken import
* doc: use formatting functions
* webaction_db: fix broken import
* webfaction_domain: fix broken import
* webfaction_mailbox: fix broken import
* webaction_site: fix broken import
* webfaction modules: fix doc
6 years ago
René Moser e1297af18a cs_router: fix missing doc (#37107)
* cs_router: fix missing doc

* update ignore.txt
6 years ago
René Moser 67d8c8f5c6 cs_ip_address.py: fix missing doc (#37109)
* cs_ip_address.py: fix missing doc

* update ignore.txt
6 years ago
René Moser 2559e832df
cloudstack: fix common E324 in docs (#37082)
Notes about precedence of common args.
Partly fixes E324.
6 years ago
René Moser 4705edd1a7
letsencrypt: add new param force (#37077)
* letsencrypt: add new param force to ignore remaining days

* letsencrypt: fix E325
6 years ago
Mikhail Naletov 7d0e1f92f4 [terraform] Support initializing modules and providers at runtime (#36996)
* Fixes #36994

Added function for force initializing modules and providers

Added type for force_init parameter
6 years ago
Matt Martz ca092b5c26
Skip top level args that are the same as args in provider in doc<->arg_spec comparisons (#36911) 6 years ago
Gaurav Rastogi 60e39b9718 Updated the documentation of modules to match argspec including the type setting for bool parameters (#36821) 6 years ago
Mário Santos 8b52006d5c Fix sanity checks in OpenStack docs fragment (#36722)
* Fix sanity checks in OpenStack docs fragment

Signed-off-by: Mário Santos <mario.rf.santos@gmail.com>
6 years ago
Ed Costello 2a0c7c4331 Fix documentation of validate_certificates option in aws doc_fragment.
Unignore sanity test failures for AWS modules caused by this common
fragment.
6 years ago
Pilou 07927f52ae filesystem: fix documentation (#36556) 6 years ago
John R Barker 5d0ed38e3a
Fixup VMware module docs issues (#36409)
Fix various argspec vs documentation issue
6 years ago
Matt Clay a9b58b84d8 Fix path handling in validate-modules sanity test. 6 years ago
ABond 591695932e Fix bug in DigitalOcean module_util (#36352) 6 years ago
Abhijeet Kasurde 5242914ae5
Fix digital ocean issues (#36347)
Remove module from ignore lists and some documentation fix in
digital_ocean_block_storage and digital_ocean module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
John R Barker 365630df65
Update ignore to deal with renamed files (#36323) 6 years ago
Matt Clay 80b55e3742 Add missing validate-modules ignore entries. 6 years ago
Matt Martz 831a9d67d7 Arg spec doc comparison fixes (#36265)
* Ensure we merge doc fragments early, for comparisons

* Perform boolean conversion from arg_spec data too

* Update valdiate-modules ignore.txt due to recent changes
6 years ago
Matt Martz 50adc5409b Add several new doc<->arg_spec checks (#36247)
* Add several new doc<->arg_spec checks. See #18183

* Update ignore.txt for validate-modules
6 years ago
John R Barker 7dfa11cd8a Notice in 2.6 remove in Ansible 2.10 (#36191)
Update the list of allowed removed_in for modules
6 years ago
John R Barker 3e22efa0ba
Ensure docs are valid before checking deprecation (#36160) 6 years ago
John R Barker 17c0d3eae0
Fix more docs vs argspec (#36048) 6 years ago
Matt Martz f659cc5963
Guard against assignments that are not ast.Name in docs parsing (#35513) 7 years ago
John R Barker a23c95023b
Module deprecation: docs, scheme and tests (#34100)
Enforce module deprecation.
After module has reached the end of it's deprecation cycle we will replace it with a docs stub.

* Replace deprecated modules with docs-only sub
* Use of deprecated past deprecation cycle gives meaningful message (see examples below)
* Enforce documentation.deprecation dict via `schema.py`
* Update `ansible-doc` and web docs to display documentation.deprecation
* Document that structure in `dev_guide`
* Ensure that all modules starting with `_` have a `deprecation:` block
* Ensure `deprecation:` block is only used on modules that start with `_`
* `removed_in` A string which represents when this module needs **deleting**
* CHANGELOG.md and porting_guide_2.5.rst list removed modules as well as alternatives
* CHANGELOG.md links to porting guide index

To ensure that meaningful messages are given to the user if they try to use a module at the end of it's deprecation cycle we enforce the module to contain:
```python
if __name__ == '__main__':
    removed_module()
```
7 years ago
Dag Wieers 417accf88d Skip parameters that are being deprecated (#35319)
* Skip parameters that are being deprecated

So in most cases when parameters are deprecated, you may not want to
advertise them in the documentation. One reason for this is because
these parameters were not introduced within Ansible but predate
upstreaming them.

So this change avoids reporting parameters that are not documented and
are deprecated. It's only a small subset of the existing E322 errors.

* Add support for E323 with these changes

* Unsure about the other issues now

* Add better error message with E321

* Restore some erroneously remove files

* Readd false positives to ignore.txt
7 years ago
Colins-Git 7fac5cd7d2 Support for creation and modification of bridge and bridge slaves for nmcli (#34071)
Fixes: #31737
7 years ago