Commit Graph

1383 Commits (e9dbebfa57187dea49631ea1669ec9c0c244cd3a)

Author SHA1 Message Date
Olivier Bourdon a3f2e99864 Fix for changing method only on specified interface (#39015)
Test added for interface method change
6 years ago
Tim Rupp fb264281de
Adds various features and fixes (#39271)
* a refactor of pool member and node modules to be inline with current f5 conventions
* Added priority_group_activation to pools
* various other small convention fixes and bug fixes
6 years ago
Tim Rupp 9940b5db9c
Adds DNS profile module for BIGIP (#39270)
This module can be used for managing DNS profiles on a BIGIP
6 years ago
Tim Rupp 20d5b04ac4
Adds udp profile module for bigip (#39269)
This module can be used to manage UDP profiles on a bigip
6 years ago
Tim Rupp 434ad97c39
Adds tcp profile module for BIGIP (#39268)
This patch adds a module to support manipulation of TCP profiles
on a BIGIP
6 years ago
Tim Rupp 256b5535ec
Various fixes to F5 modules (#39255)
* Adds gnat provisioning to bigip_provision
* Adds special handling for AFM in bigip_provision
* Add device rebooting for provisioning as necessary
* Refactored route domain module to be inline with current f5 conventions
* Minor refactors across modules
6 years ago
Tim Rupp fc753dd261
Adds the bigip_smtp module (#39243)
This module can be used to manage smtp settings on a bigip.
6 years ago
Tim Rupp e82a8d177f
Adds module for bigip service policies (#39240)
This patch includes a module for managing bigip service policies.
6 years ago
Tim Rupp ed05e46f5c
Adds bigip_snmp_community module (#39212)
This module can be used to manage snmp communities on a bigip
6 years ago
Tim Rupp 3227143dc8
Fixes coding conventions, adds a small feature (#39211)
Fixes some coding conventions and adds allowed_addresses to bigip_snmp_trap.
6 years ago
Tim Rupp 39e4754fc9
Fixes for convention incompatibilities (#39209)
Minor fixes for the f5 modules to use current conventions
6 years ago
Tim Rupp 37e114756d
Adds bigip_trunk (#39208)
This patch adds a new module for managing trunks on a bigip
6 years ago
Tim Rupp 3b11def7d0
Add timer policy module (#39206) 6 years ago
Tim Rupp e254121729
Adds minor fixes and features to f5 modules (#39202)
* Add Mac_address parameter to bigip_traffic_group
* Fix docs
* Fix f5 conventions
6 years ago
Tim Rupp 19d229a8e0
Fixes F5 conventions and adds features (#39189)
This patch fixes a number of convention changes in F5 modules.
Additionally, it adds some features to bigip vlan and other modules
6 years ago
Brian Coca 4aac0f5f18
allow configuring sftp/scp executables (#36648)
* allow configuring sftp/scp executables

fixes #36616


also removed dupe test
6 years ago
Tim Rupp d38ae9b6c9
Adds the bigip_data_group module (#39180)
This module can be used to manipulate bigip data groups.
6 years ago
Matthew Stone d030032b47 Extreme Networks SLXOS Config Module (#38607)
* Adding slxos_config module and supporing util functions.

* Adding slxos module_utils load_config test

* Adding slxos_config module tests

* Removing unneeded required false statements from slxos_config module

* Removing version_aded from slxos_config module

* Removing force and save from slxos config module

* Removing save test
6 years ago
Matt Martz cdb79b0e3a
Consider parent also when comparing IncludedFile (#37083)
* Consider parent also when comparing IncludedFile

* Add new tests for IncludedFile and convert to pytest
6 years ago
Mat Wilson 8eb94ccbd5 Add support for dzdo flags Fixes #38766 6 years ago
Victor Bocharsky a30befa609 Remove duplicated "instead" word (#38800)
* Remove duplicated "instead" word

* Actually fix the message
6 years ago
Alex Stephen 9de9633cac [GCP] New module GCP DNS Resource Record Set (#35920) 6 years ago
Matthew Stone 5b1a8ee1e8 Adding slx_command module and supporting module_utils. (#38235)
* Adding slx_command module and supporting module_utils.

This commit adds the slx_command module and tests as well as the
required slxos module_utils.

* Update copyright in header

* Adding missing module init

* Cleaning up shebangs/licensing.

* Incorporating feedback

Removing reference to `waitfor` alias in `slxos_command` module.
Adding `Extreme Networks` to `short_description` of `slxos_command` module.

* Adding cliconf tests

* Fixing 3.X tests

* Adding docstrings to test methods for slxos cliconf tests

* Adding slxos terminal tests

* Adding slxos module_utils tests

* Adding Extreme Networks team members to BOTMETA.yml
6 years ago
Brian Coca 886c4edfb9
avoid caching invetnory sources in loader (#38242)
* fix inventory plugin source caching

 - avoid caching invetnory sources in loader in base
 - same fix for yaml plugin
 - idem for 'auto' plugin

fixes #37162

* fix mock dataloader func sig
6 years ago
Andrew Gaffney 95ce00ff00 Allow loading dirs from role defaults/vars (#36357)
This commit moves code to look for vars files/dirs to a common place and
uses it for loading role defaults/vars. This allows things such as
'defaults/main' or 'vars/main' being a directory in a role, allowing
splitting of defaults/vars into multiple files. This commit also fixes
the role loading unit tests for py3 when bytestrings are used for paths
instead of utf8 strings.

This fixes #14248 and #11639.
6 years ago
Matt Martz 450cfa8776
Handle duplicate headers in the uri module (#33792)
* Handle duplicate headers, and make it easier for users to use cookies, by providing a pre-built string

* Ensure proper cookie ordering, make key plural

* Add note about cookie sort order

* Add tests for duplicate headers and cookies_string

* Extend tests, normalize headers between py2 and py3

* Add some notes in test code

* Don't use AttributeError, use six.PY3. Use better names.
6 years ago
saichint dabe5e6d07 fix nxos_hsrp issues (#38410)
* fix nxos_hsrp issues

* shippable fix

* add examples for md5 auth
6 years ago
Matt Martz 6332beef65
Add unit tests for ansible.module_utils.urls (#38059)
* Start of tests for ansible.module_utils.urls

* Start adding file for generic functions throughout urls

* Add tests for maybe_add_ssl_handler

* Remove commented out line

* Improve coverage of maybe_add_ssl_handler, test basic_auth_header

* Start tests for open_url

* pep8 and ignore urlopen in test_url_open.py tests

* Extend auth tests, add test for validate_certs=False

* Finish tests for open_url

* Add tests for fetch_url

* Add fetch_url tests to replace-urlopen ignore

* dummy instead of _

* Add BadStatusLine test

* Reorganize/rename tests

* Add tests for RedirectHandlerFactory

* Add POST test to confirm behavior is to convert to GET

* Update tests to handle recent changes to RedirectHandlerFactory

* Special test, just to confirm that aliasing http_error_308 to http_error_307 does not cause issues with urllib2 type redirects
6 years ago
AlanCoding 153c9bd539 Reduce recursion within group methods
This offers an optimization that allows loading larger
inventories of various structure by improving the
scaling laws involved for adding hosts and groups.

The primary speed benefit is the elimination of duplicate
recusion from traversing converging paths.
6 years ago
Evgeny Fedoruk 5e990301bb Fixing lack of failure when uploaded source is invalid (#37461)
Checking the response status for 400 and throwing exception.
Unit tests updated.

Fixes #37406
6 years ago
Samer Deeb 72d42bd065 issue:38167 add support for onyx version 3.6.6000 for onyx_linkagg (#38191)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Pilou 7908f78fa6 module_common: handle None value for templar (#36651)
* module_common: set required parameter templar

Fix the following error (related to b455901):

  $ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python
  Traceback (most recent call last):
    File "./hacking/test-module", line 268, in <module>
      main()
    File "./hacking/test-module", line 249, in main
      (modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename)
    File "./hacking/test-module", line 152, in boilerplate_module
      task_vars=task_vars
    File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module
      environment=environment)
    File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils
      shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar)
    File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang
      interpreter = templar.template(task_vars[interpreter_config].strip())
  AttributeError: 'NoneType' object has no attribute 'template'

* module_common.modify_module: templar is required
6 years ago
Deepak Agrawal 66b389a00d
show version brief does not work on iosxr virtual (#37609)
* show version brief does not work on iosxr virtual

* ci failures fix
6 years ago
Samer Deeb 9dfb665e43 issue:37307 Add support for changes in pfc output in onyx 3.6.6000 (#37651)
* issue:37307 Add support for changes in pfc output in onyx 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Olivier Bourdon 612d0d6634 Fix interfaces_file for proper file contents (#37818)
The generated file was completely unusable by the system
therefore the fix which ensures that diffing the file
prior to changes and after only shows diffs

Furthermore the code did not work for Python 3.6
>       f.writelines(to_bytes(lines, errors='surrogate_or_strict'))
E       TypeError: a bytes-like object is required, not 'int'

The other modifications (lambda variable renaming) is to
comply with default flake8 rules
6 years ago
Adrian Likins 6e737c8cb6
Fix 'New Vault password' on vault 'edit' (#35923)
* Fix 'New Vault password' on vault 'edit'

ffe0ddea96 introduce a
change on 'ansible-vault edit' that tried to check
for --encrypt-vault-id in that mode. But '--encrypt-vault-id'
is not intended for 'edit' since the 'edit' should always
reuse the vault secret that was used to decrypt the text.

Change cli to not check for --encrypt-vault-id on 'edit'.

VaultLib.decrypt_and_get_vault_id() was change to return
the vault secret used to decrypt (in addition to vault_id
and the plaintext).

VaultEditor.edit_file() will now use 'vault_secret_used'
as returned from decrypt_and_get_vault_id() so that
an edited file always gets reencrypted with the same
secret, regardless of any vault id configuration or
cli options.

Fixes #35834
6 years ago
Matt Martz 1f824bd620 Don't overwrite builtin jinja2 filters with tests (#37881)
* Don't overwrite builtin jinja2 filters with tests. Fixes #37856

* Fix tests and other callers of _get_filters
6 years ago
Sloane Hertel f53f29352d Move AWS placebo fixtures into test/units/utils so module_utils tests can use them (#37300) 6 years ago
Alexander Bethke eebe728ae8 Fix SteamOS ansible_distribution fact (Fixes #33628) (#37576)
Fixes #33628
6 years ago
Izuke e02c72d856 Fixes #32146 Fixes reconcile inventory to correctly remove hosts from ungrouped 6 years ago
Samer Deeb a89bafce2e issue:37306 Fix issue with vlan support for onyx version 3.6.6000 (#37310)
* issue:37306 Fix issue with vlan support for onyx version 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Claes Nästén 6308047dc9 nso_verify handle leaf-list in 4.5 and identityref (#37393)
NSO verify did not handle leaf-list value verification in 4.5 and
later due to changes made for configuration writing made.

map prefix for identityref types in verification.
6 years ago
Claes Nästén 458a07d5a4 add timeout parameter and increase default timeout for nso modules (#37391)
NSO operations can take much longer than 10 seconds as they operate on
real network equipment, set default timeout to 5 minutes and allow for
user override.
6 years ago
Adrian Likins e166946a0a Fix redundant yaml error blurbs on ModArgs parse errors (#36923)
* Fix redundant yaml error blurbs on ModArgs parse errors

Some of the AnsibleParserErrors from parsing.mod_args
are created with the obj=some_yaml_ds options but
some are not.

If they were, we don't want to add another yaml_ds to
it, because that will result in double yaml error blurbs.
And since we dont need to add info, we can just re raise it.

But if there is no ._obj, add it here so we get the extra
detail in the error message (see issue #14790) and raise
a new AnsibleParserError instance.

Fixes #36848

* cleanup existing test_tasks pep8/sanity issues
6 years ago
Claes Nästén f8d20f970f Update Cisco NSO module required versions. (#36736)
NSO modules will now work with older versions of NSO, update version
requirements.
6 years ago
Nathaniel Case 594840c1d6
Close & remove paramiko connection where appropriate (#37528)
* Close & remove paramiko connection where appropriate

* Update unit test
6 years ago
Dylan Murray 90943a3362 Add APB role_type to ansible-galaxy init (#36789)
* Add APB role_type to ansible-galaxy init

* Add handlers scaffolding

* Fix shippable errors by setting default

* Add unit tests and fix shippable

* Updates init description
6 years ago
Nathaniel Case efb8b539c1
Don't fail on configure in command (#37011)
* Don't fail on configure in command

* Change test to check mode
6 years ago
Trishna Guha 2fbfce06e7
Fix nxos_interface multiple issues (#36827)
* fix interface_type

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

* fix setting mtu, doc for state check param, doc for params applicable for ethernet intf

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

* speed idempotence and add unittest

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

* fabric_forwarding_anycast_gateway applicable for svi type intf only

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

* fix speed

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Pilou 274a4b0688 gitlab_project: don't ignore errors (#36702)
* gitlab_project: check that errors are reported

* gitlab_project: report encountered errors

Fix #36495
6 years ago
Claes Nästén 042c111563 nso_config break cycles in dependency sorting (#36828)
False assumption that values can not have cyclic dependencies. Fix by
removing dependency on self and look for cycles, if found remove
dependency to get a partial sort done.
6 years ago
Claes Nästén e75989ec88 nso_config work around ordering issues (#36774)
Include dependencies when sorting entries to avoid issues with certain
versions of NSO.
6 years ago
David Newswanger 6bd715a17d
skip fmg_script unit test if the pyFMG script is not present (#36732)
* skip fmg_script unit test if the pyFMG script is not present

* appease the sanity test gods
6 years ago
Claes Nästén 2789cc5c09 NSO ValueBuilder improvements. 4.5 leaf-list compatability. (#36583)
Fix issues in ValueBuilder used in nso_config and nso_verify so that it
can handle leaf-list in NSO 4.5 and detect identityref types from
unions.

Fail gracefully if a type is not found.
6 years ago
Peter Sprygada 93b795baf0
allows ib_spec attrs to be filtered in update (#36673)
* allows ib_spec attrs to be filtered in update

This change will allow the ib_spec entries to be be filtered on a change
object by setting the update keyword to false.  The default value for
update is true.  When the update keyword is set to false, the keyed
entry will be removed from the update object before it is sent to the
api endpoint.

fixes #36563

* fix up pep8 issues
6 years ago
Matt Martz a7062b7587
Start of tests for modify_module, specifically to ensure proper shebang replacement on old style modules (#36602) 6 years ago
mikedlr 52f2057472 aws ssm parameter lookup - change to return Nones for missing variables (#36456)
* aws ssm parameter lookup - change to return Nones for missing variables

* aws ssm parameter lookup - fix error case message to dump response

* aws ssm parameter lookup - fix integration test cases
6 years ago
Brian Coca a79378fccb remove extra fields from debug output
fixes #35493

updated tests
6 years ago
rahushen e24c547a3a Fixes for the N3500 platform that uses the A8 image (#36261)
* fix nxos_l3_interface tests as n35 doesn't support ipv6

* add terminal dont-ask to nxos_feature and nxos_lldp

* put interfaces in L2 mode for N35

* fix nxos_feature unit-tests
6 years ago
Martin Krizek 3a5263a92f facts: fix device uuid's on el6 (#36128)
* facts: fix device uuid's on el6

Fixes #36077
6 years ago
saichint 75a34f6668 fix nxos_bgp_af issues (#36147)
* fix nxos_bgp_af issues

* shippable fix

* review comments

* shippable error fix
6 years ago
Tim Rupp 77fa41795e Reduces the unit test time of select bigip modules (#36256)
The modules in this patch include waits that need to happen to ensure
something is correctly configured on a BIG-IP. These waits were
raised as an issue in a recent ansible-testing meeting.

This patch eliminates the waits by mocking time.sleep
6 years ago
Toshio Kuratomi 06f73ad578
Normalize usage of temp and tmp on tmp (#36221)
* Normalize usage of temp and tmp on tmp
* Rename system_tmps system_tmpdirs
* Add ANSIBLE_REMOTE_TMP spelling of environment variables
6 years ago
Monty Taylor 0f893027c4 Add a module_utils OpenStack Cloud constructor (#20974)
Start using this to construct shade OpenStack Cloud objects in a
consistent manner. This will let us centralize things like dealing with
password arguments and whatnot. It also allows us to introduce the
ability to pass a fully formed config dict directly to the module.

Migrate all OpenStack modules to use openstack_cloud_from_module.

Have it return the shade library since it's responsible for
importing shade and shade is needed for the exceptions.

Only pull specific OpenStack arguments for the constructor

Rather than passing **module.params to the shade constructor, pull out
only the values that make sense. This should prevent the issues with
module parameters stepping on shade parameters.

Replace module.params.pop with module.params.get

We don't need to pop these anymore since the shade constructor is now
using opt-in values.

Using real urls is ungood. Use example.com domains. Also, get rid of the
antiquated port numbers.
6 years ago
Sam Doran 97573d8b0c
Add unit tests for edgeos_command (#35861) 6 years ago
Brian Coca 8743b20c8e skip aws inventory test if no boto 6 years ago
saichint c7305393a3 fix nxos_evpn_vni issues (#35930) 6 years ago
saichint 80fcfdc0d1 fix nxos_vpc issues (#35868) 6 years ago
René Moser 2f36b9e5ce basic: allow one or more when param list having choices (#34537)
* basic: allow one or more when param list having choices

* add unit tests

* optimize a bit

* re-add get_exception import

* a number of existing modules expect to be able to get it from basic.py
6 years ago
James Mighion 663c410da4 Fixing eos_config save option. Was removed when deprecated. Fixing ot… (#35628)
* Fixing eos_config save option. Was removed when deprecated. Fixing other deprecation documentation. Adding unit tests.

* Fixing removed_in_version for force.
6 years ago
Sam Doran 6037e73c16
Add EdgeOS config module (#35867)
* Add edgeos_config module

* Add edgeos_config module

* Remove debugging statements

* Add future import and correct module name in docs
6 years ago
Sam Doran a9da1c2927
Add EdgeOS facts module (#35871)
* Add edgeos_facts module and unit tests

* Add future import
6 years ago
Chad Norgan 9bbf97632c [WIP] Add new network module for EdgeOS (#33109)
* Add edgeos network module using network_cli

* Add documentation and some sanity test fixes

* Update copyright and documentation
6 years ago
mikedlr d31ded47fb Aws ssm multiple fixes (#35569)
* aws ssm parameter lookup test case - fails demonstrating no exception when parameter missing

* aws ssm parameter lookup - fail in case parameter doesn't exist

* aws ssm parameter lookup test case - failing case for nice return from path lookup

* aws ssm parameter lookup - convert incoming taglist to a key-value dictionary

* aws ssm parameter lookup - pep8 / style clean up

* aws_ssm lookup plugin rewrite for more standard interface

* aws_ssm module and lookup - introduce integration test and fix:

* aws_ssm module and lookup - error case integraton test and many PEP8 and other cleanups

* aws ssm parameter lookup - Various fixes in response to review + recursive fix & test

* aws ssm parameter lookup - more in response to review - shertel/abadger

* aws ssm parameter lookup unit test - move to mocker according to abadger

* aws ssm parameter lookup - integrate with new documentation fragment

* aws ssm parameter lookup - accept either aws_profile or boto_profile

* aws ssm parameter lookup - eliminate lookup document fragment until env vars are fixed later
6 years ago
George Nikolopoulos b1a8f3b3d3 Netscaler various fixes (#34800)
* Add default lb vserver option in netscaler_cs_vserver
Add documentation for ssl_certkey option in netscaler_cs_vserver

* Add options for gracefully disabling netscaler_server

* Add "state" suboption for netscaler_servicegroup servicemembers
Fix servicemember modification algorithm in netscaler_servicegroup
Fix monitorbindings modification algorithm in netscaler_servicegroup
6 years ago
Ken Evensen 5cce0249f3 Fixes #35629 (#35668) 6 years ago
Dag Wieers bee765fa6b
ACI: Change RETURN output as discussed (#35617)
* ACI: Change result output as discussed

* Update all modules to use new aci.exit_json()

* Update output_level spec and docs

* Fix integration tests

* Small PEP8 fix

* Asorted fixes to tests and aci_rest

* More test fixes and support for ANSIBLE_DEBUG

* Fix another PEP8 issues

* Move response handling inside ACI module

* Reform of ACI error handling and error output

* Diff multiline json output

* Fix a few more tests

* Revert aci_bd tests

* Small correction

* UI change: existing->current, original->previous

* UI change: config->sent

* Update all modules with RETURN values

* Fix a few more tests

* Improve docstring and add 'raw' return value

* Fix thinko

* Fix sanity/pep8 issues

* Rewrite unit tests to comply with new design
7 years ago
Nathaniel Case f3337e1fba
ios test changes (#35510)
* Fix over-byte

* Update ios tests to call `provider`

To continue to support testing `connection: local`

* Fix command dict handling in ios_user

* Clean up unit tests, too
7 years ago
James Mighion f04d40640e Fixing name from aruba to ios. (#35630) 7 years ago
saichint dc35baa8db fix nxos_pim_interface issues (#35405)
* fix nxos_pim_interface issues

* add absent test for pim_interface
7 years ago
Clement Trebuchet 287f3a609e Fixes #35468: ADD max_results to the nios api (#35473)
* Fixes #35468: ADD max_results to the nios api

* Fixes #35468: fix nios unittest

* Fixes #35468: document the module docs fragments for nios
7 years ago
Harri Tuominen 234a877ea5 Netact cm command2 (#34873) 7 years ago
Nathaniel Case 4a79112e5c
Fix ios_facts return values (#35239)
* Revert model and serialnum to older version

* Add stacked versions of model and serialnum as separate facts

* Add unit test to check stacked output

* Alter model regex to address #34768
7 years ago
John R Barker a23c95023b
Module deprecation: docs, scheme and tests (#34100)
Enforce module deprecation.
After module has reached the end of it's deprecation cycle we will replace it with a docs stub.

* Replace deprecated modules with docs-only sub
* Use of deprecated past deprecation cycle gives meaningful message (see examples below)
* Enforce documentation.deprecation dict via `schema.py`
* Update `ansible-doc` and web docs to display documentation.deprecation
* Document that structure in `dev_guide`
* Ensure that all modules starting with `_` have a `deprecation:` block
* Ensure `deprecation:` block is only used on modules that start with `_`
* `removed_in` A string which represents when this module needs **deleting**
* CHANGELOG.md and porting_guide_2.5.rst list removed modules as well as alternatives
* CHANGELOG.md links to porting guide index

To ensure that meaningful messages are given to the user if they try to use a module at the end of it's deprecation cycle we enforce the module to contain:
```python
if __name__ == '__main__':
    removed_module()
```
7 years ago
Abhijeet Kasurde becb31f34c nmcli: Allow setting ipv4.dhcp-client-id parameter (#34268)
Signed-off-by: Orion Poplawski <orion@cora.nwra.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Jordan Borean 9ee079f34d
further fixes to rename only where required (#35432) 7 years ago
Jordan Borean d902bd39a3
renamed test file to allow checkouts on Windows (#35430)
* renamed test file to allow checkouts on Windows

* used different name pattern to fix sanity issues
7 years ago
Peter Sprygada c2d3b9cbd5
refactors nios api shared code to handle provider better (#35393)
* refactors nios api shared code to handle provider better

This change refactors the shared code to be easily shared between
modules, plugins and dynamic inventory scripts.  All parts now implement
the provider arguments uniformly.

This also provides a centralized fix to suppress urllib3 warnings coming
from the requests library implemented by infoblox_client

* fix up pep8 errors

* fix missing var name
7 years ago
Ghilli3 60d2a8b6a1 Fortinet FortiManager Scripting Module (#34518)
* Adding new code for new module and new module_utils with the pip pyfmg package

* Changed login and logout functionality and renamed mod_utils file as well as cleaned up PEP8 syntax

* Removing extra Ansible parameters and fixing more syntax issues

* Fixing more syntax issues and comparing against previous FTNT script module

* Changing import location to pass syntax checks

* Fixing pylint errors

* Removing test files

* Add unit tests and enabling a login session check within main in order to throw error if network connection exception

* Fixing syntax issues for adding unit tests

* Changing case for pip package requirements

* adding comments

* adding version restriction on pip package for testing

* adding version restriction on pip package for testing

* More comments

* Fixing documentation errors and add the ability to skip a test if it isn't present

* Fixing Pep8 error with whitespace (tab) in the row
7 years ago
Matt Martz 7404dc6767 Recursively remove args with omit as as their value, to match suboptions in argument_spec (#35299)
* Recursively remove args with omit as as their value, to match suboptions in argument_spec

* Add test for the new remove_omit function
7 years ago
Amol Kahat e8633b7a22 Added VLAN configuration. (#35343)
Fixes GH 22147

Signed-off-by: Amol Kahat <akahat@redhat.com>
7 years ago
Nathaniel Case 1f1e5c11a9
ios_command: Whitelist some commands starting with `configure` (#35363)
* Whitelist some commands starting with `configure`

* Add tests for conditional `configure` rejection
7 years ago
Senthil Kumar Ganesan 2f46f8f944 Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915)
* Support for network_cli plugin and tests

* Fixed ansible-test * issues

* Fixed Pylint warning

* Fixed the sanity test errors

* Fix YAMLlinter issue - removed blank spaces

* Fixed Python 3 failures

* Fixed the PEP8 issue

* Fix sanity --test validate-modules

* Reverted the changes to the doc fragments
7 years ago
Tim Rupp bd09e67438
More bug fixes before 2.5 (#35260)
This patch includes more fixes for bugs that were identified in
the upcoming 2.5 release.
7 years ago
Claes Nästén 0582521f96 NSO: handle types for leaf-lists in nso_config (ValueBuilder) (#34986)
Fixes: #34985
7 years ago
Claes Nästén b7f815ba89 nso_config handle data.not_found in exists for nested lists (#35267)
Recent NSO can return data.not_found error on exists when parent list
entries does not exist. Handle this and return as false.

Fixes: #35264
7 years ago
Colins-Git 7fac5cd7d2 Support for creation and modification of bridge and bridge slaves for nmcli (#34071)
Fixes: #31737
7 years ago
Trishna Guha fd4fdbf01f
ios_logging handling platform difference (#35232)
* ios_logging handling platform difference

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

* fix unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Michael Scherer 060001b08d Remove deprecated code (#34828)
* Remove compat code for to_unicode, to_str and to_bytes

Code was marked as deprecated and to be removed after 2.4

* Remove is_encrypted and is_encrypted_file

Code was marked as deprecated after 2.4 release.
7 years ago
Tim Rupp ad8ee4e60f
Removes a bogus key from fixtures (#35236) 7 years ago
Jason Vanderhoof 7c8e365dff Conjur Lookup Plugin (#34280)
* Imported lookup plugin from Role

* Plugin cleanup, including:
* Use existing Python YAML parsing
* Remove environment variables as connection options
* Added initial debugging information

* Reworked the lookup plugin using the Python Request library.  As it's available through Ansible, it makes communication with Conjur much more straight forward.

* Removed un-used libraries

* Fixed linting issues

* Standardized output on `format` and insure it works for 2.6, 2.7, and 3.x.

* Use quote_plus from the six library for improved python 2/3 behavior.

* Refactored identity & configuration to prefer user's file. This also includes a refactor to remove an un-needed dictionary merge method.

* Removed `requests` in favor of `ansible.module_utils.urls`.

* Refactored netrc loading to warn if host is not present.

* Tests and a refactor to support easier testing.

* Added reference to website

* Fixed two linting errors

* Fixed an extra line found by linting

* Updated file write to use binary to insure config files are written correctly

* Resolved linting issues

* Refactored config & identity loading to take advantage of plugin options

* Cleanup a bunch of small items caught by linting

* Removed extra line caught by linting

* Swapped in pytest and added some tests with mocked network responses

* Pushing to see if this approach works better...

* Refactored be open_url mocking based on feedback

* Fixed a couple linting issues & refactored mocking into each method to attempt to resolve a failing test

* Use a generic MagicMock for python 2.6

* Fixes doc typo

require -> required

* Use `type: path` in identity_file and config_file

Also removes `expanduser` calls below (which will now be called automatically on
paths.)

* Defines maintainers for conjur_variable plugin

* BOTMETA.yml:
** defines $team_cyberark_conjur as maintainers of Conjur Variable plugin
** adds myself and @jvanderhoof to that team

* Adds URLs to relevant documentation for Conjur Variable lookup plugin

* Clarifies "the server," "the machine" -> "controlling host"

The machine identity used is that of the Ansible controlling host, not any
server being provisioned or instructed. This documentation change aims to make
that relationship clear.

* Adds response code to exception message on authentication failure

* Enhances exception messages to specify the controlling host

These error messages are less likely to confuse a user as to which machine is
associated with the files, identities, and configurations being described.

* Adds ANSIBLE_METADATA for Conjur variable lookup plugin
7 years ago
Dhivyap 19ff2f4e8c Ansible 2.5 feature support for dellos9 (#34880)
* Add ansible-2.5 support for dellos9

* Fix ansible-test issues and update copyright

* fix ansible-test errors in dellos9_config

* fix izip attribute error in python3

* fix python3 dict.keys() issue

* Remove waitfor aliases in dellos9_command
7 years ago
Toshio Kuratomi 8c7bd8beb4 Set the tempdir on the shell mock object so that it is json serializable 7 years ago
Toshio Kuratomi 14c3b4d8e5 Move yaml loading functions from DataLoader into a utility module. 7 years ago
Sloane Hertel b94198f9de [cloud] New inventory plugin: aws_ec2 (#34416)
aws_ec2 is an inventory plugin intended to replace uses of the `contrib/inventory/ec2.py`
inventory script. 

For advanced grouping, please use the `constructed` inventory plugin.
7 years ago
Adrian Likins 6e585bdf24
Fact collector ordering deps (#31362)
Add deps/requires for fact collectors

Fact collectors can now set a required_facts
class attribute that will be a set of the names
of fact collectors they require to be run first.

ie, if a collector needs to know the ansible_distribution,
it should set it's required_facts to include 'distribution'

        required_facts = set(['distribution'])

If a collector requires another collector, it gets added
to the selected collector names.

We then topological sort the ordering of the collectors
so that deps work out (ie, 'distribution' will run before
'service_mgr')

required_facts were added to the collectors for:

        - network (requires 'distribution', 'platform')
        - hardware (requires 'platform')
        - service_mgr (requires 'distribution', 'platform')

Fix name references for facts (need 'ansible_' prefix)
is service_mgr

Fixes #30753
7 years ago
Peter Sprygada 8d775a332e Add support for Infoblox NIOS (#35097)
* WIP: initial commit

* update documentation in modules

* fix up sanity check issues

* add unit tests for nios api

* fix up sanity check failures

* fix up EXAMPLES in modules

* mock infoblox_client.connector

* remove unsupported assert statement
7 years ago
abirami-n 775118aae2 2.5 Plugin Environment support and Testcases for dellos6 modules (#34890)
* Dellos6_2.5_support

* cleanup

* Fix pep8

* fix waitfor

* fix_facts

* fix_assert
7 years ago
Tim Rupp bff862b05d
Fixes bigip_asm_policy (#35154)
This module had been unable to successfully create policies
on different partitions. This appears to be fixed now
7 years ago
Adrian Likins 08f92a9f0f
Fix fact deps when 'filter=ansible_fact' is used. (#33441)
The accumulated collected_facts was being update
with new facts _after_ filtering them. So only
facts that pass the filter would ever be passed
to other fact collectors.

For 'filter=ansible_service_mgr', even though it requires
the platform and distribution facts and even collects them,
they would get filtered out and never passed to the other
collectors that need them (service_mgr for ex).

Fix is just to add the unfiltered facts to collected_facts.

Adds unit tests for fact filter and collected_facts.

Fixes #32286
7 years ago
Adrian Likins ec9769c82f
Facts distribution clear linux 31501 (#32453)
The search string used to look for Clear Linux
was changed in 45a9f96774 to
be more specific, but was too specific. Now finding
a substring match for 'Clear Linux' in /usr/lib/os-release
is enough to consider a match.

Since the details of the full name in os-release varies
('Clear Linux Software for Intel Architecture',
 'Clear Linux OS for Intel Architecture', etc) the
search string match was failing and would fall back to the
'first word in the release file' method resulting in
ansible_distribution='NAME="Clear'

Also add a meta fact indicating which search string
was matched.

Test case info from:
        https://github.com/ansible/ansible/issues/31501#issuecomment-340861535

Fixes #31501
7 years ago
Adrian Likins fc180a378a
Support using vault password files that are themselves vault encrypted (#27668)
Extract vault related bits of DataLoader._get_file_contents to DataLoader._decrypt_if_vault_data

When loading vault password files, detect if they are vault encrypted, and if so, try to decrypt with any already known vault secrets.

This implements the 'Allow vault password files to be vault encrypted'  (#31002) feature card from
the 2.5.0 project at https://github.com/ansible/ansible/projects/9

Fixes #31002
7 years ago
Tim Rupp ca8982f96c
Fixes some bugs and things (#35122)
Removes deprecations and fixes bugs.
7 years ago
Tim Rupp 90f0c411e4
Adds module for bigip_device_group_member (#35121)
Module allows for members to be managed in a device group
7 years ago
Tim Rupp 585d8cf4c7
Adds bigip_ucs_fetch module (#35113)
This module can be used to download UCS files from a BIG-IP
7 years ago
Christian Giese 2697c0e237 junos scp module (#31950)
* junos_scp module

This module transfers files via SCP from or to remote devices running Junos.

* fix version

* add return documentation

* updated return documentation

* docu, renamed args and exceptions
+ update docu
+ rename arg download to remote_src (simitlar to copy module)
+ exception handling for transfer errors

* add tests

* add test_junos_scp_all

* update to reorganized module utils

* fix unit tests
7 years ago
Matt Martz 29c1d5cb5d Ensure that the become password is written on py3 in the ssh connection plugin. Fixes #34727 7 years ago
Aron Szekely 943730b70c Update pamd.py to allow module path with slashes (#32197) 7 years ago
clarkst e4f294822f [cloud] kinesis stream server side encryption - fixes #30269 (#30689)
* Moved the encryption to its own action method.

* removed silly default value for encryption type.

* Code formatting issues from pull request ANSIBOT.

* changed version_added to  "2.5"
because of new new options available

* changed version_added to  "2.5"
because of new new options available

* changed version_added to  "2.5"
because of new new options available
7 years ago
Tim Rupp acb26758ef
Adds better cli detection for bigip_command (#34975)
The new detection includes things like provider spec. The action
plugin for bigip generally was changed, so this is a required change
7 years ago
Kedar Kekan 93acd7c651 refactor iosxr_system for cliconf and netconf (#34749)
* * refactor iosxr_system for cliconf and netconf

* * Fix unit tests and sanity issues
7 years ago
Kedar Kekan 0f692f1fe7 iosxr_user refactor for cliconf and netconf (#34892)
* * refactor iosxr_user for cliconf and netconf

(cherry picked from commit 5d0994ef598f1601fca00a0c1eff4ebb05ebbf1b)

* * Purge and units test changes
7 years ago
Tim Rupp 944ae47701
Detects errors in bigip_config (#34965)
There are changes that the merge config can fail, but the module
will still report success. This adds a blob of code to start
collecting those failures and bubbling up a module failure
accordingly.
7 years ago
Tim Rupp 17d9ba304e
Adds module for bigip device group (#34958)
This module can be used to manage a device group on a bigip
7 years ago
Abhijeet Kasurde b7724fdf85 nmcli: Add ipv4.dns-search attribute (#34261)
This fix adds following -
* ipv4.dns-search attribute
* refactoring of code
* correct return status for up_connection
* documentation update

Fixes: #17843

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Brian Coca bbd6b8bb42 Temporary (#31677)
* allow shells to have per host options, remote_tmp

added language to shell
removed module lang setting from general as  plugins have it now
use get to avoid bad powershell plugin
more resilient tmp discovery, fall back to `pwd`
add shell to docs
fixed options for when frags are only options
added shell set ops in t_e and fixed option frags
normalize tmp dir usag4e

- pass tmpdir/tmp/temp options as env var to commands, making it default for tempfile
- adjusted ansiballz tmpdir
- default local tempfile usage to the configured local tmp
- set env temp in action

add options to powershell
shift temporary to internal envvar/params
ensure tempdir is set if we pass var
ensure basic and url use expected tempdir
ensure localhost uses local tmp
give /var/tmp priority, less perms issues
more consistent tempfile mgmt for ansiballz
made async_dir configurable
better action handling, allow for finally rm tmp
fixed tmp issue and no more tempdir in ballz
hostvarize world readable and admin users
always set shell tempdir
added comment to discourage use of exception/flow control

* Mostly revert expand_user as it's not quite working.

This was an additional feature anyhow.

Kept the use of pwd as a fallback but moved it to a second ssh
connection.  This is not optimal but getting that to work in a single
ssh connection was part of the problem holding this up.

(cherry picked from commit 395b714120522f15e4c90a346f5e8e8d79213aca)

* fixed script and other action plugins

ensure tmpdir deletion
allow for connections that don't support new options (legacy, 3rd party)
fixed tests
7 years ago
James Cammarata b107e397cb
Cache tasks as they are queued instead of en masse (#34752)
* Cache tasks as they are queued instead of en masse

This also moves the task caching from the PlayIterator to the
StrategyBase class, where it makes more sense (and makes it easier
to not have to change the strategy class methods leading to an API
change).

Fixes #31673

* Cleaning up unit tests due to 502ca780
7 years ago
Trishna Guha a65f702155
add config option to replace argument (#34342)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Tim Rupp 9aba711519
Adds bigip_static_route module (#34859)
This module can be used to manage static routes on a BIG-IP
7 years ago
Tim Rupp c548ab0f18
Refactors and deprecation removals (#34830)
This patch is primarily a refactor to make the validate-modules arg-spec
no longer generate a traceback. It additionally includes removal of deprecated
code in the virtual server module.
7 years ago
Tim Rupp a10aee0fc3
Adds refactors for more f5 modules (#34824)
The main patch is to remove the traceback generating code. There are
other small fixes that were made in addition to doing that.

* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg.
* Minor bug fixes made during this refactor.
7 years ago
Tim Rupp 0e4e7de000
Various F5 related fixes for traceback raising (#34820)
The main purpose of this patch is to do the refactor that
supports replacing tracebacks with fail_json. Additionally, the
following was done.

* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg.
* Minor bug fixes made during this refactor.
7 years ago
Tim Rupp eace686044
Various fixes and changes for F5 (#34817)
Primarily, this patch contains refactors to remove tracebacks that
are generated when libraries are missing. There is also,

* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg. Minor bug fixes made during this refactor.
7 years ago
Tim Rupp 44a5b3abb4
Various fixes (#34815)
This patch was primarily an effort to reduce traceback errors for
work that sivel was doing. Part of (and in some cases in addition to)
that, the following was done.

* Removed re-def of cleanup_tokens.
* Changed parameter args to be keywords.
* Changed imports to include new module_util locations.
* Imports also include developing (sideband) module_util locations.
* Changed to using F5Client and plain AnsibleModule to prevent tracebacks caused by missing libraries.
* Removed init and update methods from most Parameter classes (optimization) as its now included in module_utils.
* Changed module and module param references to take into account the new self.module arg.
* Minor bug fixes made during this refactor.
7 years ago
Tim Rupp 18d33eeb89
Adds the AFM address list module (#34814)
This module can be used to manage address lists on a BIG-IP running
AFM.
7 years ago
Samer Deeb f8884f12bc Mellanox OS name change: MLNXOS changed to ONYX (#34753)
* Mellanox OS name change: MLNXOS changed to ONYX

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

* Fix alphabetical order of modules metadata

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Samer Deeb cb206abea3 Support advertised networks in bgp protocol (#34728)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Samer Deeb fcf6da0a9d Add ospf protocol support for Mellanox MLNXOS network devices (#34717)
* Add new module for managing ospf protocol on mlnxos devices

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

* Fix test name, and documentation.

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Trishna Guha df8b01aaf7
Handle platform os version for sandbox nxos_nxapi (#34490)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay 797664d9cb Python 2.6 `str.format()` compatibility fixes. 7 years ago
Samer Deeb 8277e9d1a5 Add new module mlnxos_bgp for managing bgp protocol on Mellanox MLNX-OS devices (#34305)
* Add new module mlnxos_bgp for managing bgp protocol on Mellanox MLNX-OS
devices

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

* Add missing required field, and Fix Documentation

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

* Fix documentation of neighbors field

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Matt Clay 30093dc4ed
Add Python 3.7 to CI unit test matrix. (#34680)
* Add Python 3.7 to CI unit test matrix.
* Fix `os.errno` reference to be `errno`.
* Update test_aci unit test for Python 3.7.
7 years ago
Will Thames a685b621cd Route table boto3 (#32059)
* Allow protection of certain keys during camel_to_snake

Create an `ignore_list` parameter that preserves the case
of the contents of certain dictionaries. Most valuable
for `tags` but other uses might arise.

* Port ec2_vpc_route_table to boto3

Update tests to reflect fixes in boto3.

* Add RETURN documentation to ec2_vpc_route_table

* Update DOCUMENTATION to be valid yaml

* Add check mode tests
7 years ago
Matt Clay cd205854a4 Fix Python 3.7 syntax error in tests. 7 years ago
Matt Martz d1846425db
Provide a way to explicitly invoke the debugger (#34006)
* Provide a way to explicitly invoke the debugger with in the debug strategy

* Merge the debugger strategy into StrategyBase

* Fix some logic, pin to a single result

* Make redo also continue

* Make sure that if the debug closure doesn't need to process the result, that we still return it

* Fix failing tests for the strategy

* Clean up messages from debugger and exit code to match bin/ansible

* Move the FieldAttribute higher, to apply at different levels

* make debugger a string, expand logic

* Better host state rollbacks

* More explicit debugger prompt

* ENABLE_TASK_DEBUGGER should be boolean, and better docs

* No bare except, add pprint, alias h, vars to task_vars

* _validate_debugger can ignore non-string, that can be caught later

* Address issue if there were no previous tasks/state, and use the correct key

* Update docs for changes to the debugger

* Guard against a stat going negative through use of decrement

* Add a few notes about using the debugger on the free strategy

* Add changelog entry for task debugger

* Add a few versionadded indicators and a note about vars -> task_vars
7 years ago
Clement Trebuchet d5a8974ef3 Add the ability for the ios_vrf module to apply route targets to a VRF (#34248)
* Add the ability for the ios_vrf module to apply route targets to a VRF

* Fix W293 blank line contains whitespace
7 years ago
Abhijeet Kasurde 08a1d47427 nmcli: Add missing 'primary' option (#34252)
This fix adds missing 'primary' option in nmcli module.

Fixes: #30405

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Samer Deeb 473b2d58ec Add new module mlnxos_mlag_vip for configuring MLAG VIP on Mellanox network devices (#34285)
* Add new module mlnxos_mlag_vip for configuring MLAG VIP on Mellanox
network devices

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

* Remove unused variables

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

* Fix Test class name

* Fix Documentation

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

* Fix MAC address case-insensitive

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

* Fix MAC address unit-test

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Samer Deeb ad73bda323 Add new module mlnxos_protocol for enabling disabling protocols on MLNX-OS Mellanox network devices (#34286)
* Add new module mlnxos_protocol for enabling disabling protocols on
MLNX-OS Mellanox network devices

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

* Fix Test Class name

* Fix IP routing protocol support

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

* Add missing support for check_mode, and Fix documentation

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Samer Deeb 943107b1b9 Add new module mlnxos_facts for retrieving facts of MLNX-OS Mellanox network devices (#34287)
* Add new module mlnxos_facts for retrieving facts of MLNX-OS Mellanox
network devices

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

* Fix Documenation and Examples

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