Commit graph

1235 commits

Author SHA1 Message Date
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.
2018-01-23 12:02:09 -06:00
Tim Rupp
ad8ee4e60f
Removes a bogus key from fixtures (#35236) 2018-01-23 09:33:44 -08:00
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
2018-01-23 10:04:57 -06:00
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
2018-01-23 13:59:27 +00:00
Toshio Kuratomi
8c7bd8beb4 Set the tempdir on the shell mock object so that it is json serializable 2018-01-22 23:36:34 -08:00
Toshio Kuratomi
14c3b4d8e5 Move yaml loading functions from DataLoader into a utility module. 2018-01-22 16:54:53 -08:00
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.
2018-01-22 18:49:57 -05:00
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
2018-01-22 18:23:40 -05:00
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
2018-01-22 14:25:13 +00:00
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
2018-01-22 12:34:21 +00:00
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
2018-01-21 10:11:27 -08:00
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
2018-01-20 15:07:27 -05:00
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
2018-01-20 15:05:53 -05:00
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
2018-01-20 14:56:18 -05:00
Tim Rupp
ca8982f96c
Fixes some bugs and things (#35122)
Removes deprecations and fixes bugs.
2018-01-20 10:40:20 -08:00
Tim Rupp
90f0c411e4
Adds module for bigip_device_group_member (#35121)
Module allows for members to be managed in a device group
2018-01-19 20:57:41 -08:00
Tim Rupp
585d8cf4c7
Adds bigip_ucs_fetch module (#35113)
This module can be used to download UCS files from a BIG-IP
2018-01-19 20:25:47 -08:00
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
2018-01-19 11:07:47 -05:00
Matt Martz
29c1d5cb5d Ensure that the become password is written on py3 in the ssh connection plugin. Fixes #34727 2018-01-18 09:32:22 -08:00
Aron Szekely
943730b70c Update pamd.py to allow module path with slashes (#32197) 2018-01-18 09:57:12 +05:30
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
2018-01-17 13:23:27 -05:00
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
2018-01-17 09:33:20 -08:00
Kedar Kekan
93acd7c651 refactor iosxr_system for cliconf and netconf (#34749)
* * refactor iosxr_system for cliconf and netconf

* * Fix unit tests and sanity issues
2018-01-17 07:29:28 -07:00
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
2018-01-17 07:28:58 -07:00
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.
2018-01-16 20:10:36 -08:00
Tim Rupp
17d9ba304e
Adds module for bigip device group (#34958)
This module can be used to manage a device group on a bigip
2018-01-16 15:29:37 -08:00
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>
2018-01-16 08:58:40 +01:00
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
2018-01-15 21:15:04 -08:00
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
2018-01-15 09:49:58 -06:00
Trishna Guha
a65f702155
add config option to replace argument (#34342)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-15 21:17:02 +05:30
Tim Rupp
9aba711519
Adds bigip_static_route module (#34859)
This module can be used to manage static routes on a BIG-IP
2018-01-14 17:40:59 -08:00
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.
2018-01-12 23:03:41 -08:00
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.
2018-01-12 21:49:12 -08:00
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.
2018-01-12 14:43:35 -08:00
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.
2018-01-12 13:23:19 -08:00
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.
2018-01-12 12:08:49 -08:00
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.
2018-01-12 10:25:33 -08:00
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>
2018-01-11 22:21:17 +00:00
Samer Deeb
cb206abea3 Support advertised networks in bgp protocol (#34728)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-01-11 17:40:39 +00:00
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>
2018-01-11 17:40:04 +00:00
Trishna Guha
df8b01aaf7
Handle platform os version for sandbox nxos_nxapi (#34490)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-11 21:12:00 +05:30
Matt Clay
797664d9cb Python 2.6 str.format() compatibility fixes. 2018-01-10 14:08:11 -08:00
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>
2018-01-10 16:09:42 +00:00
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.
2018-01-10 00:57:11 -08:00
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
2018-01-09 20:09:25 -05:00
Matt Clay
cd205854a4 Fix Python 3.7 syntax error in tests. 2018-01-09 16:54:19 -08:00
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
2018-01-09 13:50:07 -06:00
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
2018-01-09 02:04:18 -05:00
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>
2018-01-08 13:37:21 -08:00
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>
2018-01-08 14:31:51 +00:00
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>
2018-01-08 14:30:30 +00:00
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>
2018-01-08 14:29:16 +00:00
Samer Deeb
9ed4661860 Add new module mlnxos_pfc_interface for managing priority flow control on Mellanox devices (#34327)
* Add new module mlnxos_pfc_interface for managing priority flow control
on Mellanox devices

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

* Remove unnecessary if, and Fix Documentation

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

* Fix missing interface status

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-01-08 13:43:10 +00:00
Trishna Guha
5e6b2495c0
Convert nxos_vrf to DI module (#34274)
* Convert nxos_vrf to DI module

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

* Add purge example and improve logic

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

* revert version_added for rd param

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

* update test to use network_cli

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-08 10:10:34 +05:30
Samer Deeb
5edb800b6d Remove unnecessary if, and Fix Documentation (#34413)
* Remove unnecessary if, and Fix Documentation

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

* Fix aggregate spec for l2 interface

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

* Add aggregste test for l2 interface

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

* Fix MAC address case

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-01-07 08:35:50 +00:00
Tim Rupp
2916ff0a1a
Introduces numerous fixes for bigip command (#34550)
A bug in the parsing of single commands with commas
Token cleanup
Password argument now defaults to false
Addition of coding conventions from v3 conventions
2018-01-06 23:23:32 -08:00
Tim Rupp
f4a2b0b103
Adds the bigiq_regkey_license module (#34543)
This module can be used to add license offerings to a pool. This
is the second part required to license a remote device from a
BIG-IQ (the first being to create a pool with bigiq_regkey_pool)
2018-01-06 12:13:50 -08:00
Tim Rupp
8c07ebe860
Adds bigiq regkey pool module (#34542)
This module can be used to manage the containers of regkeys
that exist on a BIG-IQ
2018-01-06 11:34:14 -08:00
Tim Rupp
803e4124b6
Removes deprecated code from bigip_monitor_tcp (#34520)
* Removes deprecated code from bigip_monitor_tcp

The deprecated code was moved into its own modules. We let it lay
here for a release, and now I'm removing it.

* Fixing upstreaming tests
2018-01-05 15:22:50 -08:00
Tim Rupp
e9bb5da37e
Adds the bigip_gtm_server module (#34513)
This module can be used to create GTM servers (not to be confused with
GTM virtual servers) on a BIGIP. GTM servers are a component of the
datacenter, and GTM virtual servers are their members.
2018-01-05 13:51:15 -08:00
Trishna Guha
9d2182bcf8 Deprecate nxos_switchport and Add nxos_l2_interface DI module (#33813)
* Deprecate nxos_switchport

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

* Add nxos_l2_interface DI module

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

* pep8 fixes

* aggregate test for nxos_l2_interface

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

* revert nxos_switchport test change

* gundalow's comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-05 07:44:02 +00:00
Pilou
e9df2083a3 If check mode enabled and file missing set changed to true 32676 (#33967)
* basic.py: add mock to os.path.exists

* set_*_if_different: if check_mode enabled & file missing: set changed to True

Fixes #32676
Thanks to mscherer and Spredzy for the distributed triplet programming
session!
2018-01-04 20:33:14 -08:00
Matt Martz
aece0818c4
Don't cache duplicate plugin names (#34420)
* Don't cache duplicate plugin names. Fixes #33484

* Add tests for duplicate plugin filenames, to showcase what happens
2018-01-04 16:47:23 -06:00
Pilou
26d20ec194 galaxy unit tests: add missing arg (#33766)
* galaxy unit tests: add missing program name

* galaxy unit tests: remove incorrect switchs

- 'install' action doesn't support '--offline' switch
- 'remove' action doesn't support '--init-path' switch
2018-01-04 09:16:56 -08:00
Brian Coca
d61742147f fixed test to new sig 2018-01-04 11:20:56 -05:00
Tim Rupp
6c97c340ea
Various bigip_gtm_datacenter fixes (#34440)
Code refactor to use f5 coding conventions. Removed deprecated
"enabled/disabled" params (this is now a state). Adds token cleanup
for cases where many api calls are made.
2018-01-03 21:18:34 -08:00
Tim Rupp
bdafb42156
Refactors the bigip_sys_global module (#34438)
Changes include the current f5 coding standards and unit tests
for the module
2018-01-03 20:39:08 -08:00
Tim Rupp
9bd4070bdf
Adds bigip_traffic_group module (#34436)
This module can be used to create and remove traffic groups. Managing
members of the group is not yet supported.
2018-01-03 20:26:18 -08:00
Tim Rupp
c132b977e8
Refactors bigip_virtual_server (#34412)
This refactors the bigip_virtual_server module to address several issues and
missing features. Additionally it adds tests and updates the coding standards
to the recent version used by f5. Finally, it removes deprecated items that
were announced in 2.4
2018-01-03 13:42:17 -08:00
Tim Rupp
9e4aed15ff
Adds bigip_software_update module (#34410)
This module can be used to adjust the ways by which a bigip communicates
back to F5 to check for system updates.
2018-01-03 11:30:11 -08:00
bdowling
552d1df901 Adds parents to mutually_exclusive with src for *_config modules (#33957)
* mutually_exclusive add - ios_config parents works with lines by not src

* mutually_execlusive parents,src added to all other net modules

* tests for mutually_exclusive parents,src and whitespce removal
2018-01-03 09:47:12 -05:00
Jim Pfleger
af236f2531 Accept other ios_banner types (#33961)
* Accept other ios_banner types

* Use 2.6-compatible format string

* Doc option values prior to this update
2018-01-03 14:38:14 +00:00
Samer Deeb
1afd076dac Add new module mlnxos_magp for managing MAGP protocol on Mellanox (#34307)
MLMX-OS network devices

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-01-03 12:43:46 +00:00
Samer Deeb
42d5aeec3e Add support for vlan and loopback interfaces in mlnxos_interface (#34323)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-01-03 12:43:13 +00:00
Samer Deeb
52bea8dab6 Add new module mlnxos_mlag_ipl for managing IPL (inter-peer link) (#34326)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-01-03 12:41:26 +00:00
Abhijeet Kasurde
5496326c4d nmcli: Add 'generic' connection type (#34251)
This fix adds 'generic' connection type in nmcli module.

Fixes: #33648

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-02 12:37:22 +01:00
Samer Deeb
585b3449c6 Add module mlnxos_lldp_interface for managing lldp interfaces configuration (#34179)
* Add module mlnxos_lldp_interface for managing lldp interfaces
configuration

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

* Fix unit test

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2017-12-29 10:51:31 +05:30
Samer Deeb
84a10903db Add module mlnxos_linkagg for configuring LAG and MLAG on Mellanox switches (#34204)
* Add module mlnxos_linkagg for configuring LAG and MLAG on Mellanox
switches

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

* Remove unnecessary  method in unit-test

remove _execute_module and use execute_module from base class
2017-12-29 09:03:45 +05:30
Trishna Guha
80ba767204
Convert nxos_interface to DI (#34240)
* Convert nxos_interface to DI

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

* Add integration test

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

* commit for ganeshrn's comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-12-28 16:41:09 +05:30
Samer Deeb
89670133c1 Module mlnxos_l3_interface (#34199)
* Add module mlnxos_l3_interface for configuring L3 on Mellanox switches

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

* Rename test class

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2017-12-25 13:21:40 +05:30
Samer Deeb
8ddb84a155 Add module mlnxos_vlan for supporting vlan configuration on Mellanox switches (#34113)
* Add module mlnxos_vlan for supporting vlan configuration on Mellanox
switches

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

* use sgort header and fix METADATA

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2017-12-23 12:11:25 +05:30
Samer Deeb
dbcfea587c Add module mlnxos_l2_interface for supporting configuration of L2 interfaces on Mellanox switches (#34158)
* Add module mlnxos_l2_interface for supporting configuration of L2
interfaces on Mellanox switches

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

* use shorter header and fix METADATA

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2017-12-23 11:24:35 +05:30
Samer Deeb
0deda64231 Add module mlnxos_lldp for supporting configuration of LLDP protocol on Mellanox switches (#34159)
* Add module mlnxos_lldp for supporting configuration of LLDP protocol on Mellanox switches

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

* Fix header and metadata

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

* Fix imports

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2017-12-23 10:54:05 +05:30
Tim Rupp
75fbfb9e36
Fixes and additions to bigip_pool (#34205)
Removes deprecated host/port params. Adds metadata param. Adds new
classes to better support refactoring and maintenance.
2017-12-22 12:39:19 -08:00
Claes Nästén
5bd8a8f491 Add nso_query module to query Cisco NSO using XPath (#34188) 2017-12-22 16:56:50 +00:00
Claes Nästén
d6fd9703f1 Add nso_show module for Cisco NSO (#34142)
* update version parsing and move requirements to nso_* modules

prepare for introduction of nso_show module that has other version
requirements than the existing nso_* modules.

* Add nso_show module for retreiving config from Cisco NSO

New module that supports getting configuration and operational data
from Cisco NSO.
2017-12-22 09:43:22 +00:00
Toshio Kuratomi
5a80375be9 Correct the AnsibleError exception to call its superclass's constructor 2017-12-21 20:42:44 -08:00
Toshio Kuratomi
235bdfb996 Remove shell module specialcases
Shell is implemented via the command module.  There was a special case
in mod_args to do that.  Make shell into an action plugin to handle that
instead.

Also move the special case for the command nanny into a command module
action plugin.  This is more appropriate as we then do not have to send
a parameter that is only for the command module to every single module.
2017-12-21 20:42:44 -08:00
Trishna Guha
60f3649ebd
Convert nxos_vlan to DI module (#31866)
* Convert nxos_vlan to DI

* fix conflict

* push fix for qalthos's comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-12-21 14:08:33 +05:30
Pierre-Louis Bonicoli
737920cd89 YAML inventory unit test: add tests
Relates: #33878
2017-12-20 16:59:53 -05:00
Pierre-Louis Bonicoli
35a4fe8546 YAML inventory unit test: add tests 2017-12-20 16:59:53 -05:00
Pierre-Louis Bonicoli
8dff0b091e Fix YAML inventory unit test 2017-12-20 16:59:53 -05:00
Sloane Hertel
d877c146ab [cloud] ec2_group fix CIDR with host bits set - fixes #25403 (#29605)
* WIP adds network subnetting functions

* adds functions to convert between netmask and masklen
* adds functions to verify netmask and masklen
* adds function to dtermine network and subnet from address / mask pair

* network_common: add a function to get the first 48 bits in a IPv6 address.

ec2_group: only use network bits of a CIDR.

* Add tests for CIDRs with host bits set.

* ec2_group: add warning if CIDR isn't the networking address.

* Fix pep8.

* Improve wording.

* fix import for network utils

* Update tests to use pytest instead of unittest

* add test for to_ipv6_network()

* Fix PEP8
2017-12-20 14:57:47 -05:00
Nathaniel Case
cb1b705218
ios integration tests to network_cli (#33920)
* Preliminary steps

* Fix Python3 network_cli ios

* Add connection to debug strings

* Fix ios confirm prompt by way of optional newline

Also update ios_user delete tests
2017-12-20 09:03:29 -05:00
Fedor Sumkin
8a9865cb10 Fix for dns4 empty setting (#30757)
This fix check if DNS4 is None or not before proceeding with
other operations. Also, added unit test for this change.

Signed-off-by: Fedor Sumkin <qosys.net@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-12-20 12:48:22 +05:30
Trishna Guha
be89822bb5
Deprecate nxos_portchannel and add nxos_linkagg DI module (#33376)
* deprecate nxos_portchannel

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

* Add nxos_linkagg DI module

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

* remove nxos_portchannel unit test

* fix syntax issues

* fix ansible-doc failure

* update nxos_portchannel unittest

* minor fixes and integration test

* update nxos_linkagg
2017-12-20 11:26:07 +05:30
Trishna Guha
3cce8dfafd
Deprecate nxos_ip_interface and Add nxos_l3_interface DI module (#33866)
* Deprecate nxos_ip_interface module

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

* Add nxos_l3_interface DI module

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

* Add integration test

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

* pep8 fixes

* Add nxapi cli test

* Improve complexity

* manage layer3 interface

* fix unit test
2017-12-20 11:07:23 +05:30
Trishna Guha
27be2a0f5a
Handle nxos platform diffs with cli conf implementation (#34020)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-12-20 10:41:10 +05:30
Samer Deeb
1df57ac1ac Add mlnxos_interface module (#33839)
* Add new module: mlnxos_interface for configuring mlnxos ethernet
interfaces

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

* Update mlnxos.py

* Fix Documentation

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

* Add missing documentation

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2017-12-19 17:24:42 +00:00
Trishna Guha
9f86b923e9
[CLI_CONF] Refactor nxos module common library to use cliconf plugin (#31524)
* refactor nxos modules

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

* get_config update

* fix get_config

* update nxos module

* device_info

* fix conflict

* add failure message check

* pep8 fixes

* use get_capabilities to check cliconf

* Add logic to detect platform in get_capabilities and cache in module_utils

* return msg in edit_config

* fix conflicts

* make modules compatible

* fix nxos cliconf api

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

* cache capabilities

* Update transport queries to get_capabilities in module level

* fix unit tests

* load_config error code

* remove unnecessary change

* Refactor nxos_install_os module
2017-12-19 12:22:33 +05:30