Commit graph

5687 commits

Author SHA1 Message Date
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
2018-07-26 20:07:25 -07:00
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
2018-07-26 23:15:25 +05:30
Matt Clay
72f1a6cc1f Fix bug preventing coverage of setup module. 2018-07-25 19:11:48 -07:00
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
2018-07-25 13:10:40 -07:00
Toshio Kuratomi
5b4a7cc283 Fix journald unittests
d7df072b96 changed how we call
journal.send() from positional arguments to keyword arguments.  So we
need to update the test to check for the arguments it was called with in
the keyword args, not in the positional args.
2018-07-25 11:20:24 -07:00
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
2018-07-25 17:46:55 +05:30
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
2018-07-25 20:55:34 +10:00
Jordan Borean
2c9cbae3f9
Removed deprecated Windows items slated for removed in 2.7 (#43231) 2018-07-25 12:02:49 +10:00
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
2018-07-25 00:22:24 +02:00
Adam Miller
85fedf9fcf
make sure to get correct python version for rpmfluff in setup_rpm_repo (#43228)
* make sure to get correct python version for rpmfluff in setup_rpm_repo

Signed-off-by: Adam Miller <admiller@redhat.com>
2018-07-24 17:17:51 -05:00
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.
2018-07-24 23:21:28 +02:00
Andreas Olsson
611928b658 Fix cloudflare_dns legacy test 2018-07-24 08:01:00 -07:00
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
2018-07-24 09:25:12 -04:00
Brian Coca
cdc762dd9e
don't assume all delegation subkeys exist (#43032)
* don't assume all delegation subkeys exist

fixes #43026

* add tests
2018-07-24 08:54:58 -04:00
Deepak Agrawal
bf544c2200
Add support for commit label in iosxr_config (#42931)
* Add support for commit label in iosxr_config

* sanity pep8 etc fixes
2018-07-24 17:16:26 +05:30
Matt Clay
4e489d1be8
Update Shippable integration test groups. (#43118)
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
2018-07-23 20:46:22 -07:00
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
2018-07-24 08:16:42 +10:00
Jordan Borean
48ad90ac8e
powershell: support recursive requires statements (#43143) 2018-07-24 08:16:16 +10:00
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
2018-07-24 07:52:13 +10:00
Matt Clay
547f11ad8f Fix win_reboot test and mark win_uri unstable. 2018-07-23 13:32:49 -07:00
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>
2018-07-23 10:56:09 -04:00
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
2018-07-23 11:49:30 +08:00
Jordan Borean
64f5f9c2f9
win_acl: fix recent bug and add basic tests (#43054) 2018-07-23 05:16:42 +10:00
Jordan Borean
35f6bbf18b
win_wait_for: add a bit more stability to the tests (#43114) 2018-07-23 05:16:22 +10:00
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>
2018-07-21 08:58:39 +05:30
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"
  }
]
```
2018-07-20 20:32:32 +02:00
Andrey Laguta
2e62e36590 Fix multiple var files combining (followup to #36357) 2018-07-20 09:29:20 -04:00
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>
2018-07-20 10:34:26 +05:30
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
2018-07-20 10:04:53 +05:30
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
2018-07-19 10:45:45 -07:00
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
2018-07-19 10:28:52 -04:00
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.
2018-07-19 10:07:00 -04:00
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
2018-07-19 08:27:13 -04:00
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
2018-07-19 11:32:26 +02:00
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
2018-07-19 11:30:38 +02:00
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
  }
]
```
2018-07-19 11:02:25 +02:00
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",
  }
]
```
2018-07-19 10:13:24 +02:00
Adam Harwell
a9b1af8bdd Yum: Add support for --downloadonly (#41506) 2018-07-18 23:34:54 -04:00
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"
  }
]
```
2018-07-18 21:49:02 +02:00
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
2018-07-18 15:37:50 -04:00
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>
2018-07-18 12:20:21 -04:00
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
2018-07-18 12:17:08 -04:00
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
  }
]
```
2018-07-18 12:39:55 +02:00
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
  }
]
```
2018-07-18 11:32:04 +02:00
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": ""
     }
  ]
