Commit Graph

22516 Commits (501503f4cb424d01c030e14cb5e5f8445fcdada3)

Author SHA1 Message Date
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
saichint bea8e0200c warning message improved (#42969) 6 years ago
Lindsay Hill 70564ffd89 Missing close " (#42985)
Command was missing a close `"`. This was still interpreted properly by the switch, and was not breaking anything, but this is tidier.
6 years ago
FragmentedPacket d2409fb165 Add example of using loop: with when: statements (#42776) 6 years ago
Adam Harwell a9b1af8bdd Yum: Add support for --downloadonly (#41506) 6 years ago
Yanis Guenane 2c4ba7a9e9 Vultr: Introducing vr_user_facts module (#42951)
This commit introduces a new module called vr_user_facts.

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

Sample available here:

```
"vultr_user_facts": [
  {
    "acls": [],
    "api_enabled": "yes",
    "email": "mytestuser@example.com",
    "id": "a235b4f45e87f",
    "name": "mytestuser"
  }
]
```
6 years ago
Bryce Verdier b16fef9aad removing duplicate operations from the use of list comprehensions. None of the logic within the code has been changed, just more refined. (#41098) 6 years ago
Frank Vissing 66adabfd42 disable_excludes (#42510)
* implementing disable_excludes

* add check for yum version

* limit choices

* add testcases for disable_exclude

* fix formating

* add documentation

* syntax fix for test case

* fix indentation

* need to ignore errors when we want to do a test that fails

* test disable_excludes with zip and not sos

* add tests for yum < 3.4 not supported

* fix formating

* centos 6.1 does not support map

* drop unsupported selectattr

* cleanup testcases

* fix test cases beloging to wrong test scenarion (propper when)

* evaluate expression

* minor test fixes

* check output of msg
6 years ago
Dag Wieers f2acc97b84 Windows: Get rid of remaining Get-Attr modules (#42921)
This is the final cleanup of modules still using the old Get-Attr
interface. Ready to deprecate this mechanism.
6 years ago
Orion Poplawski 32436ea9a5 dnf: Call dnf.Base.close() before exit to cleanup. (#41810) 6 years ago
Sloane Hertel 67cf2da2a1 Fix error when removing S3 lifecycle rules (#42762) 6 years ago
Vladimir Pavljuchenkov a7d0804279 Update cloudformation.py (#42948)
missed space

+label: docsite_pr
6 years ago
Samer Deeb 3ca4a35334 Add support for global IGMP configuration on onyx switches (#42164)
* Add support for global IGMP configuration on onyx switches

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* Add support for global IGMP configuration on onyx switches

Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Anil Kumar Muraleedharan 0897e79bd1 Persistence connection for cnos_vlan (#42500)
* Changing Lenovo Inc to Lenovo and update License file to be consistent.

* Changing cnos_vlan from paramiko to persistence connection of Ansible. Also talking care of CLI changes in CNOS commands with backward compatibility.

* Fixing Validation issues

* Trailing lines removal

* Review comments of Gundalow are getting addressed. He mentioned only at one place for cnos.py. But I have covered the entire file.

* Changes to incorporate Review comments from Qalthos

* Removing configure terminal command from module code

* Aligning with change in run_cnos_commands method changes

* Editing cliconf for latest CNOS CLIs
6 years ago
Hossein Zolfi e756ef8265 Fix example of nmap plugin (#42925) 6 years ago
Yanis Guenane a826ac3ea9 vultr: Add proper extension to vr_region_facts(.py) (#42944) 6 years ago
Guy Templeton 841b063d12 Fixes #37752 Delete all versions and deletemarkers in S3_Bucket when force paramet… (#39781)
* Delete all versions and deletemarkers in S3_Bucket when force parameter is passed

* Fix PEP8 style conformance

* Clarify explanation of force parameter
6 years ago
Yanis Guenane 9a1185e57c Vultr: Introducing vr_plan_facts module (#42470)
This commit introduces a new module called vr_plan_facts.

This module aims to return the list of plan avaiable avaiable to use on
booted servers.

Sample available here:

```
"vultr_plan_facts": [
  {
    "available_locations": [
      1
    ],
    "bandwidth": 40.0,
    "bandwidth_gb": 40960,
    "disk": 110,
    "id": 118,
    "name": "32768 MB RAM,110 GB SSD,40.00 TB BW",
    "plan_type": "DEDICATED",
    "price_per_month": 240.0,
    "ram": 32768,
    "vcpu_count": 8,
    "windows": false
  }
]
```
6 years ago
Yanis Guenane aef97c5ac4 Vultr: Introducing vr_os_facts module (#42473)
This commit introduces a new module called vr_os_facts.

This module aims to return the list of OSes avaiable avaiable to use to
boot servers.

Sample available here:

```
"vultr_os_facts": [
  {
    "arch": "i386",
    "family": "ubuntu",
    "id": 216,
    "name": "Ubuntu 16.04 i386",
    "windows": false
  }
]
```
6 years ago
Yanis Guenane 11fd20b5ea Vultr: Introducing vr_region_facts module (#42471)
This commit introduces a new module called vr_region_facts.

This module aims to return the list of region avaiable avaiable to use
where boot servers.

Sample available here:

```
"vultr_region_facts": [
    {
      "block_storage": false,
      "continent": "Europe",
      "country": "FR",
      "ddos_protection": true,
      "id": 24,
      "name": "Paris",
      "regioncode": "CDG",
      "state": ""
     }
  ]
```
6 years ago
Yanis Guenane 9b898ebc20 Vultr: Introducing vr_sshkey_facts module (#42615)
This commit introduces a new module called vr_sshkey_facts.

This module aims to return the list of SSH keys avaiable in Vultr.

Sample available here:

```
"vultr_sshkey_facts": [
   {
    "date_created": "2018-07-10 14:49:13",
    "id": "5b43c760d7d84",
    "name": "me@home",
    "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+ZFQv3MyjtL1BMpSA0o0gIkzLVVC711rthT29hBNeORdNowQ7FSvVWUdAbTq00U7Xzak1ANIYLJyn+0r7olsdG4XEiUR0dqgC99kbT/QhY5mLe5lpl7JUjW9ctn00hNmt+TswpatCKWPNwdeAJT2ERynZaqPobENgewrwerqewqIVew7qFeZygxsPVn36EUr2Cdq7Nb7U0XFXh3x1p0v0+MbL4tiJwPlMAGvFTKIMt+EaA+AsRIxiOo9CMk5ZuOl9pT8h5vNuEOcvS0qx4v44EAD2VOsCVCcrPNMcpuSzZP8dRTGU9wRREAWXngD0Zq9YJMH38VTxHiskoBw1NnPz me@home"
  }
]
```
6 years ago
sevs44936 7dbdc8a92e Fix for cloudflare_dns SRV record and Python3 (#42914)
This fix adds correct way of comparing dict with dict while managing cloudflare_dns SRV record.

Fixes: #40445
6 years ago
Jordan Borean 8447f25e10
win_chocolatey_config: added module to manage Chocolatey config (#42915) 6 years ago
Jordan Borean 7ae5912d91
win_chocolatey_feature: new module (#42848)
* win_chocolatey_feature: new module

* Fixed up copyright header in PowerShell file
6 years ago
Jordan Borean 933d36b25f
win_chocolatey_source: add new module to manage Chocolatey sources (#42790)
* win_chocolatey_source: add new module to manage Chocolatey sources

* Added examples and fix diff run

* Minor fixes from review

* When editing a source, recreate with the explicit options instead of using the existing source

* Fixed up copyright header in PowerShell file
6 years ago
Abhijeet Kasurde db9c9e7fc5 VMware: dns_suffix as a list of domain suffixes (#42678)
This fix adds dns_suffix as a list of domain suffixes and
also updates documentation and example.

Fixes: #42229

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Michael Steffens 4af16d0c76 Python3: compare bytes with bytes and strings with strings. (Fixes #42677) (#42878) 6 years ago
Dag Wieers 95a1170908 Windows: Add "special" parameter types to docs (#42853)
* Windows: Add special parameter types

Adding explicit parameter types now exposes this information in the
module documentation, and proves really helpful.

We only do this for non-string types as strings, mostly because strings
are implicit.

PS We also make copyright statements consistent and use #Requires for
explicit library imports

* Type "string" must be type "str"

* A few more Copyright corrections

* More fixes

* Don't add file encoding to Powershell files

* Don't add missing interfacetypes parameter

Otherwise CI demands an incorrect version_added

* Small fix
6 years ago
Tim Rupp 290df027e3
Adds the ipaddress compat library backport from Python 3.x (#42265)
This library is a backport (to 2.x versions of Python) of the code
that is found in the mainline versions of Python 3.x. It is being
included so that networking vendors, and others, can make use of it
without needing to add a python module dependency to their own modules.

A separate dependency would add to user burden of satisfying those
dependencies before using some Ansible modules.

In a previous core meeting, this was approved. Naming of the directory
it is found in was up for debate, but "compat" was the first directory
to have some sort of concensus.
6 years ago
Fabian von Feilitzsch 9eccc96586 Special case project creation so that it is possible (#42132) 6 years ago
Dag Wieers e899824c49
ACI: Add parameter types to module docs (#42893)
* ACI: Add parameter types to module docs

* Update validate-modules ignore list
6 years ago
Gregory DEPUILLE 0d1c06814f vmware_vmotion: added storage vmotion capabilities. (#21421)
This fix adds vmotion capabilities to vmware_vmotion across different datastores and different hostsystem.
6 years ago
Yanis Guenane 577427b1c2 vultr: Make get_result handle list (#42890)
Currently get_result() can only handle a dict. When requiring facts, and
when there is more than one fact, get_result() should be able to handle
a list of dicts, so the normalization process happens to all the items.
6 years ago
Adam Conway b6e9df2065 Update yum_repository.py (#42859)
* Update yum_repository.py

Having spent some time trying and googling how to enable an installed repo with this, I discovered that the thread at https://github.com/ansible/ansible-modules-extras/issues/2384 had decided that this would not be supported and recommended use of ini_file instead.  Since I am sure I'm not alone in expecting yum-repository to support enabling/disabling a configured repo, I suggest adding a note so people find this easier.
6 years ago
Fran Fitzpatrick 27a3a90fc8 FreeIPA: new module ipa_config (#42279)
* Adds new ipa_config module

* Modify _post_json to handle config_show/config_mod

* Doc: Add periods

* More documentation

* Added aliases
6 years ago
Rémy Léone 2177d37d5a Use IP address instead of server id to index servers (#41658) 6 years ago
Abhijeet Kasurde cb1396b5be VMware: vmware_vm_facts check for template config (#42354)
This fix adds additional check for getting template from
virtual machine before using it.

Fixes: #42011

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Derek Whatley 24a3669662 Fix invalid Dockerfile created by "galaxy init --type apb" (#42017) 6 years ago
Abhijeet Kasurde e8c90b47eb
VMware: support for 2.6 and sslContext (#42237)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
uwila f26272a492 Fix 2 issues in sysvinit module (#42786)
* Do not compare result to unset parameter in sysvinit module

* Fix misformed command in sysvinit module

* Small None-comparison style fix in sysvinit module
6 years ago
dgeo ae96ba0d4f fix a (forgotten?) change in moving createhome -> create_home (#42711)
* fix a (forgotten?) change in moving createhome -> create_home

Fix for following bug on FreeBSD host whith user module:
```
fatal: [webssp]: FAILED! => {"changed": false, "module_stderr": "X11 forwarding request failed
Traceback (most recent call last):
  File \"/tmp/ansible_2rmlBl/ansible_module_user.py\", line 2487, in <module>
    main()\n  File \"/tmp/ansible_2rmlBl/ansible_module_user.py\", line 2426, in main
    (rc, out, err) = user.modify_user()
  File \"/tmp/ansible_2rmlBl/ansible_module_user.py\", line 1011, in modify_user
    if (info[5] != self.home and self.move_home) or (not os.path.exists(self.home) and self.createhome):
AttributeError: 'FreeBsdUser' object has no attribute 'createhome'
", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
```
It happenned with 'createhome' AND with 'create_home' form, with python 2.7 AND python 3.6

* Add changelog


Co-authored-by: dgeo <dgeo@users.noreply.github.com>
6 years ago
Jiri Tyr 92c58e9a66 Adding namespace option into the xattr module (#42755)
* Adding namespace option into the xattr module

* Include namespace into the tests

* Make it backward compatible, remove re and operator module
6 years ago
Abhijeet Kasurde 7f0fe1898e urls: handle incorrect parsing of https_proxy env (#41472)
If user exports https_proxy without scheme, then generic_urlparse
fails to parse SCHEME and HOSTNAME from https_proxy variable.
This fix raises ProxyError is generic_urlparse API fails to parse
either of them.

Fixes: #25421

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Yanis Guenane 08acc74056 vultr.py: fix env var handling (#42659) 6 years ago
Wojciech Sciesinski cf4e7fd70a Make the code more PowerShell compliant (#39464)
* Make the code more PowerShell compliant

* Correction of the mistaken comment

* Revert style changes to If/Else/Elseif

* Remove an ignored PSScriptAnalyzer rule due to the code correction

* Decreasing of an entropy ;-) and replacing the next to aliases

* minor whitespace changes
6 years ago
Matt Martz 27b4d7ed31
Add feature to expose vars/defaults with include/import_role (#41330)
* First pass at making 'private' work on include_role, imports are always public

* Prevent dupe task execution and overwriting handlers

* New functionality will use public instead of deprecated private

* Add tests for public exposure

* Validate vars before import/include to ensure they don't expose too early

* Add porting guide docs about public argument and change to import_role

* Add additional docs about public and vars exposure to module docs

* Insert role handlers at parse time, exposing them globally
6 years ago
Kevin Breit 106e4b374a Meraki utility - construct_path() now supports custom keys (#42286)
* construct_path() now supports custom keys

- Allows for much more flexible test substitution
- Implemented functionality in meraki_vlan for test case

* Fix comments for PEP8
6 years ago
Matt Davis 5d76b627ef
fix py3 string error in ssh failure handling (#42655) 6 years ago
Fabian von Feilitzsch 0421305254 Properly format API key when set in an enviroment variable (#42202) 6 years ago
Fabian von Feilitzsch 4f63134d78 Use top level values as defaults if metadata is not provided (#42277) 6 years ago
Brian Coca f1dcfe4f4c
use get_option instead of directly internal dict (#42199)
* use get_option instead of directly internal dict

as get_option can populate it, while direct access cannot
also setup fallback values for derived plugins not using config system correctly
6 years ago
MedicMomcilo a97618b486 Add option to control CDATA tags stripping (#42689)
* Add option to control CDATA tags stripping

* Fix remaining issues before merging.

* Add missing trailing dot.
6 years ago
Fabian von Feilitzsch fa8de0c384 [k8s] Fix typo that breaks check mode when a resource is created (#42763) 6 years ago
Sloane Hertel 2c3e6f8bd3 [elb_target_group] fix docs and add default for wait_timeout - fixes #42324 (#42477)
Add default for wait_timeout and version_added flag
6 years ago
Toshio Kuratomi a0748c0837 Don't use deepcopy when creating attributes unless really needed 6 years ago
Andrew Gaffney e4af3a8957
Mark vars from facts cache as unsafe (fixes #42656) (#42682)
Facts are marked as unsafe when originally gathered, but they lose that
marking when they are serialized to JSON and parsed back out.
6 years ago
Brian Coca 44d4327bc7 moved to use 'get_option'
also fixed bad str() usage
6 years ago
Dennis Conrad f0463befc7 Fixes #42734 - typo in update-rc.d detection 6 years ago
Kevin Mooney 7a0c28cc37 Put umask value in quotation marks (#41409)
The given example causes the pip module to fail. If the umask is given as an octal string without quotation marks, the pip module converts it into an integer (i.e., an invalid umask). 

+label: docsite_pr
6 years ago
Jared Hocutt 7e97380664 Fix docs for the volume parameter in the ec2_instance module (#42710)
The existing docs specified valid keys of ebs.device_type and ebs.device_size
but they should instead be ebs.volume_type and ebs.volume_size.
6 years ago
Trishna Guha d5e9653c96
Add get_capabilities in nxapi module_utils (#42688)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
jamessemai dc32842573 win_security_policy: Allow setting a value to empty (#42051)
* win_security_policy: allow removing values (resolves #40869)

* Removing warning

* Adding test for remove policy setting

* Fixing string comparison

* Make idempotent

* Adding idempotency and diff test

* added changelog fragment
6 years ago
Avi Shefi b2527c55c3 fix win_unzip and win_share Powershell cmdlets output invalid JSONs (#42713) 6 years ago
Jordan Borean e3521776f5
win_chocolatey: add TLSv1.2 support for install phase (#41992) 6 years ago
Brian Coca 006f08da99
Fix fact cleaning (#42595)
* fix fact cleanup

fixes #41684
6 years ago
Chris Brown a4a37e8dfb Fixed a typo in documentation (#42702)
"Therefor" to "Therefore"

+label: docsite_pr
6 years ago
Gennady Aleksandrov 12057de1c6 Fix #38038 cloudfront_facts module returns only first page of response (#38045) 6 years ago
Clement Trebuchet 7c97bb5077 Devel ios vrf submode (#41659)
* add submode features ipv4/ipv6

* add tests for submode

* the parameters both_ * were not idempotent, in what is read in the configuration we have a list with 2 entries (import, export) while the input parameter has only one parameter which will be applied twice

* add docstring to the ios_vrf module + provide a fix for: https://github.com/ansible/ansible/issues/41581

* complete tests

* add missing description

* fix KeyError for address-family ipv*

* fix both_* tests

* fix E231, W292, W293

* fix W293

* remove set has it doesn't preserve order of routes

* fix E106

* remove ImportError: cannot import name OrderedDict

* We should be able to mix the parameters for the routes targets , while remaining imdepotent. During the first implementation we did not take this into account, which did not correspond to the reality of the needs in production (to be able to use each parameter indifemently together)

* remove epdb reference

* FIX E111, E106

* FIX E302

* using loop produce a result who  was not imdepotent

* FIX E241

* fix: used pass intead of list
6 years ago
Kevin Breit 2038ff5569 meraki_mx_l3_firewall - Fix idempotency for default rule logging (#42649)
* Fix idempotency and default syslog bugs

* Fix idempotency check for syslog_default_rule

* Syntax errors
6 years ago
Kevin Breit 9105149595 Cange URL for organization device lookup (#42648) 6 years ago
Peter Sprygada d086d57d11 adds a new feature to the telnet action plugin
This change adds a new argument to the telnet action plugin that will
cause the module to send a newline character before trying to login.
This is convienent when using telnet over a console connection that
needs an initial newline character to start the login process.

This change also will cause the sent command and command response to be
displayed on stdout when running in verbose mode (5 v's).
6 years ago
Brian Coca 12a8363fae
Error on empty group/host name (#42584)
* error on false host/group name
6 years ago
Martin Krizek 00c88f6497 [aws] Add missing methods to AnsibleAWSModule (#42679) 6 years ago
Henryk Konsek ebeb46aa61 Added Scaleway volume module (#41667)
* Added Scaleway volume module.

* Fixed imports order.

* Fixed version added.

* Improved sanity checks.

* Fixing style formatting.

* Added new line at the end of file. Fixed typo in comment.
6 years ago
Dag Wieers 5465dca7ec
aci_bd_subnet: Support parameter scope not set (#42675)
If parameter scope is not set (is None) the usual handling of lists does
not apply, and should be avoided or we get an exception.

This needs to be backported to earlier versions of Ansible.
6 years ago
Calvin Wu 7e42e88cc1 ecs_taskdefinition can absent without containers argument (#41398)
* ecs_taskdefinition can absent without containers argument

* add regression test for absent with arn

* Add PassRole privilege for ecs_cluster to pass
6 years ago
Ryan Brown e4c28571d0 Update to AnsibleAWSModule and remove now-duplicate fail_json_aws function (#42629) 6 years ago
Nathaniel Case 6b162142a7 ios_file: Don't leave leftover files behind (#42622)
* Don't leave leftover files behind

* Fix writing files in python3

* Replace nonascii.bin with one that will not pass for unicode
6 years ago
Ganesh Nalawade 6a94090e7f
Fix junos facts integration test failures (#42623)
*  Make fetching old style facts optional
   and try to fetch the old style facts only when
   `ofacts` value is present in `gather_facts`
* Fix in junos_facts integration test
6 years ago
Jordan Borean d723b8541d changed winrm _reset to reset and make ssh reset show warning (#42651)
* changed winrm _reset to reset and make ssh reset show warning

* minor changelog update
6 years ago
Matt Davis a5fc9a17f0
return wu result from inner job (#42647)
fixes #42423
6 years ago
Brian Coca e115e6496f
preserve delegation info on no_log (#42577)
* preserve delegation info on no_log

fixes #42344
6 years ago
Pavel Eremeev 2a90bea311 Several kubectl fixes (#40882)
* Fixed typo

* Fixed namespace parameter and tmp dir
6 years ago
Felix Fontein 765a5130d5 Docker modules: improve documentation on docker vs. docker-py Python package requirements (#42457)
* Make sure all docker-py/docker requirements are listed, and clarify about docker vs. docker-py.

* Adjusting changes made in #40839.
6 years ago
Dag Wieers 27f540ac5c
Add parameter types to documentation (#42572)
Few documentation fixes
6 years ago
rhorer 28820d3de0 Very slightly clean up the inline documentation 6 years ago
Samir Musali 985768b2af LogDNA Callback Plugin (#40296)
* LogDNA Callback Plugin...
6 years ago
Clement Trebuchet c7981c4cc8 Add the NIOS RECORD PTR Module (#41900)
* Add the NIOS RECORD PTR Module

* FIX E241,E231, E105

* FIX module should not be executable

* FIX module RWX

* Remove change in nios_srv_record

* Remove change in nios_srv_record

* FIX test_nios_ptr_record_update_comment

* ADD: Integration and target tests for the NIOS PTR RECORD module.

* FIX module name in integrations tests

* Update integration

* Refactor nios_ptr_record module

* Refactor the nios_ptr_record_idempotence

* FIX name

* Smoketests for the NIOS modules does not take care of the PTR:RECORD object

* REM the default for view

* Add finals test, after adding the PR (https://github.com/ansible/nios-test-container/pull/1) in order to handle PTR:RECORD

* add the define nios specific constant for PTR:RECORD

* fix: documentation style

* add create an ipv6 ptr record

* rename class name, add ipv6 unittest
6 years ago
Fran Fitzpatrick 5928ec04ca Adds an ipmath filter (#41985) 6 years ago
Sloane Hertel 7086863c52 [s3_bucket] import urlparse (#42474) 6 years ago
Toshio Kuratomi ccbac66128 Revert "Make ansible doesn't parse template-like password in user's input (#42275)"
This reverts commit de40ac02a5.

Passwords from the cli need to remain bytes on input otherwise we have
encoding problems when users input non-utf8
6 years ago
Jerry Chong 42f44b24c6 Fix NameError in pause module (#42038)
* Fix NameError in pause module

* Add comment and changelog

Co-authored-by: Jerry Chong <jchong@netbase.com>
6 years ago
Grzegorz Śliwiński d6f20952fe Fix ec2_asg metric* option's version introduction - refs #25168 (#42626)
Introduced in 404f9260d9 during 2.6, so version_added: 2.5 was incorrect.
6 years ago
Nilashish Chakraborty fa624eba29 Fixed regex to pick correct items (#42557) 6 years ago
Will Thames 42eaa00371 Provide kubernetes definition diffs in check_mode (#41471)
Move dict_merge from azure_rm_resource module to
module_utils.common.dict_transformations and add tests.

Use dict_merge to provide a fairly realistic, reliable
diff output when k8s-based modules are run in check_mode.

Rename unit tests so that they actually run and reflect
the module_utils they're based on.
6 years ago
hitsumabushi cf7a42b4f4 allow empty line in src template file (#42493) 6 years ago
Jordan Borean 940d4a0e89
win_reboot: fix 2.6 issues and better handle post reboot reboot (#42330)
* win_reboot: fix 2.6 issues and better handle post reboot reboot

* changed winrm _reset to reset

* Add handler to reset calls when .reset() throws an AnsibleError on older hosts

* Moving back to _reset to get the issue fixed
6 years ago
Toshio Kuratomi 780c8986af Add boilerplate from __future__ and type declarations 6 years ago
Andreas Calminder 577e66660d Simple file locking feature (#42024)
* class for file locking feature
6 years ago
Marcos Alano 2d6bb2500e Add support for espeak-ng. Closes #42438 6 years ago
Andrew Gaffney 824524c67a
Display task banner before showing file diff (#42573) 6 years ago
Matt Martz 8aea8901c3 Add config to fail on invalid task attributes. Fixes #42479 6 years ago
Brian Coca 937e710485
ensure 'text' source assumptions (#42522)
* ensure 'text' source assumptions
6 years ago
Brian Coca 1c08eb8b27
fix irc module to work with py3 (#42267)
* fix irc module to work with py3

fixes #42256
6 years ago
Brian Coca 4a7940c562
Ensure string types (#42362)
* actually enforce string types

* unquote after its text

* fixed incorrect template type

* fixing string showed error in template typing
6 years ago
Kevin Breit a65d9257fd Removed any temporary get_net() methods (#42391)
- Made appropriate changes where needed
6 years ago
Yuwei Zhou e9bf3c70e6 disk fact should return create_option value (#42398) 6 years ago
Yanis Guenane 593f484d77 Fix E324 for vultr modules. (#42464) 6 years ago
Toshio Kuratomi 673c55f2ef Separate some 255 exit codes that are not ssh errors
The ssh connection plugin is overzealous in thinking that error code 255
can only come from ssh.  Python can return 255 in some circumstances and
error from php does as well.
6 years ago
Toshio Kuratomi 9350a81ae4 Port modules away from __file__
* __file__ won't work if we want to invoke modules via -m or if we
  figure out how to keep modules from hitting the disk with pipelining.
* module.tmpdir is the new way to place a file where it will be cleaned
  automatically.

Change format string to not depend on __file__:

* cloud/amazon/ec2_elb_lb.py
* cloud/amazon/elb_classic_lb.py

Use module.tempdir:

* packaging/os/apt.py
* files/unarchive.py
6 years ago
Pilou 72d7a1eb5c Setup module: use C() formatting function in parameter descriptions, add a task based example (#42411)
* setup module: use C() in parameters description

* setup module: use a task example
6 years ago
Matt Martz abb05c98f3 Make sure we are comparing bytes extensions in inventory plugins (#42475)
* Ensure we are comparing text paths with extensions. Fixes #42118

* Add changelog
6 years ago
Brian Coca 8e1d223301
complete plugin docs (#42355)
* complete plugin docs

  * add missing 'plugin' option
  * user and password are now 'correctly' required
  * added  inventory source example and extension information for user
6 years ago
Brian Coca 2496fd35fb added required missing field for common yaml fmt 6 years ago
Matt Martz 50905b980d Support item label in v2_playbook_on_include (#42478)
* Support item label in v2_playbook_on_include. Fixes #42301

* test fixes
6 years ago
bpetit 9bd7bd5d46 [docs] Document requirements for `plan_file` option in terraform module (#42514)
plan_file is required if state: planned is used. This should be mentionned in the documentation.

+label: docsite_pr
6 years ago
Zhikang Zhang 70e33ef92c
Make ios_vlan identify vlans starting with 9 (#42247)
* Make ios_vlan identify vlans starting with 9

* Add unit test for vlan id start with 9
6 years ago
Jakub Libosvar 26b0908270 openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is
required only for columns with type of a 'map'. This patch makes 'key'
an optional parameter to allow setting values for other column types
like int.

Fixes #42108
6 years ago
Fabian von Feilitzsch e9c7b513a1 [k8s] allow user to pass list of resources in to definition parameter (#42377)
* allow user to pass list of resources in to definition parameter

* Add new validator for list|dict|string

* use string_types instead of string

* state/force information is lost after the first item in the list

* Add tests

* Appease ansibot
6 years ago
Paul Neumann dfb2b3fdd5 ios_facts: Report space of file systems (#41850)
* ios_facts: Report file system space

Parse total and free space from dir output. For this, add a hash
filesystems_info containing the keys spacetotal_kb and spacefree_kb.

* ios_facts: Add unit test for file system space reporting

* ios_facts: Add integration test for file system space reporting
6 years ago
Felix Fontein dbb58b34c3 Version must be quoted (otherwise it is printed as 2.1) (#42496) 6 years ago
Dag Wieers 3c35b1dbc5
sefcontext: Improve documentation (#42416)
* sefcontext: Improve documentation

* Clarify why this module does not apply changes to filesystems

* Fix

* More clarity
6 years ago
Dag Wieers 0fbaf9940f
cobbler_sync: New module to sync Cobbler changes (#39910)
This module is required if you're using Cobbler for provisioning
systems using Ansible.
6 years ago
Dag Wieers 198b62b906
file: Recover from unexpectedly disappearing files (#42281) 6 years ago
Dag Wieers 8eb1e8c0e6
Ensure boolean value 'yes' is shown and add types (#42361)
And a few small cosmetic changes.
6 years ago
Kevin Breit 7b07c9b220 meraki_network - Add support for disableMyMerakiCom (#42418)
* Add support for disable_my_meraki parameter

- Meraki added support for the disabling access to Meraki websites on
devices. This module now supports this.
- I haven't tested this as it was developed on an iPad. It will work
before submitting PR.
- Rework of payload generation code is required or at least
recommended.
- Integration tests need to be developed.

* Added support for disableMyMerakiCom parameter

* - Remove proposed functions as it isn't required for updates
- Add integration tests
- Still pending a case response from Meraki since I can't seem to
set disableMyMerakiCom to false after it's true

* Fixed word wrap problem

* Add version_added to disable_my_meraki
6 years ago
Kevin Breit c644e3da79 meraki_network - Added proper response documentation (#42393)
* Added proper response documentation to meraki_network

* Missing colon
6 years ago
Kevin Breit 78fd5ce651 Improve documentation of module (#42332) 6 years ago
Kevin Breit 9cd2388d1a New module - meraki_ssid (#42329)
* Initial commit of meraki_ssid module
- CRUD functionality for Meraki wireless SSIDs
- Much more testing is needed
- Module is not currently idempotent

* Improve integration tests
- Original integration tests didn't have any assertions in it
- Single bug fix in module found via integration test

* Added idempotency support
- Changes are only made when needed.
- Added integration test to check for idempotency.
- Relies on a forthcoming PR to make idempotency check a single pass.

* Improved documentation
6 years ago
Kevin Breit 132943cac5 New module - meraki_mr_l3_firewall (#42328)
* Initial commit for meraki_mr_l3_firewall module

- CRUD functionality for layer 3 firewall rules on the Meraki MR access points
- Complimentary integration test
- Need to add support for SSID lookup

* Added support for specifying SSID name and improved documentation

* Added examples to documentation

* Removed whitespace
6 years ago
Kevin Breit 3d3d919c11 New module - meraki_mx_l3_firewall (#42326)
* Initial commig for meraki_mx_l3_firewall
- View and modify L3 firewalls applied to Meraki MX firewalls
- Initial integration tests included

* Added example documentation

* Added documentation for responses

* Documentation tweaks for typos

* PEP8 fix
6 years ago
Kevin Breit ca5f9aab1e Meraki module utility - get_net() downloads networks if data isn't provided (#41423)
* Enable get_net() to download nets if data isn't provided

- Currently, get_net() requires data to be passed to it
- PR enables get_net() to download all networks if data isn't passed
- Slightly simpler code
- Best practice is to download nets early in execution

* Apply fixes related to get_net()

* Removed extra code from the rebase
6 years ago
Kevin Breit eeada86554 Add net_id support to config_template (#42446)
- Added net_id support to config_template
- Changed integration test to use blocks to cleanup on failure
6 years ago
Kevin Breit 9036f846a3 meraki - Enabled support for configuration template configuration (#42392)
* Enabled support for configuration template configuration
- get_nets() now pulls down templates and networks
- A few changes in VLAN and network to operate as a POC

* Ansibot changes

- Fix undefined variable
- Document net_id in meraki_vlan

* Fix indentation
6 years ago
Kevin Breit 779f3c0c1a Allow module to claim devices into an organization (#42448)
- Before this, it allowed claiming devices into a network only
- Make integration tests a block
- Note, API doesn't allow unclaiming in an organization, only net
- Added an integration test for claiming into an org
	- Requires unclaiming manually
- There is a bug in the API which isn't showing claimed devices
6 years ago
Kevin Breit 5960b215bb meraki_admin - Added full return documentation for normal responses (#42487)
* Added full return documentation for normal responses

* Changed returned for responses

- Old responses were saying always returned, should have been success
or something more refined
6 years ago
Kevin Breit 0c59a3bc48 meraki_snmp - Added full response documentation for normal responses (#42488)
* Added full response documentation.

* Changed always to success for responses
6 years ago
René Moser d7c3d5501b
cs_vpc: fix disabled or wrong vpc offering taken (#42465) 6 years ago
Pilou 3301a0b530 docker_container: fix init check requirements (#40839)
* docker_container: ensure 'init' is supported

Check docker-py version too.

Move API version check in docker_container module since 'init' module
parameter isn't defined by other docker modules.

docker-py supports 'init' since 2.2.0:
https://github.com/docker/docker-py/blob/2.2.0/docs/change-log.md

* docker_container: fix compat with docker-py<2.2

Exception was:
TypeError: create_host_config() got an unexpected keyword argument 'init'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):
                        File ansible_module_docker_container.py, line 2089, in <module>
                          main()
                        File ansible_module_docker_container.py, line 2084, in main
                          cm = ContainerManager(client)
                        File ansible_module_docker_container.py, line 1704, in __init__
                            self.present(state)
                        File ansible_module_docker_container.py, line 1724, in present
                            new_container = self.container_create(self.parameters.image, self.parameters.create_parameters)
                        File ansible_module_docker_container.py, line 826, in create_parameters
                            host_config=self._host_config(),
                        File ansible_module_docker_container.py, line 932, in _host_config
                            return self.client.create_host_config(**params)
                        File lib/python3.6/site-packages/docker/api/container.py, line 157, in create_host_config
                            return utils.create_host_config(*args, **kwargs)
                      TypeError: create_host_config() got an unexpected keyword argument 'init'",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}
6 years ago
Julien Vey 0f612d1b76 efs_facts: improve performance by reducing the number of api calls (#36520)
* efs_facts: improve performance by reducing the number of api calls

* Remove efs_facts tests from running in CI
6 years ago
René Moser 0e6628395a
cs_firewall: fix idempotence and tests for cloudstack v4.11 (#42458) 6 years ago
Sam Doran 1d1595b990
Fix pause module so it does not stack trace when redirecting stdout. (#42217)
* Use separate variables for stdin and stdout file descriptors

* Do not set stdout to raw mode when output is not a TTY
6 years ago
Jackson Isaac 39ec12f395 junos/junos_config.py: Add RVI Example (#41867) 6 years ago
Jackson Isaac 0cced31795 junos_config: Add VLAN trunking example (#41972) 6 years ago
Jill R 8606fb33f0 Add additional puppet options (#42218)
* Add additional puppet options

Add support for puppet options --debug, --verbose, --summary,
and extend logdest to support logging to stdout and syslog at
the same time.

Fixes issue: #37986

* Fix docs

* Doc fix, add release note

* Fix silly yaml error

* Correct changelog, add C() to params in doc
6 years ago
Jordan Borean 8bdd04c147 Fix remote_tmp when become with non admin user (#42396)
* Fix tmpdir on non root become

 - also avoid exception if tmpdir and remote_tmp are None
 - give 'None' on deescalation so tempfile will fallback to it's default behaviour
   and use system dirs
 - fix issue with bad tempdir (not existing/not createable/not writeable)
   i.e nobody and ~/.ansible/tmp
 - added tests for blockfile case

* Revert "Temporarily revert c119d54"

This reverts commit 5c614a59a6.

* changes based on PR feedback and changelog fragment

* changes based on the review

* Fix tmpdir when makedirs failed so we just use the system tmp

* Let missing remote_tmp fail

If remote_tmp is missing then there's something more basic wrong in the
communication from the controller to the module-side.  It's better to
be alerted in this case than to silently ignore it.

jborean and I have independently checked what happens if the user sets
ansible_remote_tmp to empty string and !!null and both cases work fine.
(null is turned into a default value controller-side.  empty string
triggers the warning because it is probably not a directory that the
become user is able to use).
6 years ago
rcgoodfellow 3a695acf37 Update docker package version (#42394)
The docker API init parameter is the dependency requiring this bump. It was introduced 2.3.0 release of the docker package as per commit 13b5f785a7ab459960aae82fae00e4245e391387 in github.com/docker/docker-py.
6 years ago
nishiokay 7ee86ae370 [cloudstack] fix cs_host example (#42419) 6 years ago
Dag Wieers f98a0b521f
Add querying all bindings (#42366)
Also fix an issue with one of the check-mode tests.
6 years ago
Ganesh Nalawade 5635848654
Fix typo in cliconf pluign (#42399)
* Fix capability key typo error in ios, eos and
  vyos cliconf plugins.
6 years ago
Agris 5df01abd58 Fix for starttls connections for notification mail module (#42381)
* Fixes #42338

Fixes #42338
Fixed starttls connection usage by adding smtp.ehlo before smtp.has_extn function.

* remove Trailing whitespace

remove Trailing whitespace
Fixes #42338

* marged bcoca requested changes

Fixes #42338
move ehlo for starttls section only.

* Remove spaces
6 years ago
Brian Coca 475abc0af7
inventory plugin docs (#42022)
* inventory plugin docs
* added set options
* minor wording and formatting fixes
* changed headers to std as per #35520, also added to main readme
* unified inventory plugin devel, referenced from generic plugin dev
* fixed typos and update as per feedback
6 years ago
Carlos Mendible 133b70ff45 Added missing type for both template and parameters variables. (#42033)
* Added missing type for both template and parameters variables.

* changed object to dict
6 years ago
rcgoodfellow e3478e0da5 Update docker_container.py (#42370)
`docker-py` is no longer a thing.

https://github.com/docker/docker-py/issues/1431
6 years ago
Dag Wieers b90ae65e5c
aci_static_binding_to_epg: Add description parameter (#42244)
* aci_static_binding_to_epg: Add description parameter

This PR adds the description parameter to this module.

Tis fixes #42154

* Fix added_version
6 years ago
Deepak Agrawal 30688fecf3
Idempotency for net_get and net_put modules (#42307)
* Idempotency for net_get and net_put modules

* pep8 warnings fix

* remove import q
6 years ago
Zhikang Zhang de40ac02a5
Make ansible doesn't parse template-like password in user's input (#42275)
NOTE:
1. Use unsafe decorator but not builtin escape wrapper in jinja2
since ansible will try parse ssh password twice, the builtin
escape wrapper will be removed during the first parse.
2. Use class AnsibleUnsafeText but not '!unsafe' syntax since
passwords are not loaded by YAML env, '!unsafe' syntax doesn't
work for them.
6 years ago
Ganesh Nalawade 31dd41e4c5 Fix fetching old style facts in junos_facts module (#42336)
* Fix fetching old style facts in junos_facts module

Fixes #42298
* To fetch old style facts from junos device it requires
  login credentials in provider, hence while using
  connection=nectonf do not delete provider values
  as it might not be ignored

* Add `ofacts` as one of the options in `gather_subset`

* Minor update in documentation

* Fix CI failure
6 years ago
Will Thames 62e7a65459 k8s_facts trivially supports check_mode (#42335) 6 years ago
Jared Hocutt 8b711d9874 Fix examples in azure_rm_securitygroup (#42121) 6 years ago
Ganesh Nalawade 75382814f0
Add fetching default filter in ios cliconf plugin (#42339)
* Add capability to fetch default filter flag in
  ios cliconf plugin.
6 years ago
Nilashish Chakraborty ed5a0f2d9c
nxos_logging new feature - remote logging (#41237)
* Added feature - Remote Logging + More tests

* Fixed Shippable Errors

* Fixes - new feature version added error
6 years ago
Rémi REY da0f58787e callback/grafana_annotations: define validate_grafana_certs type as bool (#42318)
Fixes #42317
6 years ago
Sumit Jaiswal 828dd1a663
To fix the NoneType error raised in ios_l2_interface when Access Mode VLAN is unassigned (#42312)
* to fix the bug41657

* to fix review comment
6 years ago
Juan Manuel Parrilla 376b30ece4 FreeIPA: ipa_vault module to manage idm secure vault resource (#41902) 6 years ago
Alexandre Vicenzi df2e0c7c00 Fix broken links. (#42323) 6 years ago
Julien Brochet 2762c4fe1a Fix error message when using the params option (#42305) 6 years ago
Ganesh Nalawade c068b88b38
Update eos, ios, vyos cliconf plugin (#42300)
* Update eos cliconf plugin methods

*  Refactor eos cliconf plugin
*  Changes in eos module_utils as per cliconf plugin refactor

* Fix unit test and sanity failures

* Fix review comment
6 years ago
Felix Fontein 6b6c017dd1 ACME modules: documentation improvements (#42165)
* Always using current draft when referring to ACME v2.

* Adding URL for ACME v1 protocol.

* Improve cross-referencing of acme_* modules.

* General improvements.

* Fixing syntax error.
6 years ago
Deiwin Sarjas 6412cbf84b aws_eks_cluster: Add wait functionality (#42259)
* aws_eks_cluster: Improve output documentation

This data is already returned by the module, it just wasn't documented. These
fields are required for accessing the created Kubernetes API with e.g. the
k8s_raw module.

* aws_eks_cluster: Add wait functionality

This enables further cluster configuration once it's created and active.

20 minutes was chosen as an arbitrary default, so that if it takes longer than
the documented "usually less than 10 minutes" it's still likely to succeed.

* Correct security group name in aws_eks tests

* Improve teardown of aws_eks tests

Fix minor teardown issues. The `pause` step is a placeholder until
a waiter for `state: absent`
6 years ago
Ganesh B. Nalawade c43beef258 Minor changes 6 years ago
gstaicu 8590465d96 Update pause.py (#42297)
Change spelling from 'contols' to 'controls'
6 years ago
Ganesh B. Nalawade d1ff8e2dca Update ssh_config to accept file path 6 years ago
Trishna Guha df8ad8ebf9
fix regex cliconf nxos (#42288)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Dave Thelen 51092c6ea5 Update eos_l2_interface.py (#42270) 6 years ago
mjmayer b60fc33eef Add execution_role_arn parameter (#41849)
* Add execution_role_arn parameter

* Change ecs_taskdefinition to use AnsibleAWSmodule

Botocore version checking is becomming more common. Changing the ecs_taskdefinition
to use AnsibleAWSmodule allows more easily for this.

* Change launch type check to use botocore_at_least function

* Remove execution_role_arn param from params dict

* Change check to use parameter

* Fix typo

* Add test for old botocore version

* Add test for execution role parameter

* Remove iam_role_facts task

Task was unecessary. The same information could be gathered by registering
the iam_role task.
6 years ago
fxfitz f92b95b8cb Remove ipa_ modules from sanity ignore; fix the docs 6 years ago
cahlchang 92dce2943f [AWS] Add check Iam Role description update (#39773)
* add check description update

* Ensure 'Description' is in the role so KeyError isn't caused

* Fix changed when modifying the description with check mode
6 years ago
Ganesh B. Nalawade 8d8d4b3d86 Add options for jumphost in netconf connetion
Fixes #37262
Fixes #36284

*  Updates options in netconf connection to enable
   bastion/jump host setting using configuration/enviornment
   varaibles.
*  Update troubleshooting docs from using bastion host with netconf
   connection
6 years ago
Manu Pascual 313e7ba55e Fix set the correct key option in the docs (#42251)
In vmware_vmkernel, parameter is subnet_mask instead of netmask
6 years ago
Trishna Guha 805d13f287
nxos CI failures bugfix (#42240)
* fix nxos_portchannel and remove deprecated param in test

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

* fix _nxos_switchport CI failures

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

* fix nxapi nxos_command test

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

* remove unsupported param nxos_smoke test

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

* fix nxos_vxlan_vtep_vni

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

* syntax error

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Trishna Guha 0e05425b32
Refactor nxos cliconf get_device_info and add requirements for JSON structured output support in nxos_facts module (#42089)
* nxos_facts requires JSON structured output support

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

* refactor get_device_info for legacy devices

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

* update additional logic

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Ondra Machacek 0a6ab23f38 ovirt_affinity_lables_facts: Raise error when host/vm not found (#41790) 6 years ago
Ashish Billore faa83285dc Udate ini.py with corrected intended use (#42232)
* Udate ini.py with corrections to intended use

Corrected the intended use for ini reads.

* Update ini.py with corrected intended use info
6 years ago
krisek 55a94784a3 Update aci_vrf.py (#42246)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Kevin Breit 05f7d64a98 Add properties for orgs and nets (#42085)
- Module utility now has orgs, nets, org_id, and net_id properties
- get_nets and get_orgs sets nets and orgs properties respectively
- Allows for storage of this data in the module. org_id and net_id aren’t set as I cannot guarantee that’s always desired.
6 years ago
Kevin Breit 08ddd202fb meraki_config_template - Check for HTTP status code (#42145)
* Check for HTTP status code

- All requests now check returned status code
- Fail if status code isn’t what is expected

* Fix blank line error

* Change HTTP check logic and improve integration tests
- Set HTTP status code check so default path is accept
- Added create and delete network for integration test
- Remove a few comments to clean up code
6 years ago
Kevin Breit 40b9862d38 Meraki modules - Added support for checking HTTP response codes (#42144)
* Added support for checking HTTP response codes
- All request calls now check for response code before responding
- If the response code isn't what it should be, it fails or returns nothing
- Breaking this into multiple PRs to make backporting easier
- Using status property in Meraki module utility which has the code

* Change logic of HTTP checks so success is default
6 years ago
Kevin Breit 3ee3fc893d Change idempotency check to be single pass (#42087)
- Previously all data between both data structures was compared
- Results in situations where updates are done when not needed
- Changes to single pass so only data in payload is compared
6 years ago
Dag Wieers 09fec5a482
aci_interface_policy_ospf: Create OSPF interface policies (#42184)
* aci_interface_policy_ospf: Create OSPF interface policies

New module to create OSPF interface policies

* Fix documentation issues

* Add missing integration tests

* Update documentation and examples
6 years ago
Dag Wieers 57c0471b54
Fix ACI validate-modules issues (#42222) 6 years ago
David Galloway 9539284010 nsupdate.py: Fix typo (#42209)
Signed-off-by: David Galloway <dgallowa@redhat.com>
6 years ago
tstoner db7300904d Enforcing NXAPI default HTTP behavior (#41817)
* nxos_nxapi http default behavior

* Use nxos_nxapi module in prepare_nxos_tests

* Refactor nxos_nxapi configure test to use yaml block

* Extend nxos_nxapi https & http test cases

* Removed NXOS internal release naming

* Resolved ansibot sanity errors

* Fix typo in prepare_nxos_tests

* Address PR comments

* Shippable indicates this is no longer needed

* Add port change logic and testing
6 years ago
Rob b87e1a023d [aws] add support for http2 to AWS ALB (#40372) 6 years ago
Alexander Saprykin 1eea5674ba Fix galaxy client executing queries with invalid http method (#42201)
Fixes: ansible/galaxy#796
6 years ago
jeromecc daaf711e44 clarify module functionality in docstrings: module creates domains and their @ A record only #35669 (#41872) 6 years ago
Abhijeet Kasurde 087fc0c20c Restore BOOLEANS import in basic.py (#42008)
This import was removed by mistake. This is required for backward
compatibility.

Fixes: #41988

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
fluxcess 6290a7c595 added description (#42187)
Added description to one of the really basic code examples

+label: docsite_pr
6 years ago
Trishna Guha 981c9f6a79
fix nxos_vxlan_vtep_vni issue (#42183)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
cclauss 14bc625c2c Catch the raised exception so we can report failure (#42177)
[AWS iam_policy] Avoid the _undefined name_ by catching the raised exception into the variable __e__ so it can be reported on the following line.

flake8 testing of https://github.com/ansible/ansible on Python 3.6.3

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./lib/ansible/modules/cloud/amazon/iam_policy.py:305:16: F821 undefined name 'e'
            if e.errno == 2:
               ^
./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e'
            setMsg(str(e))
                       ^
./lib/ansible/modules/files/archive.py:391:92: F821 undefined name 'e'
                module.fail_json(dest=dest, msg='Error deleting some source files: ' + str(e), files=errors)
                                                                                           ^
3    F821 undefined name 'e'
3
```
6 years ago
Nathaniel Case 5850591d14
Base connection class for network-style connections (#41839)
* Create base class for network-style connections

* clean up some differences

* Move NetworkConnectionBase

* Tweak netconf for tests

* Tweak when network_os is checked to avoid failing tests

* Pull back exec_command
6 years ago