Commit Graph

22715 Commits (cc2164f92aecf118407ca60f0cfc9210a8d9f3af)

Author SHA1 Message Date
Robson Roberto Souza Peixoto 2796be1132 Add AzureRMStorageAccount StorageV2 kind (#44242)
close 38455
6 years ago
Bjorn Hansen ff6d4e6bf4 azure_rm_common: only remove tags from new_tags if append_tags is not… (#24040) 6 years ago
Jasper Aorangi babfe45852 Add 'panos_set' module for pushing arbitrary commands to PAN-OS NVA's (#43339)
* Add 'panos_set' module for pushing arbitrary commands to PAN-OS NVA devices
6 years ago
Lance Richardson dc08b9a738 new module exos_config (#43902)
- support config operations for EXOS-based platforms
- add regex to detect command failure responses
- add exos action plugin for "backup" operation
- add unit tests for exos_command (currently 94% coverage of
  exos_config.py)
6 years ago
Sam Doran 00e7c020b2 Add backup feature to user module (#41854)
*  Add backup option

* Only backup shadow file when the OS has one

* Only backup shadow file for SunOS

* Update docs on backup feature

* Add changelog fragment

* Add tests for shadow backup

* Remove backup option, make it automatic

Remove the option to enable/disable backups and make it automatic. Add note to docs describing this behavior.

Change tests to account for new module behavior.

Change section name in changelog fragment since minor_features is not a valid section.
6 years ago
Zhikang Zhang 0971a342d8
Solve race condition in password lookup (#42529)
NOTE:
1. use os.open() with os.O_CREAT|os.O_EXCL to check existence
and create a lock file if not exists, it's an atomic operation
2. the fastest process will create the lock file and others will
wait until the lock file is removed
3. after the writer finished writing to the password file, all the reading
operations use built-in open so processes can read the file parallel
6 years ago
Tom Matthews 5c1e620504 Strip trailing comments from /etc/default/passwd (#43931)
* strip additional comments from /etc/default/passwd

Strip trailling comments from /etc/default/passwd like
MINWEEKS=1 #MINWEEKS=2
MAXWEEKS=12  # MAXWEEKS=8
Which otherwise cause failures with "failed to read /etc/default/passwd: too many values to unpack"

* fix carriage return typo in commit

* yet another typo in commit

* Fix indent problem

* add changelog fragment for PR 43931
6 years ago
Andreas Olsson 3ddec4d64e Fix the nsupdate module's TTL change detection (#42973)
Ideally I would have liked to compare the TTL as part of the
prerequisite check. Sadly that isn't supported by the RFC 2136 update
protocol. Hence the additional query.

Resolves #39465
6 years ago
Alex Stephen 63e87a3a0a Bug fixes for gcp_compute_route (#42820) 6 years ago
Alex Stephen f5f0d16516 Bug fixes for gcp_compute_subnetwork (#42822) 6 years ago
Alex Stephen 97b3845e89 Bug fixes for gcp_compute_url_map (#42828) 6 years ago
Alex Stephen 82678b9bac Bug fixes for gcp_pubsub_topic (#42834) 6 years ago
Alex Stephen 87c6d4be57 Bug fixes for gcp_storage_bucket (#42835) 6 years ago
Alex Stephen cbf945d287 Bug fixes for gcp_compute_network (#42819) 6 years ago
Alex Stephen 60e78f33ce Bug fixes for gcp_compute_http_health_check (#42812) 6 years ago
Andreas Olsson 6d772874f9 Add SSHFP and TLSA records to cloudflare_dns module (#44011)
* Update cloudflare_dns account link

* Add SSHFP and TLSA records to cloudflare_dns module

These are record types which Cloudflare recently added support
for. They both go well together with DNSSEC.

Technically it's a bit of a simplification to use the hash_type
parameter for TLSA records. Yet, it fits with all the real world usage
I have seen, and it keeps the module from sprawling too much.

Related to #43803
6 years ago
Andrew Gaffney 5708894f90 Bugfixes and integration tests for 'default' callback plugin
* display 'changed' tasks when hiding 'ok' tasks
* display proper task title for handlers (fixes #44007)
6 years ago
ivarmu 742ba04125 Add callback plugin to show current/total numberings for tasks and hosts in a task. (#40769)
Change version_added as requested
6 years ago
Michael Mayorov 7538a63f70 Fix referenced before assignment in sysvinit module (#42695)
* Fix referenced before assignment in sysvinit module

* removed redundant variable initialization
6 years ago
Martin Nečas 9d5ce3d335 add custom_compatibility_version (#40813)
* add custom_compatibility_version

* use implemented methods get minor and major
6 years ago
Ondra Machacek df581eb749 ovirt_vms: Search template also by cluster (#44161) 6 years ago
Ganesh Nalawade d9ee693652
Update netconf plugins for junos and iosxr (#44157)
* Update netconf plugins for junos and iosxr

Fixes #39160

*  Update api signature for netcon api's
   from variable arguments to named arguments

* Udpate get default rpc supported

* Fix CI issue
6 years ago
tzurE 615337c3d7 Add ibm storage module to ansible (#39960)
* Initial commit for ibm_storage ansible modules
Added modules for managing IBM Spectrum Accelerate storage systems.
Separate modules to manipulate storage entities within the systems.

* sanity checks fix

* PR sanity checks fix

* updated the review to contain only one module, one utility and doc fragment, as instructed at the core meeting.

* IBM_Storage: fixed review issues.

* IBM_Storage: fix review issues

* IBM_Storage: review issues and sanity checks

* IBM_Storage: Review and sanity fixes

* IBM_Storage: pep8 fix

* IBM_Storage: review fixes

* IBM_Storage: review issues

* IBM_storage: license fix
6 years ago
housysadm bb553f138b ios_user purge example (#42904)
* Update ios_user.py

Added an example of purging all users except those listed and admin

* Update ios_user.py
6 years ago
Matt Davis 6b81c36533
restore task arg splatting (#43798)
* restore task arg splatting

* reverts #41804
* supersedes #41295
* fixes #42192
* after lots of discussion amongst the core team, we decided to preserve this feature, clarify the runtime warnings/docs, and prioritize a path toward fixing the underlying behavior that causes this feature to be insecure (un-namespaced facts).

* update faq text

note that warning is disabled when inject_facts_as_vars is

* wordsmithing FAQ entry
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
Alex Stephen 984cc10465 Bug fixes for gcp_compute_target_tcp_proxy (#42827) 6 years ago
Alex Stephen 97006cded2 Bug fixes for gcp_compute_target_http_proxy (#42823) 6 years ago
Alex Stephen 569e094efd Bug fixes for gcp_compute_target_ssl_proxy (#42826) 6 years ago
Alex Stephen b88442064f Bug fixes for gcp_compute_target_pool (#42825) 6 years ago
Alex Stephen eaacda42f5 Bug fixes for gcp_compute_target_https_proxy (#42824) 6 years ago
Yanis Guenane 763d66ff9c Vultr: Ensure self.returns is the source of truth (#44115)
As of today, self.returns it not the source of truth. If the return
value from querying the resource contains more values than the one
listed in self.returns, those value will be returned even though not
explicitly specified in self.returns.

This commit ensures that only the values listed on self.returns are
actually returned. The other values not listed are supressed.
6 years ago
Yanis Guenane 21fcaf0738 scaleway: Add common documentation fragment
Every scaleway modules will require the same base of parameters. Instead
of documenting it each and every time, we build a doc fragment that will
allow one to simply extend documentation for every new module.

extends_documentation_fragment: scaleway
6 years ago
Strahinja Kustudic 5cbda9658a yum will fail on 'No space left on device', fixes #32791 (#40737)
During the installing of packages if yum runs out of free disk space,
some post install scripts could fail (like e.g. when the kernel package
generates initramfs), but yum would still exit with a status 0.  This is
bad, especially for the kernel package, because it makes it unable to
boot.  Because the yum module is usually used for automation, which
means the users cannot read every message yum prints, it's better that
the yum module fails if it detects that there is no free space on the
disk.
6 years ago
Deepak Agrawal 84bedcbd82
Httpapi plugin for Firepower device (#43773)
* Common Rest Module using httpapi transport

* comparing json objects

* platform independant Rest Api

* FTD rest module

* Remove FTD module which will be committed later from cisco team

* remove debug code

* remove common rest module

* fix shippable errors

* Add notification users

* more shipable errors
6 years ago
Trishna Guha a8c24a5d5e
Add cli_config module (#42413)
* cli_config module

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

* rename diff and replace

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

* add nxos changes

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

* nxos tests

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

* remove severity

* address review comment

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

* add module diff

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

* add iosxr test

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

* address diff review

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

* Add junos tests

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

* vyos cliconf diff fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Trishna Guha 227bf61daa
junos cliconf diff fix (#44109)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Nilashish Chakraborty b14f256d41
Fixes ios_l2_interface and ios_vlan not working on certain interface types issue (#43819)
* Fixes #43654 and #43582

* Remove q statement

* Fix shippable errors

* Fix more shippable errors

* Fix unittest
6 years ago
Trishna Guha e188073629
multiline_delimiter should be True ios cliconf (#44106)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Zim Kalinowski ee96d42d7d Fixing upgrade_policy idempotence (#38022) 6 years ago
Trishna Guha 43ae240431
nxos_facts test lldp feature and fix nxapi check_rc (#44104)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Lindsay Hill 727503c5ab fix typo in edit_config_capability name (#44102) 6 years ago
Andreas Calminder 21066410be authorized_key 29891 use os.path.realpath to follow keyfile symlinks (#40417)
* 29891 use os.path.realpath to follow keyfile symlinks
* 29891 add parameter follow
* updated changelog fragment
* add documentation and set default to false
6 years ago
Toshio Kuratomi 688ffa4cee We can create a frozenset from a tuple
No need to create an intermediate set.
6 years ago
Tim Rupp 96a6011b3f
Update f5 module_utils from downstream (#44092)
Upstreaming fixes and features for f5 module_utils as part of 2.7
dev cycle
6 years ago
Zhikang Zhang cda3b53035
make doc templates not case sensitive for the default value (#41158) 6 years ago
Alex Stephen b0542217e2 Bug fixes for gcp_compute_instance_template (#42818) 6 years ago
Alex Stephen 829dcf1d23 Bug fixes for gcp_compute_instance_group (#42816) 6 years ago
Alex Stephen f977590a2a Bug fixes for gcp_compute_instance (#42815) 6 years ago
Alex Stephen 7a92b8c9ed Bug fixes for gcp_compute_global_forwarding_rule (#42810) 6 years ago
nishiokay c99cd634bb Update cs_storage_pool.py (#42454)
Added "maintenance" to allocation_state in the Parameters section.

+label: docsite_pr
6 years ago
Alex Stephen f405857f50 Bug fixes for gcp_compute_firewall (#42807) 6 years ago
Matt Martz 17c89d1ffa
Remove unused rslt_q, rename the one queue to final_q everywhere (#43894)
* Remove unused rslt_q, rename the one queue to final_q everywhere

* Test update
6 years ago
Till Maas bb85bbceeb pip: combine chdir and env only when env is set (#40793)
* pip: combine chdir and env only when env is set

This fixes an AttributeError when chdir without virtualenv is specified:

 File "/tmp/ansible_2UAFsZ/ansible_module_pip.py", line 387, in main
    env = os.path.join(chdir, env)
 File "/usr/lib64/python2.7/posixpath.py", line 75, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

* Add test for pip with chdir

Signed-off-by: Till Maas <opensource@till.name>
6 years ago
Sumit Jaiswal fd4e774cec
Resolves bug where existing host_record was deleted when existing record name is used with different IP (#43235)
* resolves bug 42937

* resolves integration test failure

* resolves integration test failure

* resolves integration test failure
6 years ago
Sam Doran 6d38167d49
Only template values in vars_prompt rather than all vars (#39304)
* Only template values in vars_prompt rather than all vars

This allows the use of variables in vars_prompt fields but allows variables entered in the prompt to affect play vars rather than throwing an undefined error.

Only post validate if there was a vars_prompt

* Add tests for vars_prompt
6 years ago
Stefan Prietl d5662df695 Fix actions and wait in os_server_action module (#43504)
* Fix call to sdk.iterate_timeout in os_server_action

* Correct indentation for several actions in os_server_action
6 years ago
Zhikang Zhang b20d903cc4 Give warning if user inputs not encrypted password to user module (#43615)
* Check the password format

Check the password format and notify user if they
input unencrypted password.

* Fix sanity error

* Add integration test

* Missed a task name

* Hard code the testing password

Since some testing platfrom has no passlib installed

* Add changelog fragment

* Rework some English sentences

* Fix a grammar mistake
6 years ago
Juan Jimenez cceddfab9b Update lambda.py (#44066)
Timeout doesn't say if in secs, minutes or ??
6 years ago
Alex Stephen 50bd91b48b New GCP Module: gcp_compute_backend_service_facts (#44025) 6 years ago
Alex Stephen fbfea59d7d Bug fixes for gcp_compute_ssl_certificate (#42821) 6 years ago
Alex Stephen c38e1e5631 Bug fixes for gcp_container_cluster (#42829) 6 years ago
Alex Stephen dd3c4b0d39 Bug fixes for gcp_pubsub_subscription (#42833) 6 years ago
Alex Stephen 3dc363d135 Bug fixes for gcp_storage_bucket_access_control (#42836) 6 years ago
Alex Stephen 7f10d432ec Bug fixes for gcp_container_node_pool (#42830) 6 years ago
Alex Stephen 7f981b4123 Bug fixes for gcp_dns_managed_zone (#42831) 6 years ago
Alex Stephen 2a346af18b Bug fixes for gcp_compute_instance_group_manager (#42817) 6 years ago
Alex Stephen c239e6f045 Bug fixes for gcp_compute_https_health_check (#42813) 6 years ago
Alex Stephen 6b5f86a4aa Bug fixes for gcp_compute_image (#42814) 6 years ago
Alex Stephen 439716a832 Bug fixes for gcp_compute_health_check (#42811) 6 years ago
Alex Stephen c8418a709b Bug fixes for gcp_compute_disk (#42806) 6 years ago
Alex Stephen 146c126780 Bug fixes for gcp_compute_global_address (#42809) 6 years ago
Alex Stephen 65df8834e8 Bug fixes for gcp_compute_forwarding_rule (#42808) 6 years ago
Mike Wiebe 8f75bb5799 nxos issu should abort when issu is not possible. (#43793)
* Use expect module to copy files

* Abort when issu not possible

* Update copy_kick_system_images.yaml

* Update platform/version support
6 years ago
Yanis Guenane fd554e9d75 vultr.py: query_resource_by_key Handle list and dict (#43301)
The Vultr API is inconsistent in the type of the value it returns
based on the resources. While most of the time it will be a dict, for
some resources it will be a list (/v1/user/list, /v1/block/list).

query_resource_by_key() fails if the return value isn't a dict (.items()
does not exist on list). This patch aims to support both list and dict.
6 years ago
Herman ed29cd7f44 add choices to documentaton for paramater flat (#43939) 6 years ago
Alex Stephen d1399ec5a2 Bug fixes for gcp_compute_backend_service (#42805) 6 years ago
Alex Stephen 476e98e0cf Bug fixes for gcp_compute_backend_bucket (#42804) 6 years ago
Alex Stephen 4ecdf11aaa Bug fixes for gcp_compute_address (#42704) 6 years ago
Jonny McCullagh aac668ee1f Update wait_for.py (#44071)
Removed the 'wait 300 seconds' from the examples that did not have the 300 sec timeout

+label: docsite_pr
6 years ago
Nathaniel Case a3385a60b4
httpapi: let httpapi plugin handle HTTPErrors other than 401 (#43436)
* Hold httpapi response in BytesIO

* Let httpapi plugin deal with HTTP codes if it wants

* Python 3.5 won't json.loads() bytes

* Don't modify headers passed to send

* Move code handling back to send()

but let httpapi plugin have a say on how it happens
6 years ago
Toshio Kuratomi e2e44f846c Fix the local and ssh plugins for a cornercase retrying a syscall
The bundled selectors library which is used by the local and ssh
connection plugins had a bug which caused a traceback in a cornercase.
If selectors were in use and a syscall was interrupted, selectors would
attempt to restart the syscall after the interrupt was processed.  if
the attempt determined that the timeout for running the syscall had
already expired, the code attempted to raise OSError.  The raise was
using a Python3-ism and needed to be ported to work on Python2.

Fixes #41630
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
Ganesh Nalawade 24d112fc60
Fix cli_command junos test failure and update doc (#44021)
* Fix cli_command junos test failure and update doc

*  Fix cli_command module integration test failure
   for junos
*  Update cli_command module doc for prompt and
   config command run scenario's

* Update cli_command module doc
6 years ago
Tim Rupp 0beae82f56
Add no-change handlers and fix utf8 (#44020)
the bigip_command module was not handling utf-8 appropriately. Also,
this patch includes some enhancements for no-change detection
6 years ago
Tim Rupp 0d332dd095
Adds fixes and features to bigip_virtual_server (#44019)
Merging in downstream work from the f5-ansible repository.
6 years ago
Felix Fontein aef16ee195 ACME: use Cryptography (if a new enough version is available) instead of OpenSSL (#42170)
* Collecting PEM -> DER conversions.

* Using cryptography instead of OpenSSL binary in some situations.

* Moving key-to-disk writing for key content to parse_account_key.

* Rename parse_account_key -> parse_key.

* Move OpenSSL specific code for key parsing and request signing into global functions.

* Also using cryptography for key parsing and request signing.

* Remove assert statements.

* Fixing handling of key contents for cryptography code path.

* Allow to disable the use of cryptography.

* Updating documentation.

* 1.5 seems to work as well (earlier versions don't have EC sign function). Making Python 2.x adjustments.

* Changing option to select_crypto_backend.

* Python 2.6 compatibility.

* Trying to test both backends separately for acme_account.

* Also testing both backends separately for acme_certificate and acme_certificate_revoke.

* Adding changelog entry which informs about select_crypto_backend option in case autodetect fails.

* Fixing YAML.
6 years ago
Felix Fontein 7f41f0168a ACME certificate revocation: add support for new draft-14 error message (#43980)
* Adding support for new certificate-already-revoked error message in draft-14.

* Updating documentation.

* Fixing typo.
6 years ago
Adam Miller 231961564a fix firwewalld permanent zone operations (#42868)
Fixes #42310

Previously, the firewalld module was making a call to
FirewallClientConfig.getZoneNames() which doesn't exist in versions
of firwalld older than 0.4.2, this patch implements the same logic
with older API calls to not require a newer version of firewalld.

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Yanis Guenane ffcdc53536 module_utils/vultr.py: Ensure comparison is accurate (#43298)
In query_resource_by_key(), there is an equal comparison that is made to
know if the object we are looking for is present. Due to type difference
this comparison doesn't always retrieve true, even when it should.

This is due to the fact that the value in r_data dict are of type
unicode, while the other can be of type int, float,... .

```
>>> a = u'1'
>>> type(a)
<type 'unicode'>
>>> b = 1
>>> type(b)
<type 'int'>
>>> a == b
False
>>> str(a) == str(b)
True
```

Hence the values, for comparison purposes, are casted into strings.
6 years ago
Luca Lorenzetto 051320a5f5 docs: Fixed wrong storage platform on module docs for EMC VNX (#43899) 6 years ago
René Moser 041fcb2435
cs_pod: workaround for 4.11 API break (#43944) 6 years ago
Andrew Gaffney c1f41ee607 Display correct task title with strategy 'free' (fixes #43950) 6 years ago
Nathaniel Case 1bb4d232f3 replace errant use of 'response' with 'answer' (#43985) 6 years ago
Jasper Aorangi 42257706b6 Add enable_ip_forwarding option to azure_rm_networkinterface; Fixes #43276 (#43335)
* Merge again trickily similar Accelerated networking and IP forwarding

* Add type to enable_ip_forwarding documentation

* Fix merge error

* auth to auto

* azure_rm_networkinterface: remove auth_source from tests

* azure_rm_networkinterface: remove spurious auth_source from test

* azure_rm_networkinterface: Revert formatting on test

* azure_rm_networkinterface: Correct indentation
6 years ago
Lindsay Hill 5981a7489b new nos_command module (#43056) 6 years ago
Toshio Kuratomi 5ba41a9575 Remove call to parse_returned_data when removing tmpdir
_parsed_return_data should only be used with the return from a module.
This location was invoking a remote shell command rather than a module
so we don't want it here.
6 years ago
Brian Coca abe68d523c
fix alt linux detection for new versions (#43723)
they dropped the Linux so now it only shows as ALT, it should still be backwards compatible
pkg_mgr detection relies on `Altlinux` string, so properly setting os_distribution should take care of it as side effect
fixes #43539
6 years ago
Alexey Sheplyakov 37361d9b0b pkg_mgr: fixed apt_rpm detection (#43769)
Instead of checking the distribution name (which apparently is tricky to find out)
check if /usr/bin/apt-get is managed by RPM.

Fixes #43539
6 years ago
Brian Coca 9be3a7dde5
handle env exception in gathering even no inject (#43569)
* handle env exception in gathering even no inject

(cherry picked from commit 60e3b9b3527daea6d9fb75a80cc14b35923748f3)
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
ssemyonov 7a4517a067 Introduce `force` and `verbose` options in serverless module (#43947)
* Introduce `force` and `verbose` options in serverless module

* Add "version_added: 2.7" for the new `force` and `verbose` options
6 years ago
Matt Martz c1c229c6d4
Remove use of simplejson throughout code base (#43548)
* Remove use of simplejson throughout code base. Fixes #42761

* Address failing tests

* Remove simplejson from contrib and other outlying files

* Add changelog fragment for simplejson removal
6 years ago
Trishna Guha 96346938ee
nxos_vlan refactor to support non structured output (#43805)
* nxos_vlan refactor to support non structured output

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

* unittest fix

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

* minor fixes

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

* use check_rc

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

* address review comment

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

* remove additional return statement

* address Nate's review

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Nathaniel Case f221105882
Prevent data being truncated over persistent connection socket (#43885)
* Change how data is sent to the persistent connection socket.

We can't rely on readline(), so send the size of the data first. We can
then read that many bytes from the stream on the recieving end.

* Set pty to noncanonical mode before sending

* Now that we send data length, we don't need a sentinel anymore

* Copy socket changes to persistent, too

* Use os.write instead of fdopen()ing and using that.

* Follow pickle with sha1sum of pickle

* Swap order of vars and init being passed to ansible-connection
6 years ago
Ganesh Nalawade d1de1e0449
Update iosxr cliconf plugin (#43837)
* Update iosxr cliconf plugin

Fixes #39056

*  Update iosxr cliconf plugin
*  Modify iosxr module_utils code to support
   refactored cliconf plugin api's
*  Other minor changes

* Fix unit test failure

* Update ios, eos, nxos plugin for diff

* Fix review comment
6 years ago
Jordan Borean 7b1cc11685
win_domain modules: ensure Netlogon service is still running after promotion (#43703) 6 years ago
Deepak Agrawal 8eaebf86b6
openvswitch_db : Handle column value conversion and idempotency in no_key case (#43869)
* change column value to string. handle idempotency in no key case

* fix unit test failures in baseline
6 years ago
Dag Wieers 2974df9d5e
Fix typo 6 years ago
Ryan Brown b9df8564a2 Fix spelling of ansbile to ansible (#43898) 6 years ago
Luca Lorenzetto cdb5140ade New module for managing EMC VNX Block storage (#42945)
* New module for managing EMC VNX Block storage

With the module emc_vnx_sg_member users can add or remove luns from
existing storage groups.

This module has been developed in couple with emc_vnx_mv_promote for
disaster recovery process automation, but can be used by itself.
6 years ago
mbusbee b851321b65 VMware: datastore selection (#35812)
This fix adds additional parameter 'datastore'. This parameter
provides a flexibility to specify custom datastore or datastore cluster
to deploy new virtual machine from template (which is located in different
datastore or datastore cluster from virtual machine's datastore or datastore
cluster).

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Nathaniel Case 0f554f9208
Remove unnecessary features from cli_command (#43829)
* Remove wait_for & associated params

* Upgrade command dict to top-level, remove more wait_for accessories

* We don't need all this anymore

* Update docs

* Update tests to new argspec

* Be a little more explicit about sendonly

Also remove reference to the word provider.

* Add example of prompt and answer
6 years ago
Pilou 32eab149b6 [doc] import_role: mention version from which behavior changed and fix some typos (#43843)
* [doc] fix some typos

* [doc] import_role: mention version from which behavior changed
6 years ago
Nilashish Chakraborty 59cd693218
Add source interface and use-vrf features (#43418) 6 years ago
Abhijeet Kasurde bc84f69ae0
Fix unreferenced msg from vmware_host (#43872)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Trishna Guha 55f8b9fa71
set supports_generate_diff to False vyos (#43873)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Alex Bush d1d08304f9 azure_rm_loadbalancer_facts.py: list() takes at least 2 arguments fix (#29046) (#29050) 6 years ago
Antoine Cotten 6741e98c04 azure_rm_deployment: collect tags from existing Resource Group (#26104) 6 years ago
Abhijeet Kasurde e364d717cb
VMware: remove unused imports (#43804)
Idea taken from https://github.com/ansible/ansible/pull/43402

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Dag Wieers ddf3ba01d2
aci_fabric_node: Fix idempotency (with newer ACI ?) (#43848) 6 years ago
Dag Wieers 02b5057392
Support dash-separated leaf IDs (as documented) (#43846) 6 years ago
akira6592 8662e87b1a Corrects module name in net_get module doc (#43816) 6 years ago
curry9999 2d79589515 To improve readability, we added a line feed. (#43801)
* 	modified:   google/gcp_compute_backend_bucket.py
	modified:   google/gcp_compute_backend_service.py
	modified:   google/gcp_compute_forwarding_rule.py
	modified:   google/gcp_compute_global_forwarding_rule.py
	modified:   google/gcp_compute_image.py
	modified:   google/gcp_compute_instance.py
	modified:   google/gcp_compute_instance_group.py
	modified:   google/gcp_compute_instance_group_manager.py
	modified:   google/gcp_compute_instance_template.py
	modified:   google/gcp_compute_route.py
	modified:   google/gcp_compute_subnetwork.py
	modified:   google/gcp_compute_target_http_proxy.py
	modified:   google/gcp_compute_target_https_proxy.py
	modified:   google/gcp_compute_target_ssl_proxy.py
	modified:   google/gcp_compute_target_tcp_proxy.py
	modified:   google/gcp_compute_url_map.py
	modified:   google/gcp_container_node_pool.py
	modified:   google/gcp_dns_resource_record_set.py
	modified:   google/gcp_pubsub_subscription.py
	modified:   google/gcp_storage_bucket_access_control.py

* 	modified:   lib/ansible/modules/cloud/amazon/aws_ses_identity.py
	modified:   lib/ansible/modules/cloud/amazon/route53_facts.py
	modified:   lib/ansible/modules/cloud/cloudscale/cloudscale_server.py
	modified:   lib/ansible/modules/network/aos/_aos_logical_device.py
	modified:   lib/ansible/modules/network/aos/_aos_rack_type.py
	modified:   lib/ansible/modules/network/aos/_aos_template.py
	modified:   lib/ansible/modules/network/cumulus/nclu.py
	modified:   lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_launch.py
	modified:   lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_wait.py
6 years ago
Dag Wieers 014fca8ca5
Fix all ACI examples to use delegate_to (#43439)
This is to avoid users connecting to the APIC using SSH, which is likely
to fail. In the ACI documentation (linked from every module) we go into
more details on how people are supposed to work with the modules..
6 years ago
Nathaniel Case 35f625ee3b
Network *_config action plugin updates (#43838)
* Compatibility fixes for ${network_os}_config action plugins
6 years ago
Anil Kumar Muraleedharan ceb49bdf12 Lenovo size reduce cnos.py of util (#43823)
* Changing Lenovo Inc to Lenovo and update License file to be consistent.

* Moving code in util file to module file. This is done as per a review comment

* Update cnos_vlag.py

* Update cnos_vlan.py

* Update enos_config.py
6 years ago
Feilong Wang 23adc436fd Add OpenStack Magnum cluster template module (#42654) 6 years ago
Matt Clay 1f40718a26 Fix PEP 8 issue in exos_facts. 6 years ago
Lingxian Kong 84a1decaf0 Add os_listener module for OpenStack Octavia (#42604) 6 years ago
Lingxian Kong 018a8eb8ee Add os_loadbalancer module for OpenStack Octavia service (#42552) 6 years ago
Lance Richardson bd4d68c785 network/exos: add exos_facts module (#43210)
Add exos_facts module. Known limitations at this time include:
   - Interface MTU is not reported.
   - Only primary interface IP is reported.

Add basic unit tests for the exos_facts module.

An EXOS CLI prompt can be prefixed with '! ' (shutting down), '* '
(running configuration does not match saved configuration), and
can include various status tokens within parentheses after these
prefixes. Update prompt regex to accept valid CLI prompts.
6 years ago
sward1557 e24c036057 Added junos_config note about override set format (#43608) 6 years ago
Lindsay Hill 8429f777da New networking module: voss_command (#43741)
* new voss_command module

* Removed incorrect version_added line
6 years ago
Andreas Calminder 3419c75411 make lockfile destination settable and update doc (#42795)
* make sure lock file is available for others when unlocking

* add tmpdir option and updated documentation
6 years ago
Abhijeet Kasurde 1366a694f9
VMware: Update example (#43786)
* Unified examples in all modules
* validate_certs is now 'no' instead of 'False'
* delegate_to changes

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ganesh Nalawade 4618583f2f
Update eos clcionf plugin (#43809)
* If the remote host supports session
  capability set the `supports_generate_diff`
  flag to false which identifies if config diff should
  be generated within module or not
6 years ago
Yuwei Zhou 6dce96e1d0 refine aks document (#43810) 6 years ago
Trishna Guha 5f8654e5bd
revert #43546 nxos terminal plugin (#43806)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Yuwei Zhou 88a738b0ba Fix nsg cannot add rule with purge_rules false (#43699) 6 years ago
Yunge Zhu 5088f7c926 add azure_rm_appserviceplan module (#40906)
* add azure_rm_appserviceplan module

* fix lint in test

* fix lint

* fix test

* fix test syntax

* resolve comments

* fix test
6 years ago
Yunge Zhu 97942cf049 add azure_rm_webapp (#40005)
* add azure_rm_webapp

* fix lint error

* resolve comments

* fix lint

* fix lint

* fix lint

* fix lint

* fix test failure

* fix test

* fix test

* fix test

* refine ux

* resolve comments

* fix lint and test

* fix lint

* code cleanup

* combine windows_frameworks/linux_framework to one

* fix lint in doc

* fix l int

* fix lint

* fix bug

* fix bug

* fix bug

* fix bug

* fix syntax error

* fix lint error

* fix bug of wrong indent

* fix test issue

* update java framework parameter

* fix lint error

* resolve comments

* fix lint

* resolve comments

* fix bug

* update test

* fix lint

* fix test
6 years ago
Dag Wieers d8ba8c03f3
ACI: Make querying links and nodes possible (#43441)
This functionality was not considered when the module was written, but
there's no reason why it shouldn't be supported.

We had to rework the query string construction and object filtering.
This new functionality allows to filter on arbitrary keys and supports
None values.

This PR fixes various issues with the existing framework, including
querying specific objects using construct_url_4 (i.e.
aci_epg_to_contract and aci_static_binding_to_epg)
6 years ago
curry9999 529cd19ca5 I changed the document of win_hostname.py. (#43761)
* Host name is contrary to naming convention

<!--- Your description here -->

+label: docsite_pr

* removed yaml separators
6 years ago
curry9999 9c4be54625 To improve readability, we added a line feed. (#43764)
* A line break was added.

<!--- Your description here -->

+label: docsite_pr

* "blank line contains whitespace" was fixed.
6 years ago
Willian Ricardo 29f2bf651e [aws] Allow CloudWatch Log Group retention to be changed when log group exists (#43752)
* fix bugs #42028 and #43735
6 years ago
curry9999 d7009abee4 [docs] required arguments: name (#43758)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Jerry Elmore f5cd6d2821 Corrected spelling of 'formatted' (#43785) 6 years ago
Abhijeet Kasurde ce7eecd782 Misc typo fixes in function docs (#43779)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
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