```
2018-07-18 10:42:20 +02:00
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"
  }
]
```
2018-07-18 09:53:58 +02:00
Jordan Borean
8447f25e10
win_chocolatey_config: added module to manage Chocolatey config (#42915) 2018-07-18 10:36:59 +10:00
Jordan Borean
7ae5912d91
win_chocolatey_feature: new module (#42848)
* win_chocolatey_feature: new module

* Fixed up copyright header in PowerShell file
2018-07-18 10:36:43 +10:00
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
2018-07-18 10:36:21 +10:00
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
2018-07-17 14:29:05 -07:00
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.
2018-07-17 11:37:23 -07:00
Dag Wieers
e899824c49
ACI: Add parameter types to module docs (#42893)
* ACI: Add parameter types to module docs

* Update validate-modules ignore list
2018-07-17 18:03:55 +02:00
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
2018-07-16 13:26:06 -04:00
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
2018-07-16 11:34:01 +10:00
Dag Wieers
2ad234f98e
aci_ap: Ensure AP is removed before tests start (#42744) 2018-07-15 23:03:39 +02:00
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
2018-07-15 09:59:30 -05:00
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
2018-07-13 15:09:33 -04:00
Sloane Hertel
1fdd84b88c Rename AWS unit tests that are not running when changing the module (#42712)
now can use `ansible-test units module_name` for the aws_s3 and aws_api_gateway modules

changes to modules/cloud/amazon/aws_api_gateway and modules/cloud/amazon/aws_s3 are not triggering the unit tests; also fix aws_s3 from importing non-exist module and skipping tests

changes to module_utils/aws/core.py are only being unit tested on modules that import from the file (if they have a corresponding test) or tests that import from the file themselves.
2018-07-13 10:56:57 -04:00
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
2018-07-13 14:08:14 +10:00
Ryan Brown
45f5964fed Fix patching of wrong boto3_conn in API Gateway tests (#42700) 2018-07-12 13:06:31 -04:00
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
2018-07-12 20:27:10 +05:30
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
2018-07-12 16:47:17 +02:00
Kevin Breit
9105149595 Cange URL for organization device lookup (#42648) 2018-07-12 16:41:16 +02:00
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.
2018-07-12 08:43:23 -05:00
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
2018-07-12 23:16:41 +10:00
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
2018-07-12 12:26:14 +05:30
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
2018-07-12 09:53:03 +05:30
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
2018-07-11 23:55:28 +05:30
Sumit Jaiswal
8b61dd6efc
Updating the nios_test_container version to 1.1.0 from 1.0.0 (#42526)
* updating the nios_test_container version

* changing the version
2018-07-11 23:34:30 +05:30
Fran Fitzpatrick
5928ec04ca Adds an ipmath filter (#41985) 2018-07-11 10:52:31 -07:00
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.
2018-07-11 16:32:03 +10:00
hitsumabushi
cf7a42b4f4 allow empty line in src template file (#42493) 2018-07-11 11:29:07 +05:30
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
2018-07-11 09:12:29 +10:00
Matt Clay
11d0eb04ce Temporarily switch RHEL and Windows tests to AWS. 2018-07-10 15:15:01 -07:00
Matt Clay
8e26a58443 Revert "Temporarily switch RHEL and Windows tests to AWS."
This reverts commit c3134ce6e2.
2018-07-10 10:47:25 -07:00
Matt Clay
2fbc2abf86 Fix openshift integration test requirements. 2018-07-10 10:07:19 -07:00
Fabian von Feilitzsch
c0c8766903 Ensure openshift dependency is also installed on test runner (#42582) 2018-07-10 09:54:31 -05:00
Deepak Agrawal
8157fa0b01
run ovs tests on centos/rhel (#42556) 2018-07-10 19:25:09 +05:30
Nathaniel Case
381263ad99
ios test cleanup pt 2 (#42570)
* Remove local from ios_config to avoid needing to add provider

* ios_smoke should test all with local to pick up the slack
2018-07-10 09:03:04 -04:00
Yuwei Zhou
e9bf3c70e6 disk fact should return create_option value (#42398) 2018-07-10 16:16:28 +08:00
Yanis Guenane
593f484d77 Fix E324 for vultr modules. (#42464) 2018-07-10 07:51:05 +02:00
Matt Clay
528de5b82f Remove unwanted containers at CI job start. 2018-07-09 21:48:11 -07:00
Matt Martz
50905b980d Support item label in v2_playbook_on_include (#42478)
* Support item label in v2_playbook_on_include. Fixes #42301

* test fixes
2018-07-09 11:27:00 -04:00
Nathaniel Case
399d13d593
Update ios tests (#42509)
* 192.168.0.1/24 conflicts with management IP

* Images don't have the hostnames we expect
2018-07-09 10:12:48 -04:00
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
2018-07-09 09:50:06 -04:00
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
2018-07-09 19:12:41 +05:30
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
2018-07-09 08:33:16 -05:00
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
2018-07-09 09:15:31 -04:00
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
2018-07-09 11:21:34 +02:00
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
2018-07-09 11:18:12 +02:00
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
2018-07-09 11:17:14 +02:00
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
2018-07-09 11:16:30 +02:00
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
2018-07-09 11:11:16 +02:00
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
2018-07-09 11:10:27 +02:00
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
2018-07-09 11:08:37 +02:00
René Moser
d7c3d5501b
cs_vpc: fix disabled or wrong vpc offering taken (#42465) 2018-07-09 08:31:13 +02:00
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
2018-07-08 16:34:22 -04:00
René Moser
0e6628395a
cs_firewall: fix idempotence and tests for cloudstack v4.11 (#42458) 2018-07-08 00:51:46 +02:00
René Moser
8a3d29cf6d
cloudstack: tests: use expected vpc offering (#42462) 2018-07-07 20:25:24 +02:00
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
2018-07-06 17:19:55 -04:00
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).
2018-07-06 10:49:19 -07:00
Dag Wieers
f98a0b521f
Add querying all bindings (#42366)
Also fix an issue with one of the check-mode tests.
2018-07-06 13:32:39 +02:00
Ganesh Nalawade
f4d21bd542
Fix junos integration test CI failures (#42369)
*  reset_connection task is not required as the persistent
   connection to remote host is closed at end of playbook
   run
2018-07-06 08:54:57 +05:30
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
2018-07-05 18:01:28 +02:00
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
2018-07-05 20:15:25 +05:30
John R Barker
d962611528 Allow documentation of module options type (#42285)
* Allow documentation of module options

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

* docs
2018-07-05 09:57:58 -04:00
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
2018-07-05 12:17:14 +05:30
Kevin Breit
c3c86a0248 Small fixes for bad variable names (#42287) 2018-07-04 15:27:42 -07:00
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
2018-07-04 19:45:21 +05:30
hlrichardson
2aa81bf05d add tests for exos_command module (#42268) 2018-07-04 19:42:51 +05:30
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`
2018-07-04 22:30:57 +10:00
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.
2018-07-04 14:34:11 +10:00
fxfitz
f92b95b8cb Remove ipa_ modules from sanity ignore; fix the docs 2018-07-03 18:16:09 -07:00
Dag Wieers
459cdef993
Fix integration tests aliases (#42245) 2018-07-03 23:41:58 +02:00
Deepak Agrawal
febf88c81b
test file required for ios_files tests (#42248) 2018-07-03 19:54:05 +05:30
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>
2018-07-03 19:45:19 +05:30
Kevin Breit
f9cbdcd426 Meraki - Integration tests now clean up on failure (#42227)
* Added block and always support to meraki_network integration test

* Add blocks to admin and vlan integration test

* Resolved bad variable names
2018-07-03 10:42:04 +02:00
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
2018-07-03 04:26:56 +02:00
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
2018-07-03 04:04:48 +02:00
Dag Wieers
57c0471b54
Fix ACI validate-modules issues (#42222) 2018-07-03 04:04:35 +02:00
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
2018-07-02 14:58:37 -04:00
Nathaniel Case
a197125954
Nxos restore provider to nxapi tests (#41818)
* Quick and dirty sed to add provider

* Manually verify the rest of the cases

* Add missing provider
2018-07-02 09:43:51 -04:00
Ganesh Nalawade
1659951710
Fix eos integration test failure (#42188)
* Fix error message in eos_config integration test
* Fix set_become invoke login in httpapi connection plugin
2018-07-02 18:49:45 +05:30
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
2018-07-02 08:41:00 -04:00
Kevin Breit
380d08af5d Fix integration tests (#42088)
- Integration test assertions had some invalid variables
2018-07-02 10:47:57 +02:00
Sam Doran
fb55038d75 Add warning when using an empty regexp in lineinfile (#42013)
* Revert "Account for empty string regexp in lineinfile (#41451)"

This reverts commit 4b5b4a760c.

* Use context managers for interacting with files

* Store line and regexp parameters in a variable

* Add warning when regexp is an empty string

* Remove '=' from error messages

* Update warning message and add changelog

* Add tests

* Improve warning message

Offer an equivalent regexp that won't trigger the warning.
Update tests to match new warning.

* Add porting guide entry for lineinfile change
2018-06-29 17:15:43 -07:00
Matt Clay
c3134ce6e2 Temporarily switch RHEL and Windows tests to AWS. 2018-06-29 16:23:54 -07:00
John R Barker
e9dbebfa57
Fix some broken links (#42079)
* Fix some broken links

* We now only serve via https
* redirects don't work with anchors, so update those links (devel/dev_guide)
2018-06-29 11:12:01 -07:00
John R Barker
6024a766e9
Allow removed_in 2.11 (#42119) 2018-06-29 09:42:54 -07:00
David Soper
5f5fbffe8a UCS Server UUID pool modules and integration tests (#41743)
* UCS Server UUID pool modules and integration tests

* change version added to 2.7

* Doc and result changed updates from review.
2018-06-29 15:49:47 +02:00
David Soper
f8f22f77ed Fix issue with vNIC redundancy templates (#36608)
* Fix bug with redundancy templates and add integration tests for redundancy templates.

* vlan_list absent state support and fix for vlans as strings in vlan_list
2018-06-29 15:48:48 +02:00
John McDonough
bf932a852b Module for UCSM Manager Timezone Management (#36974)
* Module for UCSM Manager Timezone Management

* Module for UCSM Manager Timezone Management

* Module for UCSM Manager Timezone Management

* Addressed PR comments and added integration tests

* fixed mismatched default value between doc and argument_spec

* changed main() to call run_module()

* Change version to 2.7

* updated integration aliases indicating unsupported testing

* updates to DOCUMENTATION
2018-06-29 15:43:52 +02:00
Ganesh Nalawade
e41d427d1b
Add run_commands api for ios and vyos cliconf plugin (#42093)
* Add run_commands api for ios and vyos cliconf plugin

*  Add run_commands api to ios and vyos cliconf plugin
*  Refactor ios and vyos module_utils to check return code
   in run_commands

* Fix Ci failures
2018-06-29 15:07:38 +05:30
saichint
bd9b8b422d fix nxos_gir issues (#41809)
* fix nxos_gir issues

* review comments
2018-06-28 10:11:45 +05:30
Yanis Guenane
42c2fd72ae Fix test_create_jks_success failing on SELinux machine (#42001)
Currently TestCreateJavaKeystore::test_create_jks_success is failing on
a machine with SELinux because set_context_if_different is not mocked
and hence tries to access a file that doesn't exist because it has been
mocked previously.

Also, changing path to a path that won't exist for sure.
2018-06-27 11:43:31 -04:00
Eitan Akman
fb7882bf86 Issue #39860: Add 'not_contains' method to parsing.py (#39874)
* Issue #39860: Add 'not_contains' method to parsing.py

* Issue #30860 Adds self.negate to Conditional class in lib/ansible/module_utils/network/common/parsing.py

* Issue #39860 Fix singleton-comparison issue per sanity tests

* Issue #39860 'test/integration/targets/nxos_command/tests/cli/not_comparison_operator.yaml' integration test

* Issue #39860 Add unit tests to '../../test/units/module_utils/network/common/test_parsing.py'

* Issue #39860 Fix singleton comparison issue

* Fix E302 expected 2 blank lines, found 1

* Issue #39860 Add license header to unit tests

* Issue #39860 Move integration test to 'test/integration/targets/nxos_command/tests/common/'; remove unnecessary comment from unit test

* Issue #39860 remove unnecessary comment from unit test
2018-06-27 10:21:17 +05:30
Andrew Saraceni
bcb49f2575 Refactor/fix win_group_membership to use SIDs for internal comparisons (#40725)
* refactor win_group_membership to use SIDs for comparisons instead of name parsing

* carry over previous doc cleanup changes

* remove trailing whitespace from docs
2018-06-27 10:54:27 +10:00
Jordan Borean
cc97e89620
Revert "win_security_policy: allow removing values (resolves #40869) (#41125)" (#41986)
This reverts commit f2bd6b6bfd.
2018-06-27 09:37:37 +10:00
jamessemai
f2bd6b6bfd win_security_policy: allow removing values (resolves #40869) (#41125)
* win_security_policy: allow removing values (resolves #40869)

* Removing warning

* Adding test for remove policy setting

* Fixing string comparison
2018-06-27 09:13:31 +10:00
Matt Martz
1401fa74cc
Cache items when task.loop/with_items is evaluated to set delegate_to vars (#41969)
* If we evaluate task.loop/with_items when calculating delegate_to vars, cache the items. Fixes #28231

* Add comments about caching loop items

* Add test for delegate_to+loop+random

* Be more careful about where we update task.loop
2018-06-26 15:10:04 -05:00
Troy Murray
15ce7c5bab change OS X to macOS (#41294)
* change OS X to macOS

<!--- Your description here -->

+label: docsite_pr

* Update all Mac OS X references to be macOS

* Drop extra Mac
2018-06-26 14:09:23 -04:00
Matthew Stone
c5c3900c52 Adding slxos_lldp module (#39259)
* Adding slxos_lldp module
2018-06-26 09:27:52 -07:00
Kevin Breit
7ab3f755ce Fixes idempotency check for partial configurations (#41941)
- Previous PR would overwrite new and existing values improperly
2018-06-26 12:14:01 +02:00
Pierre-Louis Bonicoli
358c759bd9 test: manual tower projects don't require creds 2018-06-26 11:24:34 +02:00
Jordan Borean
2af36412f9
runas + async - get working on older hosts (#41772)
* runas + async - get working on older hosts

* fixed up sanity issues

* Moved first task to end of test for CI race issues

* Minor change to async test to be more stable, change to runas become to not touch the disk

* moved async test back to normal spot
2018-06-26 14:40:49 +10:00
Sam Doran
4b5b4a760c
Account for empty string regexp in lineinfile (#41451)
* Use context managers for interacting with files

* Account for empty string as regexp

Rather than explicitly testing for None, also test for an empty string which will evaluate to False. An empty string regexp matches every line, which ends up replacing the incorrect line.

* Store line parameter in a variable

* Add tests
2018-06-25 17:57:05 -04:00
Sam Doran
eaae1318f8
Skip if insertbefore BOF until later (#41767)
If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF.

Add tests for this scenario.
2018-06-25 16:24:41 -04:00
Jordan Borean
9b7b564d75
Stop displaying kinit pass input on a failure (#41882)
* Stop displaying kinit pass input on a failure

* Fixed up minor logic info and added tests
2018-06-26 05:49:19 +10:00
Martin Krizek
a8d4bf8642
Fix rabbitmq_* integration tests (#41836) 2018-06-25 21:29:45 +02:00
Dennis Benkert
28d0a173db [aws] add limit on number of CloudFormation stack events fetched by cloudformation module (#41840)
* Add a module parameter to configure the max fetched AWS CFN stack events
* Add version documentation for new configuration option
* Increase default in order to make sure that enough are fetched by default. This align roughly with the limit of manageable resources in CloudFormation.
2018-06-25 12:39:32 -04:00
Ganesh Nalawade
773c031d33
vyos and ios cliconf plugin refactor (#41846)
* vyos and ios cliconf plugin refactor

*  Refactor vyos cliconf plugin
*  Change vyos module_utils and vyos_config as per refactor
*  Minor changes in ios cliconf plugin

* Fix unit test failure

* Fix sanity issues

* Add get_diff to rpc list
2018-06-25 09:43:37 +05:30
Jordan Borean
2e46688bca
win_chocolatey: always return the rc return value (#41883) 2018-06-25 08:23:31 +10:00
David Passante
f30e0b833d cloudstack: new module cs_disk_offering (#41795) 2018-06-23 01:15:26 +02:00
Nathaniel Case
9aa8c652ba
Netconf bytes fixes (#41607)
* Solve some bytes issues on iosxr

* Solve some bytes issues in junos

* Do the correct thing with tostring based on lxml or not
2018-06-22 11:50:44 -04:00
Sijis Aviles
ba3db90e3a Fix: wildcard excludes in unarchive with tar archives (#40935)
* fix: exclude using wildcards for tar archives

Fixes #37842, #22947

* fix: Remove quote() as it munges the exclude format

* test: Refactor to use single archive structure

A common structure archived by different methods should simplify some of
the feature tests.

* test: Use common archive layout to validate exclude feature

* test: Use the same exclude checks for zip/tar archives
2018-06-22 08:28:14 -07:00
Olivier Bourdon
06b73ff8f1 Add random_mac string filter (#39775)
Add new filter to generate random MAC addresses from
string prefix. See docs/docsite/rst/user_guide/playbooks_filters.rst
for more detailed infos.
2018-06-21 15:56:54 -05:00
Matt Clay
5880404151 Disable remaining failing rabbitmq_* tests. 2018-06-21 13:50:36 -07:00
Brian Coca
27c43daab8
fix minor issues with debug and item labels (#41331)
* fix minor issues with debug and item labels

 - no more `item=None`, we always have a label now
 - debug should only show expected information, either msg= or the var in var=
 - also fixed method name, deprecated misleading _get_item
2018-06-21 16:14:57 -04:00
Matt Clay
00ab12dca2 Disable failing rabbitmq_plugin test. 2018-06-21 12:52:06 -07:00
Andrea Tartaglia
a342538aba Add shell out checks (#41545)
* Added error codes for shell_out checks

* Added ignore lines for allowed Modules

* Added shell out checks

* Fixed pep8

* Updated regex to only match subprocess.Popen

* Added failing modules to ignore.txt

* Wrong postgresql module in ignore.txt

* Removed bigip from ignore.txt
2018-06-21 11:58:39 -04:00
Loïc
b61b113fb9 new provider: ownca (#35840) 2018-06-21 12:41:00 +05:30
Sloane Hertel
c4a6bce69f ecs_service: make assign_public_ip option a boolean (#41759) 2018-06-21 12:17:01 +10:00
Jordan Borean
11bd3fd318 win_updates fix when win_updates is run with async (#41756) 2018-06-20 14:52:24 -07:00
Abhijeet Kasurde
27b85e732d Argument spec must be dict/hash (#40858)
validate-modules should fail when argument is not dict/hash.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-06-20 12:05:49 -04:00
Deepak Agrawal
e91cee1a31
net_put module: add default mode to copy binary files (#41476)
* add default mode to copy binary files

* sanity fix

* add version for new options
2018-06-20 16:02:49 +05:30
Kevin Breit
543a7469b7 New module - meraki_switchport (#41634)
* Initial commit for meraki_switchport module
- Query or modify swichport configurations
- Further optimizations are available
- Integration tests will require manual editing of file for others

* Remove blank lines
2018-06-20 09:48:30 +02:00
Kevin Breit
b8c39a0875 New module - meraki_config_template (#41633)
* Implement configuration template management
- Queries or removes templates
- Can bind or unbind templates to networks
- Module is idempotent only for binding and unbinding
- Meraki does not allow template creation via API
- Integration test is tedious b/c previous bullet point
- Fixed bug in construct_path() so it won't set self.function

* PEP8 changes

* Re-enable some integration tests, use variables, and fix broken code
2018-06-20 09:47:31 +02:00
Kevin Breit
618c3c508f New module - meraki_vlan (#41632)
* Initial commit of meraki_vlan module
- Create, delete, modify, and query VLANs within a network
- Support for all allowed objects in the VLAN data structure
- Meraki defaults networks to have VLANs disabled and there is no
way to use the API to enable VLAN support. It must be enabled
manually.

* Fix formatting error in documentation

* Formatting changes and added documentation

* PEP8 fix
2018-06-20 09:46:15 +02:00
Kevin Breit
7c888b86ba New module - meraki_device (#41631)
* Initial commit for meraki_device module
- Allow claiming, removal, updating, and querying of devices
- Integration tests are included
- Integration tests are not complete because physical gear is required
- Integration tests also require Meraki subscriptions

* Added support for serial number query without network

* Added support for net_id and net_name

* Changes recommended by ansible-test for PEP8 and documentation

* Remove duplicate state in example

* Fix typo
2018-06-20 09:44:50 +02:00
Kevin Breit
564fe87b29 Improve support for org_id in module (#41519)
- Faster performance since it reduces number of API calls
- Also simplified some of the execution
2018-06-20 09:41:53 +02:00
Kevin Breit
cccaf951fa Improved support for parameter testing and checks for org_id (#41517) 2018-06-20 09:40:10 +02:00
Kevin Breit
4a0b8f5123 Added support for passing org_id instead of org_name (#41518)
- Faster execution if passed instead of org_name
- Updated documentation
- Added additional integration tests
2018-06-20 09:39:25 +02:00
Matt Clay
dce708e63e Temporarily disable gem test on osx.
Disabled due to lack of newer TLS version support on the test system.
2018-06-19 16:58:12 -07:00
Sloane Hertel
1268ce4d4f [ecs_service] fix assign_public_ip network configuration to module parameter rather than fixed string (#41689)
Fix parameter name

Use suboptions

document suboptions

Add a test to assert assign_public_ip is configurable
2018-06-19 14:35:53 -04:00
Nilashish Chakraborty
837c216587
Fix vyos_vlan aggregate issue & added tests (#41638)
* Fix vyos_vlan aggregate issue & Added tests

* Fix #2 for vyos_vlan aggregate issue
2018-06-19 18:50:28 +05:30
Deepakkothandan
5a72eef0a3 [ecs_service] fix assign_public ip for network configuration (#41685)
* fix assign_public ip for ecs_service

* used module.botocore_at_least instead of distutils
2018-06-19 08:46:40 -04:00
Tim Rupp
6c654b6947
Fixes the default assignment of values (#41672)
Fixes: #41640

The defaults should be inherited from the parent during initial
creation. This patch fixes that.
2018-06-18 16:06:13 -07:00
Markos Chandras
1737b7be3e facts: suse: Fix major version detection for SUSE (#41416)
When parsing the distribution files such as /etc/os-release, we extract
the full distribution version but not the major version. As such, the
ansible_distribution_major_version ends up being 'NA' whereas the
ansible_distribution_version contains the full version.

Before this patch we get this on openSUSE Leap 15

ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "NA"}, "changed": false}

After this patch we get this

ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "15"}, "changed": false}

This also fixes the Tumbleweed distribution test to report a proper
major version and also adds a test for openSUSE Leap 15.0 to avoid
potential future regressions.

Fixes: #41410
2018-06-18 09:53:50 -04:00
Tim Rupp
16466f3171
Fixes usage of popen in bigip iapplx package (#41612)
This functionality is superceeded by the run_command method in the
ansible module class.
2018-06-15 15:41:57 -07:00
Matt Davis
b01779ad18
skip winrm unit tests if winrm is not installed (#41596) 2018-06-15 10:23:15 -07:00
Sharp Hall
3935cce394 docker: Allow publishing of ports with the same number but different protocol (#38412)
* Don't deduplicate docker container ports with different protocols

* Test _parse_exposed_ports
2018-06-15 12:36:20 -04:00
Andreas Calminder
75e9b76c15 accept + and - modifiers for file attributes (#40061)
* accept + and - modifiers for file attributes
* tests for adding/removing file attributes
2018-06-14 06:31:14 -07:00
Trishna Guha
8ab0d654f3
don't retrieve config in running_config when config is provided for diff (#41400)
* don't retrieve config in running_config when config is provided for diff

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

* fix for eos, nxos

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

* add integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-06-14 18:02:19 +05:30
saichint
79dd206b3e fix reload smu issue (#41270)
* fix reload smu issue

* review comments
2018-06-14 09:17:33 +05:30
Ben Berry
32c191ee9c expand user before calling abspath (#40196)
* expand user before calling abspath

* omit expanduser code smell check for volumes
2018-06-13 21:18:02 -04:00
Zim Kalinowski
5b0bb91c72 reappied changes in a new pr (#41228) 2018-06-13 15:42:29 +08:00
Matt Clay
d6ba139713 Disable failing acme_account integration test. 2018-06-12 18:06:47 -07:00
Toshio Kuratomi
a5fd86cf6d Tasks that are expected to fail need to begin with a special string 2018-06-12 16:31:10 -07:00
Brian Coca
336b3762b2 no_log even when task_result doesn't provide key
- now also checks task property
 - added reproducer to tests for unreachable status on item loop
2018-06-12 10:25:30 -07:00
Matt Martz
ad0827e5c0
When using ANSIBLE_JINJA2_NATIVE bypass our None filtering in _finalze (#41408)
* When using ANSIBLE_JINJA2_NATIVE bypass our None filtering in _finalize. Fixes #41392

* Add tests for _finalize bypass

* Address python3 failures in tests
2018-06-12 08:46:23 -05:00
Zim Kalinowski
e9214725fb more integration test improvements (#41184) 2018-06-12 10:52:07 +08:00
Pilou
5d7afe9d95 Default squash actions add pip (#41390)
* pip tests: remove trailing spaces

* pip tests: use Jinja tests

* fixup! pip tests: remove trailing spaces

* pip tests: use 'command' instead of 'shell' module

* pip tests: remove unused variable

* pip tests: use a package with fewer dependencies

sampleproject has one dependency: 'peppercorn' and peppercorn doesn't
have any dependency.

* pip tests: check that 'name' param handles list

* pip: squash package parameters

Note that squashing will be removed in 2.11, new code should directly
use a list with the 'name' parameter.
2018-06-11 19:58:13 -04:00
Adam Miller
bea3baf94d
Revert "Revert "Remove VC scaleway (#40791)" (#41401)" (#41402)
This reverts commit 391509006c.
2018-06-11 11:22:12 -05:00
Adam Miller
391509006c
Revert "Remove VC scaleway (#40791)" (#41401)
This reverts commit 007127ea27.
2018-06-11 11:19:29 -05:00
Rémy Léone
007127ea27 Remove VC scaleway (#40791) 2018-06-11 11:19:08 -05:00
Shinichi TAMURA
bcd6b5c6f8 BSDTimezone: distinguish UTC and Etc/UTC (#41234)
* Fixed BSDTimezone to distinguish UTC and Etc/UTC

* Added test for timezone to disinguish UTC vs Etc/UTC
2018-06-11 10:27:50 -04:00
Abhijeet Kasurde
c021fd8e84 VMware: Allow user to select disk_mode (#38951)
* VMware: Allow user to select disk_mode

This fix allows user to select disk modes for given disk configuration
in the given VM.

Fixes: #37749

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-06-10 22:37:30 -04:00
Matt Martz
76867730bf
Don't ignore a duplicate host for an already processed include (#40361)
* Don't ignore a duplicate host for an already processed include, assume that the repetition indicates a new include. Fixes #40317

* Add intg tests to ensure duplicate items in loop are not deduped

* Add note about relative indexing
2018-06-08 15:36:22 -05:00
Thierry BOUVET
8b9fe42c72 Add new module to create/update a docker swarm. (#38280)
* Add new module to create/update a docker swarm.

* Fix ansible-test sanity

* Fix requirements

* Fix requirements

* Add tag for author

* Test integration test.

* Fix main.yml

* Add linux arch

* Add template

* Fix test result

* Integration test to create/remove a swarm manager

* fix join test

* Downgrade docker-py

* fix rhel

* Fix review documentation.

* Fix whitespace

* Check docker installation.

* test docker install

* check

* Remove docker socket

* Fix docker install

* Fix sanity test

* Rebase

* Add docker_swarm maintainer

* Fix review

* Fix new version.

* Add docker default values

* Fix description.

* Reworked documentation

* Fix YAML error

* Rebase

* Fix example for update state.

* Fix idempotent states. Fix states: present/absent.

* Fix sanity

* Fix variables sanity

* Update example for absent state.

* fix sanity

* Wrap the contents of error message in to_native.


Co-authored by: Dag Wieers <dag@wieers.com>
2018-06-08 10:45:09 -04:00
Ganesh Nalawade
1ce484831b
Fix junos_config integration test (#41304)
*  Change the ip address in fixture files
   as per PR #40554
2018-06-08 13:16:47 +05:30
Sloane Hertel
89cea78e30 Fix async for aws_s3 - fixes #40281 (#40826)
* Fix async for aws_s3

* Add a test that async is able to be used on aws_s3 tasks
2018-06-07 15:09:22 -04:00
Will Thames
46886f8249 Improve aws_s3 permission handling for non S3 (#38574)
* Test case for missing permissions

* Update aws_s3 module to latest standards

* Use AnsibleAWSModule
* Handle BotoCoreErrors properly
* Test for BotoCoreErrors
* Check for XNotImplemented exceptions (#38569)

* Don't prematurely fail if user does not have s3:GetObject permission

* Allow S3 drop-ins to ignore put_object_acl and put_bucket_acl
2018-06-07 13:13:10 -04:00
Andrew Gaffney
0ff04ad41b Fix wrong python keyword (followup to #36357) (#41067)
Also add tests around that code path
2018-06-07 19:48:07 +05:30
Matt Martz
c403f01971
Revert #39365, improve error messaging (#41208)
* Revert " Update TaskInclude _raw_params with the expanded/templated path to file (#39365)"

This reverts commit 4b01b92cfe.

* Improve error messaging, catch error templating parent path
2018-06-07 09:00:50 -05:00
Will Thames
b235cb8734 aws_eks_cluster: New module for managing AWS EKS (#41183)
* aws_eks: New module for managing AWS EKS

aws_eks module is used for creating and removing EKS clusters.

Includes full test suite and updates to IAM policies to enable it.

* Clean up all security groups

* appease shippable

* Rename aws_eks module to aws_eks_cluster
2018-06-07 08:44:04 -04:00
Deepak Agrawal
12be102758
DCI failures (#41241) 2018-06-07 15:55:03 +05:30
Trishna Guha
34e4071eca
increase timeout for connection reset by peer issue with httpapi (#41224)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-06-07 12:46:51 +05:30
Zim Kalinowski
bc690df11e using lighter resource (#41223) 2018-06-07 14:11:00 +08:00
Jordan Borean
ad8e13e9f8
winrm: fix up unit tests (#41112) 2018-06-07 06:09:10 +08:00
Kevin Breit
2be2a572d6 Meraki utility now loads() JSON (#40856)
* Changed request() to run json.loads() instead of module doing it
- Removed json.loads() from modules
- Removed some unreliable integration tests
- Removed self.function setting in construct_path()
-

* PEP8 changes

* Remove debug line for push
2018-06-06 18:24:14 +02:00
Deric Crago
ba848e018c bump version of 'vcenter-test-container' to '1.3.0' (govmomi v0.18.0) (#41151)
* leave vmware_guest_powerstate tests enabled, but revert changes from: 66743f33
* leave VM poweroff tests enabled, but revert changes from: 87d6bdaf
* bumped 'vcenter-test-container' version to '1.3.0'
* updated test task names based on PR feedback
2018-06-06 08:24:21 -07:00
Will Thames
f61164406e [aws] Support custom KMS keys in aws_s3 module (#35761)
* Allow the use of 'aws:kms' as an encryption method
* Allow the use of a non standard KMS key
* Deduce whether AWS Signature Version 4 is required rather than specifying with a parameter
2018-06-06 11:22:52 -04:00
Will Thames
a60fe1946c Remove ECS policies from AWS compute policy
The compute policy was exceeding maximum size and contained
policies that already exist in ecs-policy.

Look up suitable AMIs rather than hardcode

We don't want to maintain multiple image IDs for multiple regions
so use ec2_ami_facts to set a suitable image ID

Improve exception handling
2018-06-06 20:51:50 +10:00
Michael Mayer
fbcd6f8a65 Add Fargate support for ECS modules
Fargate instances do not require memory and cpu descriptors. EC2 instances
 do require descriptions. https://botocore.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.describe_task_definition

Fargate requires that cpu and memory be defined at task definition level.
EC2 launch requires them to be defined at the container level.

Fargate requires the use of awsvpc for the networking_mode. Also updated,
the documentation regarding where and when memory/cpu needs to the assigned.

The task_definition variable for the awspvc configuration colided with
the ecs_service for the bridge network. This would cause the test to fail.

Add testing for fargate

Add examples for fargate and ec2
2018-06-06 20:51:50 +10:00
Martin Krizek
77e2bd5f8e
Fix inserting noop tasks by using active state (#36056) 2018-06-06 12:34:25 +02:00
David Moreau Simard
828e33f419 Do not consider an empty version string as a version (#41044)
When using an empty string as the version argument, the module would
before attempt to run something akin to:

    pip install module==""

This changes the behavior to:

    pip install module

Fixes #41043
2018-06-06 09:52:43 +02:00
Ganesh Nalawade
ba4b12358c
Refactor ios cliconf plugin and ios_config module (#39695)
* Refactor ios cliconf plugin and ios_config module

*  Refactor ios cliconf plugin to support generic network_config module
*  Refactor ios_config module to work with cliconf api's
*  Enable command and response logging in cliconf pulgin
*  cliconf api documentation

* Fix unit test and other minor changes

* Doc update

* Fix CI failure

* Add default flag related changes

* Minor changes

* redact input command logging by default
2018-06-06 11:12:45 +05:30
saichint
9abc3dbec4 nxos_rpm module (#40849)
* Add nxos_rpm feature

* fix timing issues

* fix timing issues

* shippable fix

* review comment

* review comments fixes

* typo fix
2018-06-06 10:09:38 +05:30
Matt Clay
70c475da6c Implement new changelog generator. 2018-06-05 19:08:15 -07:00
Matt Davis
980cdbe679 pin azure deps to exact versions
* added warnings for newer-than-expected versions
* prevent passing api_version and profile for newer clients
2018-06-05 18:50:48 -07:00
Nathaniel Case
02135d5278
Nxos test reorganize (#41089)
* Remove local from most cli tests

* Readd local tests to nxapi until httpapi passes
2018-06-05 07:37:24 -04:00
Andrew J Huffman
fb61680ccd Updating tower_job_template.py (#38821)
* Updating tower_job_template.py

* tower_job_template: Update parameter version_added to 2.7

* Ensure that unset credentials aren't passed

Passing empty strings for unset credentials causes ValueErrors as
the API expects an integer. Don't pass unset credentials
2018-06-05 15:33:51 +10:00
Adrien Fleury
fc2c8a4ec8 Module: Tower inventory source module (#37110)
* tower_inventory_source: Add support for the inventory source via ansible-tower-cli.

* Add test coverage for tower_inventory_source.

* Update version_added to 2.7
2018-06-05 15:32:54 +10:00
saichint
6733bffd5d fix nxos_snapshot issues (#41034)
* fix nxos_snapshot issues

* review comments

* doc change
2018-06-05 10:56:32 +05:30
Deepak Agrawal
2db6a8c26a
iosxr_config crash if config has route-policy with multiple levels of 'ifelseif' and other caveats (#41091)
* diff in as-path-set or prefix-set

* fix caveat diff can not have last line with comma in prefix-set/as-path/community-set

* Simplify fix to include indentation before parse

* remove debugger

* route-policy diffs

* fix iosxr_config crash issue

* new changes in iosxr_config after git add

* end-policy-map and end-class-map are properly indented so match misplaced children only when end-* is at the beigining also fix pep8

* Remaining config blocks of route-policy which needs exclusion from diff. added new tests

* pylint/pep8 warnings

* Review comments , sanity test fix

* shbang warning

* remove unused import
2018-06-05 07:56:53 +05:30
Nathaniel Case
92a95368fe
Fixes to ios_logging (#41029)
* Logging size may not show up in config

* This is much simpler

* Avoid repetition in tests

* Both options of buffered are optional
2018-06-04 07:32:23 -04:00
Abhijeet Kasurde
4d200fb5ac
Use msg instead of var (#40810)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-06-04 12:46:23 +05:30
Zhikang Zhang
b578bf9e20 Fix test-module failing to validate args (#41004)
* Fix test-module failing to validate args

The test-module pass a wrong argument _ansible_tmp cause the validation failed.
Change the argument _ansible_tmp to _ansible_tmpdir to fix this.

* Add a integration test for test-module.

Prior to this change, we don't have a test for test-module.

This change ensure the correctness of test-module script.
2018-06-01 12:02:56 -07:00
Matt Martz
d4930e6692
Add requests.Session like class (#37622)
* Adds requests.Session like class

* py2 syntax fix

* Add a few examples to the Request docstrings

* Add helper methods and docs

* Fix test failures

* Switch tests to test Request instead of open_url, add simple open_url test to validate funcitonality

* Fix filename in replace-urlopen code smell test
2018-06-01 11:44:20 -05:00
Matt Martz
da4ff18406
Support 'apply' to apply attributes to included tasks - Impl 1 (#39236)
* Support 'apply' to apply attributes to included tasks

* Cannot validate args for task_include

* Only allow apply on include_

* Re-enable arg validation, but only for include_tasks and import_tasks

* s/task/ir/

* Add tests for include_ apply

* Include context with AnsibleParserError

* Add docs for apply

* version_added

* Add free-form documentation back

* Add example of free-form with apply
2018-05-31 12:08:38 -05:00
Matt Martz
961484e00d
Add src parameter for uri module that can be used in place of body. Supports binary files (#33689)
* First pass at a src parameter that can be used in place of body. Supports binary files

* Add test for uri src body

* Bump version_added to 2.6

* Close the open file handle

* Add uri action plugin that handles src/remote_src

* Document remote_src

* Remove duplicate info about remote_src

* Bump version_added to 2.7
2018-05-31 11:43:00 -05:00
Nathaniel Case
e7afd3d378
Search for macaddresses more stringently (#40901)
* Search for macaddresses more stringently

Fixes #40829
2018-05-31 10:45:17 -04:00
Nilashish Chakraborty
a013cdc747
Fixes ios_logging idempotency issues (#40701)
* Fixes ios_logging idempotency issues

* Added intergration tests & minor fixes

* Minor fixes in tests

* Minor fixes in tests #2

* eos_logging fixes after PR review
2018-05-31 20:07:24 +05:30
James Mighion
083ddb9bc2 Adding changed option to save_when for aireos (#40681)
* Adding changed option to save_when for aireos

* Deprecating save option for aireos_config.

* Updating version_added to 2.7 since the PR missed the window for 2.6
2018-05-31 10:35:12 -04:00
jctanner
a9e53cdb68 Allow config to enable native jinja types (#32738)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2018-05-31 10:38:29 +02:00
Sumit Jaiswal
81510970ae
Fix for updating the name in case of host record and network view and also display meaningful error in case of connection timeout (#40597)
* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* to resolve the bug 40709

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* to fix shippable nios automation error

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* shippable error fix

* shippable error fix

* shippable error fix

* shippable error fix

* shippable error fix

* review comment fix

* shippable error fix

* shippable error fix
2018-05-31 12:25:15 +05:30
Matt Martz
ad7ba91f75 Use _remote_is_local=True for local connection in synchronize (#40833)
* All instances of local connection should use _remote_is_local=True. Fixes #40551

* Switch to instance attribute for synchronize

* Add test that shows that synchronize _remote_is_local addresses tmpdir building
2018-05-30 13:28:11 -07:00
Fabian von Feilitzsch
4d77878654 K8s dynamic collected changes (#40745)
* Move k8s modules to dynamic backend

* update required openshift version

* update -> patch

* use new dynamic client exceptions

* style

* guard urllib3 import

* guard ansibleerror import

* give more information about error cause

* format in variable

* style

* rename tests

* Search for provided kind in a few more places to match old behavior, properly handle failure

* make common code use fail instead of fail_json, to work for lookup plugins as well

* update docs

* move openshift_raw tests into k8s tests

* fix typo

* Use diff of response and resource to determine change, don't do any checking client-side before making requests

* remove duplicate yaml blocks

* Update porting guide for k8s module

* remove invalid doc refs

* If fuzzy searching finds a resource, update resource_definition to match proper kind and version

* remote unsupported openshift_raw variables

* properly check environment variables when determining auth method:
2018-05-30 12:04:48 -05:00
Nathaniel Case
82dfa542c2
Replace bogus (but routeable) ip addresses with RFC 5737 example addresses (#40554)
* Remove 1.1.1.1 from *_config tests

* remove from *_smoke and *_system

* Miscellaneous other tests

* Remove from module documentation as well

* Remove from unit tests as well

* Remove accidental duplication from rebase
2018-05-30 13:03:20 -04:00
Matt Clay
c3d3b6cedc Fix FreeBSD package install in test setup.sh. 2018-05-30 07:43:49 -07:00
Nilashish Chakraborty
b9ea646839
Fixes eos_logging idempotence issue #31862 (#40604)
* eos_logging idempotence fix

* fixed eos_logging idempotence issue

* Fixed pylint and pep8 errors

* Added tests for eos_logging & minor fix

* Removed q statements
2018-05-30 18:21:54 +05:30
Nathaniel Case
2272b6155c
Remove local from most eos tests now that provider is out (#40875) 2018-05-30 08:40:28 -04:00
Guillaume Grossetie
5ffa1a1b2a Add a module to create a java key store (jks) from a certificate (#35273)
* Add a module to create a java key store (jks) from a certificate
* Create a jks from a certificate and a private key (secured by a password)
* Add an option to recreate the jks (useful when you want to update the jks password)
* If the certificate changed, recreate the jks
* Version added is now 2.7
2018-05-30 13:53:09 +05:30
Sloane Hertel
7d2c71462d gluster_volume: add 'volume' alias to 'name' param (#40845)
* gluster_volume: add 'volume' alias to 'name' param

* remove gluster_volume from validate-modules/ignore.txt
2018-05-30 02:06:46 +02:00
Pilou
de385560a8 jenkins_jobs: fix typos (#40844)
* jenkins_job: fix typos

* jenkins_job: add type for 'enabled' parameter
2018-05-30 01:44:02 +02:00
Nathaniel Case
20f93816d6
Fix eapi tests to use become (#40838)
* Return the expected prompt character based on become status

* Update eos_banner tests for eapi

* Update eos_config tests for eapi

* Update eos_facts tests for eapi

* Update eos_interface tests for eapi

* Update eos_l3_interface tests for eapi

* Update eos_lldp tests for eapi

* Update eos_logging tests for eapi

* Update eos_smoke tests for eapi

* Update eos_system tests for eapi
2018-05-29 14:18:03 -04:00
Trishna Guha
17b6ecf101
nxos_vlan fix (#40822)
* nxos_vlan fix

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

* uncomment mode test as nxapi now has get_capabilities

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-29 21:44:19 +05:30
Matt Martz
36c8441c6d New module vmware_deploy_ovf (#30309)
* First pass at vmware_deploy_ovf functionality
* Add OVA file support, re-structure code
* Move some useful functions to module_utils.vmware, and perform a little DRY too
* Better handling of errors during spec validation and import
* Properly calculate the lease progress percentage for all vmdk files
* Make warnings and errors a little better
* Add an allow_duplicates argument, that defaults to true, to allow users to have name based idempotency
* Add fail_on_spec_warnings to cause the module to treat warnings as errors
* Support non-vmdk uploads
* Add ova alias for ovf
* Rename vmdk_post_url to device_upload_url so it does not sound to specific to VMDK files
* Safer handling of * hostname in urls
* Add default Content-Type, remove unused headers var
* Add deploymentOptions and propertyMapping functionalities
* Add basic check_mode support
* Add vmware_deploy_ovf to list of use-argspec-type-path ignores
* Update version_added and fix path for use-argspec-type-path
* Add configurable folder
* Doc changes
2018-05-29 21:38:43 +05:30
Mike Wiebe
9f026309a6 Update nxos_install_os module (#40102)
* Add nxos_install_os integration tests

* Update call to check timers

* Update check_ansible_timer method

* Modify network_cli integration tests

* Add timer check for nxos_install_os

* Add comments for clear_persistent_sockets

* Update connection info for tests

* More updates

* Restructure files for provider and non-provider testing

* Update env var name and add check for ISSU switchover
2018-05-29 21:07:57 +05:30
Matt Clay
45c6fa9784 Update gluster_volume path in ignore.txt. 2018-05-29 08:35:13 -07:00