Commit Graph

22516 Commits (501503f4cb424d01c030e14cb5e5f8445fcdada3)

Author SHA1 Message Date
Yanis Guenane 68e6587748 Vultr: Ensure facts works when no resource exists (#43603)
Vultr API is being inconsisten in what it returns. An empty list when no
resources exists, but a dict of dict when they do. The case needs to be
handled so the module do not fail. An extra test has been added.
6 years ago
Arnaud Venturi 130824c3e1 Correct a typo in pip module error message (#43784) 6 years ago
AlexisLessard 3055ca2cc0 Clarifications of parameters in yum_repo module (#38453)
* Clarifications of parameters in yum_repo module

Added a note defining where the "name" parameter of the module will appear in the repo file and note explaining that the description parameter of the module is actually the name parameter in the repo file. It might help people transform their existing yum repository files in ansible managed repos.
6 years ago
Abhijeet Kasurde 5936e1f449
VMware: confine search for network till datacenter level (#40382)
If there are multiple distributed virtual portgroup network with same name
in different datacenter, vmware_guest module used to choose first DVPG irrespective
of the datacenter. This caused problem if two datacenter has same name for DVPG,
vmware_guest module failed with error "The object or item referred to could not be found."

This fix adds check to search for network (Distributed Virtual Portgroup)
till datacenter level. This avoids selection of same name DVPG from other datacenter.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 3dcbf3b003
VMware: new module : vmware_guest_boot_facts (#43240)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 281c8f6861
VMware: added missing facts vmware_drs_rule_facts (#42992)
vmware_drs_rule_facts was missing details about vm_group and host_group
and their respective memeber names. This fix adds those details and updates documentation.

Fixes: #42980

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Will Thames c8e8a84210 Allow tower_inventory_sources params to be False (#43749)
Ensure that params set to False are respected, rather than ignored.
6 years ago
Felix Fontein 7b7709ae75 ACME: support for TLS-ALPN-01 (#42158)
* Added support for TLS-ALPN-01 verification.

* Unrelated commit to re-trigger tests.

* Added test for TLS-ALPN-01.

* Try to remove to_bytes in the hope that binary data survives in Python 2.

* Using Base64 encoding for TLS-ALPN-01 value.
6 years ago
David Wittman a24898b715 Add cap_drop to docker_container module (#36889)
Closes #29578
6 years ago
Andrew Gaffney 9f9e936d3c Force all args to strings for 'command' (fixes #43732) 6 years ago
Branko Majic 2f5e3a75a3 Fix introduction version for parameter "local" in module "group" (#43719)
Parameter "local" has been introduced to the "group" module in version 2.6, not 2.5.
6 years ago
Nathaniel Case ab39481c31
cli_command module (#42916)
* Create cli_command module to do direct cliconf calls

* Update edgeos cliconf signature to match.

* cli_command is cli-only

* Add tests
6 years ago
Simone Tiraboschi 086cb0233f ovirt: ovirt_hosts_facts: add all_content (#43525)
Add all_content parameter also to ovirt_hosts_facts
to fetch the complete list of of details.
6 years ago
Gustavo Muniz do Carmo d971dd23a4 ldap_entry bugfix (#43620) 6 years ago
Abhijeet Kasurde 741fa025a0
delegate_to: accept only string for delegation host (#43473)
delegate_to parameter in task only accepts string,
this fix will error out if other datatypes are provided instead of
string.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
rmudingay 7feef1b64b junos_user: additonal sshkey types added (#43685) 6 years ago
Lindsay Hill c325fd9a46 Typo in edit_banner (#43668)
Looks like `send_commad` was mistakenly added in https://github.com/ansible/ansible/pull/43203. Should be `send_command`
6 years ago
Ganesh Nalawade 35adc12c38
Update junos cliconf plugin (#43643)
* Update junos cliconf plugin

Fixes #39056

Refactor junos cliconf plugin api and other
minor changes

* Fix CI issue

* Fix CI failure
6 years ago
Kevin Breit 3750c3a4d9 Meraki/doc response vlan (#43669)
* Add proper response documentation to meraki_vlan

* Add fixed IP assignemnts and reserved IP range response docs

* Fix syntax error

* Remove duplicate reservedIpRanges documentation
6 years ago
Jordan Borean 22b921d47f
win-async: fix race condition in async run (#43691) 6 years ago
Aurélien Grimal 71952a0aad Fix bug #32437 (#38166) 6 years ago
Jordan Borean 8f8e3db067
win_chocolatey: fix regression around using all as a package name (#43483) 6 years ago
Simon Dodsley e576acf6e4 Add support for host personality in purefa_host module. (#42976)
This is recommended when ActiveCluster is supported in the FlashArray
6 years ago
Simon Dodsley 3a7b6efea8 Update Pure Storage FA pgsnap module to allow volume restore from snap (#42774) 6 years ago
Matt Martz 4094b017c0
Fix invocation output. Fixes #43447 (#43542) 6 years ago
Toshio Kuratomi 30662bedad
Only print warning when ansible.cfg is actually skipped (#43583)
Only print warning when ansible.cfg is actually skipped

* Also add unittests for the find_ini_config_file function
* Add documentation on world writable current working directory
  config files can no longer be loaded from a world writable current
  working directory but the end user is allowed to specify that
  explicitly.  Give appropriate warnings and information on how.

Fixes #42388
6 years ago
Rémi REY 48280463f2 modules/terraform: fix -no-color position in workspace command (#43644) 6 years ago
Nicolas Finné d8bdf38b50 Fix telnet action plugin type error (#43609)
* Fix telnet action plugin type error

* removed blank line too much (pep8 E303)
6 years ago
Nilashish Chakraborty 4a1d37a76b Fix argument error in DCI (#43634) 6 years ago
Anil Kumar Muraleedharan 119376a685 Refactoring to persistence connection BGP, factory, reload, save, showrun modules (#43534)
* Refactoring to persistence connection BGP, factory, reload, save, showrun modules

* Refactoring methods from Util to module file

* Removing BGP Utility methods

* Adding to errors that need to be ignored
6 years ago
Rémi REY 32c01644d4 modules/terraform: use -no-color option in workspace commands (#43628) 6 years ago
Michael Dodwell 5130b67159 Allow for the specification of a rhsm_repo_ca_cert if changing baseurl (#43343)
* Allow for the specification of a rhsm_repo_ca_cert if changing baseurl

If changing the baseurl we should allow for a ca cert to be updated from redhat-uep.pem

* Fixing documentation section

* added version to option rhsm_repo_ca_cert

* got rid of extra CR
6 years ago
Pierre-Louis Bonicoli 93a4269957 filesystem: use LANG=C when cmd output is parsed 6 years ago
Pierre-Louis Bonicoli f6f413ec7a filesystem: add support for f2fs
Closes: #40418
6 years ago
saichint e393d5d2b4 add local directory option to nxos_file_copy (#43277)
* add local directory option to file_copy pull

*  shippable fix
6 years ago
hi117 7ea909418e Add scope parameter to systemd (#40179)
* Added changes for Issue #38828, adds scope paramater to systemd module

* Removed description for old paramater

* Added version_added field for new option

* Readded the user paramater as a deprecated paramater

* Changed version for the scope paramater since I missed the release window
6 years ago
Aaron Haaf 8a56aa322e Implement signed_request for sigV4 requests (#42758)
* Implement signed_request for sigV4 requests

* Correct linting errors

* More linting changes. Correct import.

* Final linting fix for inline comments

* Correct import of urllib.parse

* Update copyright and shebang line

* Remove shebang

* Put boto3 requirement. Abtract out get_aws_key_pair for module consumption.

* Dummy out unused region variable.

* Handle Boto3 ImportError

* - implement get_aws_credentials_object with willthames suggestion
- Handle session_token

* Make quote style consistant

* Chop arugment line up

* Correct indent
6 years ago
Brian Coca 522c245ee7 added version info and removed 'bare' exception 6 years ago
Vianney Foucault 5385de4bfd Support for postgresql default privileges (#32987)
* Support for postgresql default privileges

fix the following issues:

* #29701
* #23657

* The ALTER DEFAULT PRIVILEGES is implemented with type 'default_privs'
* Added a Query Builder for simplification
* Some minor lint

* Fixed Lint Issue in doc

Fixed misspelled method name

* Removed the damned empty space on line 243 ! (within the doc) x|

* Kept Compat in string interpolation for old beloved python 2.6
6 years ago
Zhikang Zhang 3a3869f4c8
Clarify usage of encrypt arg (#43330)
According to the do_encrypt interface, encrypt arg should be the hash method name used for encrypting returning password. But in the doc and lookup code it's a boolean flag, correct it to string.
6 years ago
Brian Coca 62d8c8fde6 more useful messages when module failure (#43576)
* more useful messages when module failure

specially if the 'interpreter' is not found

* 1 less var

* shebang can be none

* remove typoes
6 years ago
Sebastian Wiesinger a5774bd29a Fix ini variables for netconf and network_cli connections (#43599) 6 years ago
Pilou 12973e0541 Tower modules: move HAS_TOWER_CLI check in module_utils and minor improvements (#39809)
* tower_* modules: move HAS_TOWER_CLI in TowerModule

Besides this change allows to define other common parameters such as
mutually_exclusive.

* tower_*: config file can not be used with auth params

* tower module_utils: remove useless call to expanduser

'path' type: expanduser & expandvars are automatically called
6 years ago
David Moreau Simard 934500fb05 Properly detect credentials for tower_project
It seemed like it was mostly the wrong variables been looked at, making
it so a git repository could not be created without a credential.
6 years ago
Rémi REY 0461620b2d Terraform: add workspace support for switching and removing workspaces (#43489)
From terraform documentation:
```
The persistent data stored in the backend belongs to a workspace. Initially the backend has only one workspace, called "default", and thus there is only one Terraform state associated with that configuration.

Certain backends support multiple named workspaces, allowing multiple states to be associated with a single configuration. The configuration still has only one backend, but multiple distinct instances of that configuration to be deployed without configuring a new backend or changing authentication credentials.
```

This patch introduces the `workspace` parameter in the terraform module. The module will select
the workspace is it does not exists, or simply select it if it exists.

Fixes #43134

Add 'purge_workspace' parameter and handle the workspace context

The `purge_workspace` parameter allows to remove a workspace when asking for state = absent.
It allows to leave a clean state file without empty workspaces if the parameter is true.

Also adding the support of a workspace context that allows to restore the workspace
when that was active when the module started.
6 years ago
Trishna Guha 09ae1ec308
cliconf refactor eos, nxos fix (#43596)
* cliconf refactor eos and nxos fix

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

* move nxos replace check to plugins

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

* address review comment

* fix shippable
6 years ago
Petr Ruzicka 4e4ae1508e Removing required from documentaion of name parameter (#43530)
* Removing required from documentaion of name parameter

* extra text to make clearer when name is required
6 years ago
Timo Sand 3a4b6b1d12 Adds example of using wildcard domain in pam_limits (#43391)
* Adds example of using wildcard domain

* Fixes W293

* Slight formatting changes on the examples
6 years ago
♫ Christian Krause ♫ 54e1bca62a improves pam_limits documentation (#43526)
- the man page is actually limits.conf
- uses code highlighting for these
6 years ago
mjmayer 4549962f85 Fix comparison of priority (#43329)
The existing rule priority comes from aws as a string. It is then
compared to the new rule priority, which is defined as an int. This change
casts the new rule priority as a string making the comparison work. The
reason to cast it as a string rather than an int is used because a priority
can also be set to 'default'. When trying to case 'default' as an int, it creates
an error.
6 years ago
Zim Kalinowski 9e5e35e64c Replaced old sample in lb (#43591) 6 years ago
Ganesh Nalawade 3f3101dfe5
Raise exception if command timeout is triggered (#43078)
* Raise exception if command timeout is triggered

Fixes #43076

If persistent connection timeout is triggered, riase
exception which will be send over socket to module code
instead of silently shutting down the socket.

* Fix CI failure

* Fix review comment

* Fix CI failure

* Fix review comment

* Fix review comment
6 years ago
Zim Kalinowski b771913c0d improved vmss documentation (#43590) 6 years ago
Ganesh Nalawade b0bd1651fa
Fix netconf plugin set_option (#43589)
* To enable set config option with `Netconf` plugin
  inherit `NetconfBase` class from `AnsiblePlugin` parent class
6 years ago
Ganesh Nalawade 733e512f35
Fix typo in cliconf get_config (#43553) 6 years ago
Bill Nottingham 572a2187ab Add some requirements to the plugin docstrings. 6 years ago
Toshio Kuratomi 734384b91d Fix config manager to show errors
If there were fatal bugs in this portion of config, they would never be displayed
because config would fail to load and then every^U (Exageration... only
half of every) other part of the code which depended on config to be
loaded would fail before we ever got around to a section of code that
would process UNABLE.

Remove the try except from here so that we are able to debug this code
6 years ago
Toshio Kuratomi d483d646eb Normalize config from environment as text strings
On Python3, these would be text strings already.  On Python2, we need to
convert them from bytes.

Use a new helper function py3compat to do this.

Fixes #43207
6 years ago
Robert Bo Davis a452a92199 Fix referenced before assignment in role requirements 6 years ago
Robert Bo Davis 298d73a1a7 Fix referenced before assignment in role requirements 6 years ago
Joren Vrancken 7c13c4b207 Add specific exceptions to except 6 years ago
Jackson Isaac f968fcd288 junos_vlan: Add Vlan ID Range in description (#41855) 6 years ago
vista- f81e258043 NCLU - Add example: Changing the hostname and committing on Cumulus Linux (#42872)
* Add example to change the hostname and commit on Cumulus Linux

* Modify phrasing a bit
6 years ago
Brian Coca 2e9a7e2564 remove deprecated 6 years ago
Brian Coca 21fc6a0c38 nicer error message on multiprocessing fail
fixes #43090
6 years ago
Shuang Wang 68683b4c73 fix issue [ get_url does not change mode when checksum matches ] (#43342)
* fix  #29614

* add change log for #43342

* Cleanup tests and add tests for this scenario


Co-authored-by: ptux
6 years ago
Christer Hemgren d3fb958a06 asa_config doc attach acl to interface (#41253)
+label: docsite_pr
Issue ansible/community#311
6 years ago
Trishna Guha 1f410cc19f
Fail module if configure replace fails nxos (#43546)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
joren485 6d680d8281 Use socket.error instead of non-existent socket.Error (#43499) 6 years ago
Nathaniel Case 9169daa326
\r does not round-trip the local socket, escape and restore on the other side (#43507) 6 years ago
Rushan c4591f0861 Leading dot in efs_facts.mountpoint (#35909)
* remove leading dot in efs_facts mountpoint

* remove leading dot in efs_facts mountpoint

* remove leading dot in efs.py

* introduce filesystem_address var in efs* modules and revert changes to mount_point
6 years ago
Sumit Jaiswal 01fb7ea150
Allow DNS bypass for add/remove of host records with nios_host_record (#42934)
* fixes issue 42420

* fixes issue 42420

* fix shippable docs error

* shippable fix and test case add

* shippable fix and test case add

* shippable fix and test case add

* shippable fix

* removing extra assert

* shippable fix
6 years ago
Dag Wieers e2cac8cc93 Fix all VMware examples to use delegate_to (#43426)
Some users have problems using the VMware modules because they use the
vCenter as target, and Ansible uses SSH to connect to the targets.

Eventually we need to update the VMware guide to explain how the modules
work, but the first fix is to update the examples.

(We should backport to v2.6 and v2.5 too)
6 years ago
Sumit Jaiswal e96f90b440
Nios integration and unit tests for all remaining nios new modules (#43399)
* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* test/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml

new nios module integration test support

* fix pep8 error

* fix pep8 error

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end
6 years ago
Yuwei Zhou 7314aa7298 Fixes #30393: Virtual machine can refer existing NIC from other resource group (#42562) 6 years ago
Gustavo Muniz do Carmo 5149ab1e00 New module request: azure_rm_virtualmachine_facts #38081 (#38279)
* New module request: azure_rm_virtualmachine_facts #38081

* New module request: azure_rm_virtualmachine_facts #38081 #38279 pep8 fixes

* New module request: azure_rm_virtualmachine_facts #38081 #38279 validate-modules fixes

* New module request: azure_rm_virtualmachine_facts #38081 #38279 serialize_vm

* New module request: azure_rm_virtualmachine_facts #38081 #38279 get_item

* New module request: azure_rm_virtualmachine_facts #38081 #38279 avoid get vm twice

* New module request: azure_rm_virtualmachine_facts #38081 #38279 some jborean93 requests

* New module request: azure_rm_virtualmachine_facts #38081 #38279 camel_dict_to_snake_dict

* New module request: azure_rm_virtualmachine_facts #38081 #38279 integration test

* New module request: azure_rm_virtualmachine_facts #38081 #38279 virtual network required

* New module request: azure_rm_virtualmachine_facts #38081 #38279 consider additional vms present

* New module request: azure_rm_virtualmachine_facts #38081 #38279 trailing comma

* New module request: azure_rm_virtualmachine_facts #38081 #38279 remove from smoketest

* New module request: azure_rm_virtualmachine_facts #38081 #38279 filtering by tag fix

* New module request: azure_rm_virtualmachine_facts #38081 #38279 virtual network issues fix

* New module request: azure_rm_virtualmachine_facts #38081 #38279 remove trailing comma

* adding curated format for vm

* New module request: azure_rm_virtualmachine_facts #38081 #38279 rights to zim + lint fixes

* clean up

* updates to vm facts

* commented out failing thing

* fixed mistake

* New module request: azure_rm_virtualmachine_facts #38081

* New module request: azure_rm_virtualmachine_facts #38081 #38279 pep8 fixes

* New module request: azure_rm_virtualmachine_facts #38081 #38279 validate-modules fixes

* fixed test

* fixed test problem

* New module request: azure_rm_virtualmachine_facts #38081 #38279 serialize_vm

* New module request: azure_rm_virtualmachine_facts #38081 #38279 get_item

* New module request: azure_rm_virtualmachine_facts #38081 #38279 avoid get vm twice

* New module request: azure_rm_virtualmachine_facts #38081 #38279 some jborean93 requests

* New module request: azure_rm_virtualmachine_facts #38081 #38279 camel_dict_to_snake_dict

* New module request: azure_rm_virtualmachine_facts #38081 #38279 integration test

* New module request: azure_rm_virtualmachine_facts #38081 #38279 virtual network required

* New module request: azure_rm_virtualmachine_facts #38081 #38279 consider additional vms present

* New module request: azure_rm_virtualmachine_facts #38081 #38279 trailing comma

* New module request: azure_rm_virtualmachine_facts #38081 #38279 remove from smoketest

* New module request: azure_rm_virtualmachine_facts #38081 #38279 filtering by tag fix

* New module request: azure_rm_virtualmachine_facts #38081 #38279 virtual network issues fix

* New module request: azure_rm_virtualmachine_facts #38081 #38279 remove trailing comma

* adding curated format for vm

* New module request: azure_rm_virtualmachine_facts #38081 #38279 rights to zim + lint fixes

* clean up

* updates to vm facts

* commented out failing thing

* fixed mistake

* fixed test

* fixed test problem

* ldap_entry 'Tuple_to_LDAPMod(): expected a byte string in the list' issue

* Revert "ldap_entry 'Tuple_to_LDAPMod(): expected a byte string in the list' issue"

This reverts commit efe316c52e5a70fc1aa9f58eff3a9d5b2599763f.

* changed return value

* fixed test

* fixed test mistake

* one space too much

* removed change made by mistake

* virtual machine description

* remove example

* fixed yaml
6 years ago
Jiri Tyr c93f24b45b Fix for creation and removal of swap record in fstab (fixes #42706, #31437 and #30090) (#42837) 6 years ago
Matt Martz fd839d7a67
Catch exceptions when importing plugins, and display an appropriate warning. Fixes #43237 (#43501) 6 years ago
Matt Martz 5f98a5a736
Only cache task.loop when delegated_host was templated. Fixes #43016 #43449 (#43451) 6 years ago
Matt Martz 01c0446cb5
Add AnsibleModule signature schema, and fix associated issues (#43512) 6 years ago
Sloane Hertel 25218e6843 Fix dualstack without s3_url (#43510) 6 years ago
Joren Vrancken 9896853d1f Fix typo of makedirs 6 years ago
Joren Vrancken b954917761 Surround top-level function and class definitions with two blank lines. 6 years ago
Sloane Hertel 4b3e5998bf Allow AWS endpoints and dualstack (#43497) 6 years ago
Matt Martz dc908f4cb5 Prefer name of include_role. Fixes #43332 6 years ago
Joren Vrancken d5bec06150 Fix typo of stderr 6 years ago
Brian Coca 222c907ffb
actually check we can run scm command for roles (#43315)
* actually check we can run scm command for roles
* a better error message than file not found
* more narrow exception hanlding
* refactor common functions for more extended use and further 'basic.py' separation
6 years ago
joren485 b3c054c55e Use dbus.exceptions of non-existent dbus.Exceptions (#43495) 6 years ago
Adam Miller 09eac6bab9 Revert "dnf: Call dnf.Base.close() before exit to cleanup. (#41810)"
This reverts commit 32436ea9a5.
6 years ago
Alex 29a62038b7 module_utils_service: Fix glob path of rc.d (#43018)
Some distribtuions like SUSE has the rc%.d directories under /etc/init.d

Quote of /etc/rc.d.README on SLES11.

"Some people expect the system startup scripts in /etc/rc.d/.
We use a slightly different structure for better LSB compliance."
6 years ago
Seuf af55b8e992 Grafana dashboard grafana 5 compatible (#41249)
* Grafana dashboard module compatible with grafana 5+

* Use url_argument_spec to init modules arguments

* Add changelog fragment
6 years ago
Matt Martz a7f45c0660 Add basedir to ansible_search_path before running loops. Fixes #43302 (#43431) 6 years ago
Andreas Olsson 726c6eb889 Support Amazon S3 Dual-Stack Endpoints in aws_module (#43403)
* Use https:// for docs.aws.amazon.com in aws_s3 module

* Support Amazon S3 Dual-Stack Endpoints in aws_module

The default S3 endpoint only resolves to IPv4 addresses. By enabling
the dual-stack endpoint IPv6 too get added as an option.
6 years ago
Alex Dukhno dd28be3aab Update pagerduty modules to rest v2 (#42618)
* refactored from procedural to OOP

* updated ongoing maintenance windows to PagerDuty REST API v2

* update create maintenance windows to PagerDuty REST API v2

* update absent maintenance windows to PagerDuty REST API v2

* update pager alert module to PagerDuty REST API v2

* removed basic HTTP authorization
updated parameter description and examples

* fix failed sanity checks

* revised documentation according to review

* make obsolete service key parameter an alias to a new integration key parameter
6 years ago
Abhijeet Kasurde 122780abce Fix args schema regression in k8s module
Add back comma for required_one_of argument as it's
supposed to be an iterable of iterables.

PR #39787 by @Akasurde
Fixes: #39786

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde c44b05e167
VMware: update documentation and example (#43474)
This fix updates the documenation of vmware_guest_custom_attribute_defs module.

Fixes: #43443

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ganesh Nalawade 857200fa7f
Update cliconf get_config api (#43472)
*  Change `filter` parameter to `flag` to be in sync
   with original naming convention
6 years ago
Zim Kalinowski c8fcbdef71
fix for special case of last element of url (#43354)
* fix for special case of last element of url

* improved version

* fixed mistake

* adding appropriate test

* fix problem

* just fixed task name
6 years ago
curry9999 c344a94846 version_added 2.6 -> 2.7 (#43317) 6 years ago
Ganesh Nalawade ea6ef3fae8
Enable setting options for cliconf and other implementation plugins (if set to configurable) (#43368)
* Enable setting setting cliconf plugin options

Fixes #43367

* Add support to set configuration options for implementation plugins (eg: cliconf)
  from `ansible-connection`

* Fix CI failure
6 years ago
joren485 d03b9eddf6 Remove unused imports from /bin and lib/ansible/cli (#43440)
* Remove unused imports from lib/ansible/cli

* Remove unused imports from bin/
6 years ago
Jordan Borean d115794bf7 PrivilegeUtil: use native methods to get pointer offset (#43461) 6 years ago
joren485 240b65ddda Fix an unreachable else statement (#43463) 6 years ago
curry9999 486a43829c change aws_kms example (#43438) 6 years ago
Jordan Borean 9259f31fee Add Ansible.ModuleUtils.PrivilegeUtil and converted code to use it (#43179)
* Add Ansible.ModuleUtils.PrivilegeUtil and converted code to use it

* Changed namespace and class to be a better standard and fixed some typos

* Changes from review

* changes to avoid out of bound mem of server 2008

* changes to detect failure when setting a privileged not allowed
6 years ago
Matt Martz 77d2008150
Don't perform string to bool conversion in set_fact when jinja2 native types is enabled (#43425)
* Don't perform string to bool conversion in set_fact when jinja2 native types is enabled. Fixes #42599

* Add tests for boolean conversions in set_fact
6 years ago
Ryan Brown 43c508b3c3
[AWS] iam_role->AnsibleAWSModule and support IAM permission boundaries (#43270)
* Convert to AnsibleAWSModule and support IAM permission boundaries

* Handle adding boundary to existing role that lacks one

* Properly clean up role boundary associations on delete

* Handle case when policy boundary is `""` but does not exist
6 years ago
Abhijeet Kasurde 80369cf034 VMware: provide appropriate error if NICs missing (#43414)
While creating/reconfiguring vSwitch without NICs check if nics details
are gathered or not.

Fixes: #42619

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ryan Brown 1c082e93ef
[aws] Catch errors raised when deleting objects remaining in an s3_bucket (#43358)
* Catch errors raised when deleting objects remaining in a bucket

* Also remove VersionId when it is not needed
6 years ago
Trishna Guha fee4c24ad4
Add md5sum check in nxos_file_copy module (#43423)
* Add md5sum check in nxos_file_copy module

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

* address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Abhijeet Kasurde 1bab901966
VMware: add details about vswitch and dvswitch (#43066)
This fix adds additional details of vswitch and dvswitch and their
respective nics used.

Fixes: #43009

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Orr 1e4831e744 VMware: check if folder already exists before creation (#41588)
* check if folder already exists before creation
* added integration test
6 years ago
Egor Zaitsev 249a6aae22 New module: routeros — manage MikroTik RouterOS (#41155)
* Implement initial RouterOS support

* Correct matchers for license prompts

* Documentation updates & mild refactor

* Remove one last Cisco function

* Sanity test fixes

* Move imports to the beginning

* Remove authorize property

* Handle ANSI codes

* Revert to_lines function

* CR fixes

* test(routeros): add unit tests

* Added another test (with ANSI colors and banner in fixture).

* Ignore CRLF line endings in system_package_print file

* fix: review by ganeshrn
6 years ago
Ganesh Nalawade 21dcaa4349
Handle ConnectionError exception in network modules (#43353)
* Handle ConnectionError exception in network modules

* Catch ConnectionError expection and fail module in case
  expection is raised.

* Fix CI failure
6 years ago
Abhijeet Kasurde a44adc1dc9 f5: raise exception (#43409)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde cc3dadf16e
VMware: new module : vmware_about_facts (#43146)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Eric Rinish 551501f326 use faster method to get short_description from DOCUMENTATION (#42705)
* use faster method to get short_description from DOCUMENTATION

* fixed pep8 whitespace

* fixed blank line
6 years ago
Joren Vrancken 350dbaf457 Correct default value of always_post_validate in docstring 6 years ago
flowerysong a08668cf00 Port ec2_tag to boto3 (#39712)
* Add volume manipulation to EC2 integration test policy

* Port ec2_tag to boto3
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
tstoner 2c3d418e53 Nxapi ssl (#42905)
* NXAPI ssl ciphers & protocols default values

* TLSv1, TLSv1.1, TLSv1.2 and weak cipher support

* NXOS NXAPI weak/strong cipher & TLSv 1.2, 1.1 & 1.0 support

* Version checking for strong/weak ciphers & TLS 1.2, 1.1 & 1.0 support

* Cleaned up erroneously committed changes.

* Specific NXOS platform checking for nxapi ssl ciphers & protocols

* Fixed ansibot reported errors.

* Resolved ansibot reported error.

* Added network_os_version to mocked up N7K unit test device_info

* Calling get_capabilities() once in main and passing results into methods.

* Removed raising exceptions when platform capabilities return None
per reviewers request. Skipping nxapi ssl options when capabilities
are None and generating a warning when these options are skipped

* Cleaned up explicit checks for None/not None
6 years ago
Jose Delarosa 779d273192 Add new module for Redfish APIs (#41656)
* Add new module for Redfish APIs

Communicates with Out-Of-Band Controller through Redfish APIs
Module gathers hardware information and sends back

* Removed unused library imports

* Removed token entry from headers

* Made 'command' optional and defined default value for each 'category'

* Replace 'result' with 'ansible_facts' for returned dict variable

* Removed unused variable definitions and library imports

* Renamed dicts where data is returned.

Should make it easier to sort through returned data that is placed
in one file.

* Defined dicts to specify available categories and commands in each one.

- Allows specifying default command for each category
- Allows specifying all commands for each category
- Removed Inventory category and moved commands to System category
- Renamed dicts where data is returned to allow to dump more than one in a file

* Remove choice[] since it's redundant

* Added flexibility when specifying categories

- If a category is not specified, it sets a default value
- Can handle more than one category
- Will accept value "all" for category which will set to all available
- Renamed category System to Systems to better reflect Redfish API

* Defined default category in a variable

* Made category argument a list

* Added examples

* Made command argument a list

* Replaced 'ansible_facts' with 'redfish_facts' for returned dict variable.

* Added default value for category in documentation

* Moving redfish_facts inside ansible_facts

* Updated how results dicts are constructed, where applicable

* Improved error messages

* Removed unused variables

* Undo commit 66a7dcd789 due to variable 'e' oversight
6 years ago
Jose Angel 711dd9f834 VMware Module - vmware_guest_move (#42149) 6 years ago
Anil Kumar Muraleedharan f2c9a6b126 Lenovo port to persistence 1 (#43194)
* CNOS Vlag module is refactored to use persistence connection instead of paramiko.

* Changing interface and port channel modules to persistent connection and adding UT for them.

* Fixing pep8 issues

* Removing trailing new line

* Removing trailing new line

* Removing trailing new line

* Correcting indentation mistake

* Update cnos_vlag.py

* Removing commented examples

They are commented because those configurations are not meant for L2 ports
6 years ago
Abhijeet Kasurde e24041449e
VMware: new module: vmware_guest_boot_manager (#40609)
This module can be used to manage virtual machine boot order and
related parameters.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Artem Goncharov 6667ec4474 fixes #42042 (#42939)
Do not create group with empty name when region (optional argument) is 
not given in the openstack connection
6 years ago
Abhijeet Kasurde 605a90dfeb
VMware: new module: vmware_category_facts (#39894)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 9a561b53fa
VMware: Dynamic Inventory plugin (#37456)
* Disable warnings on validate_certs=False
* Required requests version
* Add testcase for inventory plugin
* Include review comments from mattclay
* remove pyvmomi installation
* remove config file at exit
* Add cache in vmware_inventory inventory plugin
* shertel review comments
* Rename vmware_inventory to vmware_vm_inventory
* bcoca's review comments
* Export username and password for failing testcase

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Xyon 9121f2a4c9 Validate and reject if csr_path is not supplied when provider is not assertonly (#41385) 6 years ago
Abhijeet Kasurde 20092786cf
VMware: new module : vmware_guest_custom_attributes (#38114)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 08c9cb33b7
VMware: new module: vmware_guest_attribute_defs (#38144)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 4dac5bed83
VMware: Fix mark as virtual machine method (#40521)
Choose resource pool by using get_resource_pool rather than select_resource_pool_by_name

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Lindsay Hill 4a98802b52 Ironware: Deprecate provider, support network_cli (#43285) 6 years ago
Denis GERMAIN 3f9e457751 feat: Add a enable_accelerated_networking flag in module + tests; fixes #41218 (#42109) 6 years ago
Zim Kalinowski 750774d768 fixing aiuth source (#42923) 6 years ago
Abhijeet Kasurde aefe963483
VMware: handle special characters in datacenter name (#42922)
This fix handles special characters in VMware objects

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 7dd5f4c01c
VMware: update examples in vmware_vm_shell (#42410)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 1aeca65d10
VMWare: refactor vmware_vm_shell module (#39957)
* Update documentation
* Update wait_for_process logic
* Update examples and return
* Add missing msg in fail_json method

Fixes: #38320

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 56f5390151
VMware: additional VSAN facts about Hostsystem (#40456)
VSAN related facts (cluster_uuid) will be used in vmware_vsan_cluster
while adding new host in VSAN cluster.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ganesh Nalawade af3f510316
nxos cliconf plugin refactor (#43203)
* nxos cliconf plugin refactor

Fixes #39056

*  Refactor nxos cliconf plugin as per new api definition
*  Minor changes in ios, eos, vyos cliconf plugin
*  Change nxos httpapi plugin edit_config method to be in sync with
   nxos cliconf edit_config

* Fix CI failure

* Fix unit test failure and review comment
6 years ago
Ryan Reed e215f842ba Correcting conditionals looping (#43331)
Empty conditionals would not break out of the loop, causing every command to be run for the same number of times as retries is defined (10 by default)
6 years ago
Abhijeet Kasurde dd73bae51a VMware: handle indexError for snapshot details (#42575)
Fixes: #42539

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Adrián Matellanes c62d9a023a Fix zabbix-template module error version comparison (#39199)
* Fix zabbix-template module error version comparison

* Fix zabbix-template module error version comparison
6 years ago
Vladimir Dobriakov 92ab566527 Make example work: "Import Zabbix Temlate" (#40905)
<!--- Small typo, but it was hard to find, why the ansible module execution failed -->

+label: docsite_pr
6 years ago
Andreas Olsson ab41fb9cd4 Fix cloudflare_dns proxied change detection (#43096)
Resolves #35190
6 years ago
Abhijeet Kasurde 604fcb55ae
VMware: add support for boot option firmware (#42730)
This fix adds support for the boot option 'firmware'

Fixes: #42541

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Toshio Kuratomi dce0a8d052 Switch to imp.load_module 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
Richard Schwab ec20d4b13e Enable zone detection in nsupdate (#41365)
Fixes #41346
6 years ago
Zim Kalinowski 30ef83c1c0 fixing bug in storage account sample (#43308) 6 years ago
Zim Kalinowski e43d4ac512 fixing mysql server sample (#43300) 6 years ago
Zim Kalinowski 3f9cacf777 fixed postgresql server sample (#43299) 6 years ago
Nilashish Chakraborty 18235af363
Fix baud rate and nxos_logging default case idempotency bug (#43295)
* Fix baud rate and idempotency bug

* Fix Shippable errors

* Combine commands calls

* Fix Shippable errors II
6 years ago
Nathan Hyde d3230b9172 Correct link to Getting Started with Docker Guide (#42709)
Update link to the docker getting started guide.

+label: docsite_pr
6 years ago
Nathaniel Case ab40c72a3c
httpapi: Split off and save response text contents (#43305)
* Split off and save response text contents

* login might depend on httpapi
6 years ago
Abhijeet Kasurde 13dd1acbec Fix typo in ignore_unknown_extensions doc
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Blair Rampling 7a35e2f8c1 adds naptr record module (#39383)
* adds naptr record module

* fixes pep8

* fixes doc errors
6 years ago
Ganesh Nalawade 5e44189a36
Update junos_netconf module documentation (#43291)
Fixes #42719

* Add module documentation to reflect that when netconf
  port is not mentioned the module by default enables
  netconf on port 830 only.
6 years ago
Dag Wieers 32b5992578 uri: Avoid false traceback in common scenarios (#39526)
* uri: Avoid exception in common scenario

So I was confused by the fact that the **uri** module, when not
returning an acceptable HTTP status code, returns:

    The full traceback is:
      File "/tmp/ansible_UQwiI4/ansible_module_uri.py", line 471, in main
        uresp['location'] = absolute_location(url, uresp['location'])

While the actual error was:

    Status code was 400 and not [201]: HTTP Error 400:

I also wonder why that message ends abruptly. I would have expected
`HTTP Error 400: Bad Request` which would be more useful.

* uri: Avoid false positive tracebacks in fail_json() on PY2
6 years ago
Toshio Kuratomi 6eacfecb73 ANSIBLE_REMOTE_TMP was an implementation of unified temp that was later changed
One of the earlier implementation of unified temp for 2.4 passed the
temp diretory to the remote side using this environment variable.  We
later changed it to be passed via a module parameter but forgot to
remove the environment variable.
6 years ago
Adam Miller 66b1adfc83 fix fedora version dnf fact, default pkg_mgr detection per distro family (#43261)
* fix fedora version dnf fact, default pkg_mgr detection per distro family
* loop over possible dnf/yum paths in case there are multiple canonical sources later in life

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
John Jensen 7ba0d8f60e fix regex parse for total memory in slxos_facts.py (#43258)
* fix regex parse for total memory in slxos_facts.py

* account for one or no spaces per LindsayHill's suggestion
6 years ago
Fabian von Feilitzsch d27de6acd9 Add from_yaml_all to support multi document yaml strings (#43037)
* Support multi-doc yaml in the from_yaml filter

* Most automatic method of handling multidoc

* Only use safe_load_all

* Implement separate filter

* Update plugin docs and changelog
6 years ago
Julien Champseix 19dc267e4c Allow specifying the output encoding in the template module (#42171)
Allow specifying the source and destination files' encodings in the template module

* Added output_encoding to the template module, default to utf-8
* Added documentation for the new variables
* Leveraged the encoding argument on to_text() and to_bytes() to keep the implementation as simple as possible
* Added integration tests with files in utf-8 and windows-1252 encodings, testing all combinations
* fix bad smell test by excluding windows-1252 files from the utf8 checks
* fix bad smell test by excluding valid files from the smart quote test
6 years ago
Andrew Gaffney dbff49dee0
Remove dead 'vault_password' play attribute (#41847) 6 years ago
Dag Wieers 9bf22309b3 Clarify uncertain nature of tracebacks on Python 2 (#42513)
* Only add exception/traceback on Python 3

On Python 2 the traceback could be any exception from the stack frame
and likely unrelated to the fail_json call.

On Python 3 the traceback is cleared outside any exception frame, so the
call always returns the most inner traceback (if any), and therefor is
most likely related to the fail_json call.

* Add uncertainty to traceback on Python 2

On Python 2 the last exception in the stack frame is being returned,
this could be unrelated to the actual error, especially if fail_json()
is called outside an except: block.
6 years ago
curry9999 1305fca414 change version_added cobbler_sync (#43248) 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
mjmayer a488b3a8ed elb_application_lb purge rules option (#43113)
* Add parameter to keep elb rules

Does not purge elb rules. This is usefull if running the elb_application_lb
 role and there is the desire to keep existing rules.

* Change variable name keep_rules to purge_rules

The descriptor purge has been used in the past.

* Changed default for purge_rules

Default is purge_rules. This is how the module has functioned previously. This change maintains
 the previous behavior.

* Add integration test for purge_rules flag

* Change wording of test task

* Fix merge conflcit

* Changed default for purge_rules

Default is purge_rules. This is how the module has functioned previously. This change maintains
 the previous behavior.

* merge conflcit

* Change wording of test task

* Add purge_rules option to test

* Change test description wording

* Expand purge_rules documentation

* Clarifies documentation for purge_rules option
6 years ago
Fran Garcia 577306e74b Fix #42000 : ovirt_host_pm documentation for slot parameter (#42196)
* Fix for #42000: ovirt_host_pm ignores slot parameter

* Fix for #42000: ovirt_host_pm ignores slot parameter

* Remove non-required slot parameter
6 years ago
Jordan Borean 2c9cbae3f9
Removed deprecated Windows items slated for removed in 2.7 (#43231) 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
Dag Wieers 939de473c6
Add a 'finished' test for async jobs (#38325)
This provides a more convenient way for testing (async) jobs.

When used with a non-async job it will report a warning so the user is
aware that he may be doing something incorrect.

Since the 'finished' result value is an integer (!), the test is turning
this in a proper boolean.
6 years ago
Dag Wieers 5ecfb0b793 cobbler_system: New module to manage Cobbler systems (#39913)
* cobbler_system: New module to manage Cobbler systems

This module is useful to provision new systems using Cobbler and Ansible.

* cobbler_system: warn on invalid properties
6 years ago
Andrew Gaffney 42346937b1
Display task banner before item status (#42892)
This is a follow-up to #41058
6 years ago
Brian Coca 917b6b0d09 import_playbook is not usable from inside a play
(cherry picked from commit 55dddf530ad094810929823f80c4546e97a69ac7)
6 years ago
Nathaniel Case a7097f6735
Try to enable more exotic auth methods in httpapi (#43212)
* Try to enable more exotic auth methods in httpapi

* Auth tokens won't always come back.

* Reconcile #43147 with this PR
6 years ago
Brian Coca ac1f05478e Allow to specifically customize console's color 6 years ago
Xyon 3bb9f689e9 Fix spelling; summery -> summary (#43213)
Fix the incorrect spelling of "summary".
6 years ago
Rémy Léone 3113c68053 Fix author name in the documentation 6 years ago
Gregory Hellings 6f007c35c1 Improved the documentation of known_hosts
The documentation for the key parameter was lacking in specificity and
also lacking in testing. These parts are both remedied herein.

Fixes #43157
6 years ago
Brian Coca 0718a53b07 also get checksum on 'any' if it is a file
fixes #42785
6 years ago
Brian Coca cdc762dd9e
don't assume all delegation subkeys exist (#43032)
* don't assume all delegation subkeys exist

fixes #43026

* add tests
6 years ago
Deepak Agrawal bf544c2200
Add support for commit label in iosxr_config (#42931)
* Add support for commit label in iosxr_config

* sanity pep8 etc fixes
6 years ago
Abhijeet Kasurde 4f1746ee1d
vault: check dir value before passing (#43184)
This fix checks if dirname is not equal to '' before proceeding
to create actual directory with name.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Trishna Guha dd6ef3355f
get_device_info nxos zero or more whitespace regex (#43178)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Andreas Olsson c6854fde29 Fix cloudflare_dns JSON response error handling (#42894)
* The JSONDecodeError exception only exists in Python 3.

* Without a properly parsed JSON response there is no more error
  processing to be done, no matter the http response code.

Relates to #38178
6 years ago
Lindsay Hill 42a9fb1337 Fix broken IPv6 regex (#43175) 6 years ago
uwila c0048007a9 Detect failed sysvinit module (#43127)
* Detect failed sysvinit module

- This checks the stderr instead of the rc to detect whether the
  sysvinit module was successful or not, as even when failing, the
  rc would be 0.
- It immediatly became obvious that the debug info when failing
  was far too little to properly debug the role. To improve this,
  I also added the rc, stderr and stdout to the debug output.

* Revert stderr check to rc check, rename out->stdout, err->stderr
6 years ago
Jordan Borean d5d29f4cfa
ssh - skip connection reset if controlpath does not exist (#43062) 6 years ago
Jordan Borean 04431216e7
win_user: use different method to validate credentials that does not rely on SMB/RPC (#43059)
* win_user: use different method to validate credentials that does not rely on SMB/RPC

* Use Add-Type as SetLastError on .net reflection not working on 2012 R2
6 years ago
Jordan Borean 48ad90ac8e
powershell: support recursive requires statements (#43143) 6 years ago
Jordan Borean 93c05074ee
win_chocolatey: refactor module to fix bugs and add new features (#43013)
* win_chocolatey: refactor module to fix bugs and add new features

* Fix some typos and only emit install warning not in check mode

* Fixes when testing out installing chocolatey from a server

* Added changelog fragment
6 years ago
Jarryd Tilbrook 460f858640 Enable check_mode in command module (#40428)
* Enable check_mode in command module

This only works if supplying creates or removes since it needs
something to base the heuristic off. If none are supplied it will just
skip as usual.
Fixes #15828

* Add documentation for new check_mode behavior
6 years ago
Charles 7fedda4c1d move the TLS detection block of win_uri before creating WebRequest (#43168)
* move the TLS detection block of win_url before creating WebRequest

* fix typo security_protocols
6 years ago
Nathaniel Case 8a0967554f
Actually fix eos_facts feature detection (#43155) 6 years ago
Trishna Guha 1d5f881f5c
Add text output along with structured output in nxos_facts (#42886)
* nxos_facts to use default output instead of structured output

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

* fix shippable error

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

* nxos_facts refactor

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

* Add structured output back

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Mo Balaa 3c0a3a1de1 Add debug messasge to aws_ec2 inventory plugin (#43112) 6 years ago
Jonathan Lozada D d48415ed57 Fixed typo in gitlab_group (#41349)
Changed 'requried' to 'required'
6 years ago
Deric Crago 5522e9e934 VMware: fixed network['vlan'] str / int mismatch (#42984)
Typecast network vlan into string.
6 years ago
Matt Martz 35b4b1923d Allow adhoc to execute includes and imports 6 years ago
Julien PRIGENT 151419b87a ec2.py: Set source_dest_check default value to None (#42863)
* ec2.py:
  * source_dest_check default value is now None, updated docs
  * Refactor restart_instances and startstop_instances -> Two new functions to prevent repetition: check_source_dest_attr and check_termination_protection
6 years ago
Seuf 9faadce0b2 Add new grafana dashboard lookup plugin (#41319) 6 years ago
Adam Miller 562ff66a98 Fix pkg_mgr_name fact finding for Fedora (#40922)
* Properly handle default package manager vs apt

For distros where apt might be installed but is not the default
package manager for the distro, properly identify the default distro
package manager during fact finding and re-use fact finding from
DistributionFactCollector and instead of reimplementing small
portions of it in PkgMgrFactCollector

Add unit test to always check the apt + Fedora combination to test
the new code.

Fixes #34014

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove q debugging output I accidentally left behind

Signed-off-by: Adam Miller <admiller@redhat.com>

* add os_family to the conditional so we're only hitting that code path when needed

Signed-off-by: Adam Miller <admiller@redhat.com>

* setup for a _check* pattern for general os_family group pkg_mgr checking

Signed-off-by: Adam Miller <admiller@redhat.com>

* use Mock.patch decorator for os.path.exists in TestPkgMgrFactsAptFedora

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Eric Coutu ab3475e3f9 Explicitly pass HTTP method to fetch_url 6 years ago
Matt Martz 8d933928d2 Only assume GET if no data, otherwise POST (#43133)
* Only assume GET if no data, otherwise POST. Fixes #42876 #43091 #42750
6 years ago
Will Thames 0b77262288 Add merge_type parameter to k8s module (#42219)
Allows patching of custom Kubernetes resources that
don't support strategic merge patching

Check that openshift module supports content_type param
(requires version newer than 0.6.0)
6 years ago
Yunge Zhu 40fbee6369 Fix azure_rm_keyvaultkey/azure_rm_keyvaultsecret bugs (#41683)
* fix keyvault tests

* missing keyvault requirement

* fix keyvault auth bug

* apply fix in secret

* fix lint

* enable keyvault key and secret tests

* add azure service principal object_id lookup plugin

* fix lint

* add dependency in integration test

* fix bug

* put azure sp lookup plugin into test

* fix lint

* move lookup plugin

* repath lookup plugin

* repath lookup plugin

* repath files

* put az sp lookup plugin to lookup_plugins folder
6 years ago
Deepak Agrawal 20769de560
Don't close persistent connection socket on command timeout (#43071)
* Don't close persistent connection socket on command timeout

* handle exception in client of ansible-connection instead removing socket removal
6 years ago
Nathaniel Case 8c620a17d4
Let called functions use `method` keyword (#43086)
Hopefully we can live without `method_` instead
6 years ago
Jordan Borean 64f5f9c2f9
win_acl: fix recent bug and add basic tests (#43054) 6 years ago
Dusan Matejka d43b2b54d5 Fixed incompatible unicode and int comparison in zabbix_host module when using proxy option (#43097) 6 years ago
Joe Abbey a9b077f763 Stop throwing TypeErrors (#43036) 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
Chris Smolen bb35973e37 nxos_logging: add example using aggregate (#41052)
* add example using aggregate
+label: docsite_pr
+label: issue ansible/community#311
* Update nxos_logging.py
6 years ago
Yanis Guenane b1c60eaa83 Vultr: Introducing vr_startup_script_facts module (#43004)
This commit introduces a new module called vr_startup_script_facts.

This module aims to return the list of startup scripts avaiable
avaiable in Vultr.

Sample available here:

```
"vultr_startup_script_facts": [
  {
    "date_created": "2018-07-19 08:52:55",
    "date_modified": "2018-07-19 08:52:55",
    "id": 327140,
    "name": "myteststartupscript",
    "script": "#!/bin/bash\necho Hello World > /root/hello",
    "type": "boot"
  }
]
```
6 years ago
abirami-n 1152f86ba1 Fixes #41549 (#41551)
* Fix_module_correction
6 years ago
Sandra McCann 87f004c503 Merge branch 'devel' of github.com:ansible/ansible into devel 6 years ago
Daniel Schneller 40b1ecf38a Add src parameter to elasticsearch_plugin (#39915)
* Add src parameter to elasticsearch_plugin

Previously specifying a URL or a file name (which is supported by the
Elasticsearch plugin tooling) would not work correctly with Ansible, because the
detection of the current installation state did not handle this well.

This commit adds a new "src" parameter for the module, which can be specified in
addition to the plugin name. It will be used to retrieve the plugin from
a custom location while keeping the final plugin name available to determine if
it is already present or not.

The url parameter remains for ES 1.x compatiblity.

* Fix sanity test errors

* Add version_added for src option

* Increase first added version to 2.7
6 years ago
Barry Peddycord III dc42b43cd1 NCLU Module: Improve performance by not operating on empty lines (#43024)
* Update nclu.py

Stop module from running `net` on empty commands.

* Update nclu.py

Updated the copyright date

* Update nclu.py

Returned metadata version to 1.1

* Update nclu.py

Fix indentation to be a multiple of 4.

* Create changelog fragment
6 years ago
Thierry Bouvet 5d23406926 Fix ssl_version default value. (#42955)
* Fix ssl_version default value.

* Add changelog
6 years ago
Sandra McCann 2e93eab920 pr 42271 - fixed merge conflicts 6 years ago
Nathaniel Case dba975470d
Eos subnet overlap fix (#43023)
* Detect overlapping subnet & provide better errors
6 years ago
Alexander Gubin e129616ba6 sysvinit: Fix for false changed messages (#42956) 6 years ago
Ryan Brown b6f8de9204 [aws] Enable SQS events for `lambda_event` module (#43019)
* Enable SQS events for `lambda_event` module

* Handle SQS event type properly

* PEP8
6 years ago
Julien PRIGENT 3272188170 elasticache_parameter_group.py: add parameter group compatibility with redis4.0 (#43041) 6 years ago
Ryan Brown 07927edfac
[AWS] Fix SSM Parameter Store module when description is missing (#43020) 6 years ago
Andrey Laguta 2e62e36590 Fix multiple var files combining (followup to #36357) 6 years ago
Abhijeet Kasurde cadbd6ea9c
VMWare: update documentation for linked_clone (#42881)
linked_clone requires snapshot_src parameter. This fix makes them required_together
and update documentation. Also, testcase is added.

Fixes: #42349

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ganesh Nalawade 97d4e53131
Support setting persistent command timeout per task basis (#42847)
* Support setting persistent command timeout per task basis

Fixes #42200

*  Add variable `ansible_command_timeout` to `persistent_command_timeout`
   option for `network_cli` and `netconf` connection plugin so that the
   command_timeout can be set per task basis while using `connection=network_cli`
   or `connection=netconf`
   eg:
   ```
   - name: run copy command
     ios_command:
       commands:
       - show version
     vars:
      ansible_command_timeout: 40
   ```

* Modify `ansible-connection` to read command_timeout value from
  connection plugin options.

* Add `ansible_command_timeout` to `persistent_command_timeout`
  option in `persistent` to support `connection=local` so that
  it is backward compatibilty

* To support `connection=local` pass the timeout value as variables
  from persistent connection to `ansible-connection` instead of sending
  it in playcontext

* Fix CI failure

* Fix review comment
6 years ago
Tim Rupp 867dedc787
Updates F5 module utils (#43047)
New functions and fixes/refactorings for existing functions for
the 2.7 work
6 years ago
Rémy Léone 267c7667f6 Fix archived machine bu (#43017) 6 years ago
Pilou 06f5e49dfb inventory plugins: add test about config API usage (#41888)
* Check get_option method works with inventory plugins

This use case is already tested by some cloud inventoty plugin but
these tests are slow and aren't always executed, hence this new quick
test.

* AnsiblePlugin: Fix typo in docstring
6 years ago
Martin Szulecki 2653bd3f50 Fix docker_image archive features to work with Python 3
Without binary mode, ansible shows a "write() argument must be str,
not bytes" error when using Python 3.
6 years ago
Sumit Jaiswal 8759d97071 infoblox list requirements as infoblox_client and should be infoblox-client (#42993)
* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client
6 years ago
Brian Coca 9217fbb7dd
better error messasge (#42770)
* better error messasge
6 years ago
Matej Vadnjal 7c318d4e30 ios_user module - implement sshkey option (#38782)
* ios_user module - add sshkey support

* ios_user - Add version_added to sshkey option

* ios_user - pep8 indentation fixes in unit tests

* ios_user - use b64decode method that works on python 2 and 3
6 years ago
Sam Doran 0ca61e9d87
Only report change when home directory is different on FreeBSD (#42865)
* Only report change when home directory is different

Add tests with home: parameter

Have to skip macOS for now since there is a bug when specifying the home directory path for an existing user that results in a module failure. That needs to be fixed in a separate PR.
6 years ago
Will Thames 786613f426 Handle FieldLevelEncryptionId in cloudfront_distribution (#41770)
Ensure that FieldLevelEncryptionId is properly handled - passing it if
set, and keeping it if returned by GetDistribution

Update cloudfront_distribution tests to remove references to
test_identifier so test suite actually works

Fixes #40724
6 years ago
Roberto Barreda f0f335d2bd parametrize allow_reassignment in ec2_eni (#41982)
* parametrize allow_reassignment

* fix documentation

* fix version_added
6 years ago
yaakov kuperman 61b0981341 [AWS] check mode for ec2_elb and elb_instance (#42694)
what ELBs an instance will be deregistered from prior to actually
executing
6 years ago
Andy Eff 26fd05c288 Update wait_for.py (#43002)
<!--- Your description here -->
This change is intended to help users know that a win_wait_for module exists and should be used for working on Windows hosts, as the documentation gives the impression that this module works on Windows - but if tried, it produces a large amount of stderr output.
+label: docsite_pr
6 years ago
Abhijeet Kasurde f2640d3394
VMware: handle pnic in proxyswitch (#42996)
Fixes: #42943

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Raoul Scarazzini 86387df8b3 Fix docker_container stop/start image dependency (#41678)
This commit adds a conditional inside the constructor so that if a user
didn't specified an image parameter all the code related to the image
version comparison is omitted.
This is extremely useful when a user want to just stop and start
containers using just the name, keeping everything as it is, without the
need of specifying all the image and command stuff used at creation.
Today if you don't specify the image you get an error, and this is a
confusing [1] behavior.

[1] https://github.com/ansible/ansible/issues/27960
6 years ago
Jez McKinley 0f6488bb15 JM: allow choco to install 32 bit version (#42946)
* JM: allow choco to install 32 bit version

* JM: style corrections

* Revert style changes in lists

* JM: changing from boolean to string choice

* JM: updating example
6 years ago
John McDonough f89d3721b4 UCS NTP Server module (#42375)
* UCS NTP Server module initial commit

* change name to ntp_server, keep name as alias for ntp_server
6 years ago
David Soper c527af58f1 ucs_storage_profile module and integration tests (#42205)
* ucs_storage_profile module and integration tests

* Remove space in doc link to fix docs-build issue.

* Added suboption documentation and argument spec supporting list suboptions.

* Various small edits
6 years ago
Yanis Guenane 1754f533b5 Vultr: Introducing vr_firewall_group_facts module (#42997)
This commit introduces a new module called vr_firewall_group_facts.

This module aims to return the list of firewall groups avaiable
avaiable in Vultr.

Sample available here:

```
"vultr_firewall_group_facts": [
  {
    "date_created": "2018-07-17 12:22:51",
    "date_modified": "2018-07-17 12:24:47",
    "description": "ansible-firewall-group",
    "id": "fb5a0876",
    "instance_count": 0,
    "max_rule_count": 50,
    "rule_count": 1
  }
]
```
6 years ago
Yanis Guenane f6ca231729 Vultr: Introducing vr_dns_domain_facts module (#42994)
This commit introduces a new module called vr_dns_domain_facts.

This module aims to return the list of DNS domains avaiable avaiable in
Vultr.

Sample available here:

```
"vultr_dns_domain_facts": [
  {
    "date_created": "2018-07-19 07:31:14",
    "domain": "ansibletest.com",
  }
]
```
6 years ago
hitsumabushi c43e51e39e print vyos_config diff (#42494) 6 years ago