* 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
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.
* 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
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).
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).
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.
* 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.
* 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
* 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
* 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
* 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.
* 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
* 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
* 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>
* 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
* promote doc_fragments into actual plugins
change tests hardcoded path to doc fragments
avoid sanity in fragments
avoid improper testing of doc_fragments
also change runner paths
fix botmeta
updated comment for fragments
updated docs
* Integration tests now have their own list of allowed shebangs.
* Use `#!/usr/bin/env bash` instead of `#!/bin/bash`
since the location is different on various platforms.