Commit Graph

1383 Commits (e9dbebfa57187dea49631ea1669ec9c0c244cd3a)

Author SHA1 Message Date
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
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>
7 years ago
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>
7 years ago
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>
7 years ago
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
7 years ago
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)
7 years ago
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
7 years ago
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
7 years ago
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.
7 years ago
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>
7 years ago
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!
7 years ago
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
7 years ago
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
7 years ago
Brian Coca d61742147f fixed test to new sig 7 years ago
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.
7 years ago
Tim Rupp bdafb42156
Refactors the bigip_sys_global module (#34438)
Changes include the current f5 coding standards and unit tests
for the module
7 years ago
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.
7 years ago
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
7 years ago
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.
7 years ago
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
7 years ago
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
7 years ago
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>
7 years ago
Samer Deeb 42d5aeec3e Add support for vlan and loopback interfaces in mlnxos_interface (#34323)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Samer Deeb 52bea8dab6 Add new module mlnxos_mlag_ipl for managing IPL (inter-peer link) (#34326)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
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>
7 years ago
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>
7 years ago
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
7 years ago
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>
7 years ago
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>
7 years ago
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>
7 years ago
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>
7 years ago
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>
7 years ago
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.
7 years ago
Claes Nästén 5bd8a8f491 Add nso_query module to query Cisco NSO using XPath (#34188) 7 years ago
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.
7 years ago
Toshio Kuratomi 5a80375be9 Correct the AnsibleError exception to call its superclass's constructor 7 years ago
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.
7 years ago
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>
7 years ago
Pierre-Louis Bonicoli 737920cd89 YAML inventory unit test: add tests
Relates: #33878
7 years ago
Pierre-Louis Bonicoli 35a4fe8546 YAML inventory unit test: add tests 7 years ago
Pierre-Louis Bonicoli 8dff0b091e Fix YAML inventory unit test 7 years ago
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
7 years ago
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
7 years ago
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>
7 years ago
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
7 years ago
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
7 years ago
Trishna Guha 27be2a0f5a
Handle nxos platform diffs with cli conf implementation (#34020)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
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>
7 years ago
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
7 years ago
Pierre-Louis Bonicoli b94630a081 AnsibleModule.get_file_attributes: add unit test 7 years ago
Toshio Kuratomi 370a7ace4b
Split basic units (#33510)
Split the one monolithic test for basic.py into several files

* Split test_basic.py along categories.
  This is preliminary to get a handle on things.  Eventually we may want
  to further split it so each file is only testing a single function.
* Cleanup unused imports from splitting test_basic.py
* Port atomic_move test to pytest.
  Working on getting rid of need to maintain procenv
* Split a test of symbolic_mode_to_octal to follow unittest best practices
  Each test should only invoke the function under test once
* Port test_argument_spec to pytest.
* Fix suboptions failure
7 years ago
Claes Nästén 5fdb39c4d1 nso_verify for Cisco NSO (#33945)
Module for verifying that configuration is as expected in Cisco NSO.
7 years ago
Claes Nästén b2bc98c161 nso_action for Cisco NSO (#32781)
nso_action module for execution actions/RPCs in NSO.
7 years ago
Tim Rupp 22059cbe67
Adds bigip_device_httpd module (#33924)
this module can be used to adjust the details of the server that
hosts the BIG-IP web ui.
7 years ago
James Mighion f8e3cfe9e2 Aruba indenting (#33884)
* Fixing aruba's inconsitent indenting.

* Adding config with different children indentation and unit test to confirm the different spacing does not matter.

* Fixing pylint check. Missed an r prefix.
7 years ago
David Kretch 98260f9884 Fix pamd error when inserting a new rule at the end. Fixes #28487 (#28488)
* When inserting a new rule in `insert_after_rule`, check if the old rule is
the last rule, to avoid a list index out of range error when attempting to
access the next rule.
* Add a test for inserting a new rule after the last rule.
7 years ago
Will Thames 15a58d498d [cloud] Improve snake <-> camel conversion for AWS utils (#31400)
Allow CamelCase version of snake_dict_to_camel_dict
(currently only dromedaryCase is supported)

Add reversible option to camel_dict_to_snake_dict

Add tests for both of these options
7 years ago
John R Barker cfb15b0272 Revert "YAML inventory unit test: fix test inventory format (#33828)" (#33869)
This reverts commit dfb2f346d8.

https://github.com/ansible/ansible/pull/33828
7 years ago
Pilou dfb2f346d8 YAML inventory unit test: fix test inventory format (#33828)
* Fix YAML inventory unit test

* YAML inventory unit test: add checks

* YAML: add hosts without any group to ungrouped
7 years ago
Pilou 7c187cae93 Fix playbook cli unit test (#33767)
* TestPlaybookCLI: '--flush-cache' were ignored

Check that using '--flush-cache' does something

* check that '_flush_cache' does something

There isn't any fact by default: the assertion was true even if
'cli._flush_cache()' isn't called.
7 years ago
James Mighion 3a9083cf48 ios_config save (#33791)
* Fixing save so it still works. Adding changed as an option for save_when.

* Updating unit tests.

* Updating description to state that changed was added in 2.5.
7 years ago
Ganesh Nalawade ea18b9021a
Revert "Deprecate Entity, EntityCollection and use subspec in network modules (#33575)" (#33849)
This reverts commit 4349b56643.
7 years ago
Tim Rupp 9a807e6316
Adds bigip_security_port_list module (#33845)
This module can be used to manage port lists in an AFM configuration.
7 years ago
Tim Rupp cb026bb660
Adds bigip_profile_client_ssl module (#33844)
This module can be used to manage client ssl profiles on a BIG-IP
7 years ago
Toshio Kuratomi 155f36bbd8
Rekey on member (#33836)
* Change cast_list_to_dict to more generic rekey_on_member

cast_list_to_dict was taking an arbitrary data format in and returning
an arbitrary data format out.  Rework this to be a more generic function
which creates a dict of dicts based on a member of the dict.

Remove cast_dict_to_list since rekey_on_member handles the use cases we
know about and cast_dict_to_list suffers from the same problems as
cast_list_to_dict.  If this is still needed we could think about filters
we could add to do this in a short jinja2 pipeline.

* Fix bare excepts (bare excepts even catch sys.exit())
7 years ago
Matt Martz 5c63bb0090 Add test for clean_copy preservation of keys 7 years ago
Pilou 58fdbe7415 rhn_channel/register: Porting tests to pytest (#33719)
* rhn_channel/register: Porting tests to pytest

Related: #33387

* rhn unit tests: use mock_request as a fixture
7 years ago
Adrian Likins a57d6a4206 Use pop in cb clean results (#33779)
* Fix _clean_result for debug callback with 1 char var names

The check in _clean_results was removing any keys that happened
to be one of the chars in ('invocation') instead of the string
'invocation'. This was meant to be a tuple but there was no comma
so the for iterated the string instead of the tuple.

Introduced in 9dba580204

Update unit test to catch this.

Fixes #33723

* Use .pop() to remove invocation from results dict

In base callback _clean_results, simplify the way the
'invocation' item is removed.

Add some more unit tests.
7 years ago
Ganesh Nalawade 4349b56643
Deprecate Entity, EntityCollection and use subspec in network modules (#33575)
* Deprecate Entity, EntityCollection and use subspec in network modules

*  As per proposal https://github.com/ansible/proposals/issues/76
   deprecate use of Entity, EntityCollection, ComplexDict, ComplexList
   and use subspec instead.
*  Refactor ios modules
*  Refactor eos modules
*  Refactor vyos modules
*  Refactor nxos modules
*  Refactor iosxr modules
*  Add support for key in suboptions handling

* Fix CI issues
7 years ago
Tim Rupp 7b76124c07
Fixes for gtm wide ip (#33725)
Adds pools argument. Refactors code to support new conventions.
Adds more unit tests
7 years ago
Toshio Kuratomi b455901904
Fix shebang. shebang and interpreter path weren't being templated (#33698)
* Fix shebang.  shebang and interpreter path weren't being templated

Fixes #18665
Fixes #33696
7 years ago
Claes Nästén c8a5e689e3 Fix issue with setting values in choices (#33574) 7 years ago
Kedar Kekan 012a96dabd
code cleanup for `--diff` and `--check` modes (#33665)
* code cleanup for `--diff` and `--check` modes

* fixes UT to remove exec_command
7 years ago
Kedar Kekan 2bc4c4f156
IOS-XR NetConf and Cliconf plugin work (#33332)
*  - Netconf plugin addition for iosxr
 - Utilities refactoring to support netconf and cliconf
 - iosx_banner refactoring for netconf and cliconf
 - Integration testcases changes to accomodate above changes

* Fix sanity failures, shippable errors and review comments

* fix pep8 issue

* changes run_command method to send specific command args

* - Review comment fixes
- iosxr_command changes to remove ComplexDict based command_spec

* - Move namespaces removal method from utils to netconf plugin

* Minor refactoring in utils and change in deprecation message

* rewrite build_xml logic and import changes for new utils dir structure

* - Review comment changes and minor changes to documentation

* * refactor common code and docs updates
7 years ago
Evgeny Fedoruk e73d3dfe20 Fixing bug when returned 404 status code considered as invalid (#33530)
In case of workflow delete action, the returned 404 status code
considered as invalid although it's a valid code for not found (deleted)
entity.
Removed verification of the status. Only success should be verified.

Fixes #33524
7 years ago
Toshio Kuratomi cd36164239
Porting tests to pytest (#33387)
* Porting tests to pytest

* Achievement Get: No longer need mock/generator.py
  * Now done via pytest's parametrization
  * Port safe_eval to pytest
  * Port text tests to pytest
  * Port test_set_mode_if_different to pytest

* Change conftest AnsibleModule fixtures to be more flexible
  * Move the AnsibleModules fixtures to module_utils/conftest.py for sharing
  * Testing the argspec code requires:
    * injecting both the argspec and the arguments.
    * Patching the arguments into sys.stdin at a different level

* More porting to obsolete mock/procenv.py
  * Port run_command to pytest
  * Port known_hosts tests to pytest
  * Port safe_eval to pytest
  * Port test_distribution_version.py to pytest
  * Port test_log to pytest
  * Port test__log_invocation to pytest
  * Remove unneeded import of procenv in test_postgresql

* Port test_pip to pytest style
  * As part of this, create a pytest ansiblemodule fixture in
    modules/conftest.py.  This is slightly different than the
    approach taken in module_utils because here we need to override the
    AnsibleModule that the modules will inherit from instead of one that
    we're instantiating ourselves.

* Fixup usage of parametrization in test_deprecate_warn

* Check that the pip module failed in our test
7 years ago
Kaz Cheng 60b5c6890a [cloud] Add template_body parameter to cloudformation module to allow lookups (#33485) 7 years ago
Ganesh Nalawade 95044d69c7
Fix unit test failure for netconf connection plugin (#33547) 7 years ago
Ryan S. Brown 5087ce9273 Remove botocore from top-level execution in lambda_policy tests
Even though the tests are skipped, the `ClientError` uses outside the
test cause a failure even though the tests never run
7 years ago
Ganesh Nalawade 11c9ad23d5
Refactor common network shared and platform utils code into package (#33452)
* Refactor common network shared and platform specific code into package (part-1)

As per proposal #76 refactor common network shared and platform specific
code into sub-package.
https://github.com/ansible/proposals/issues/76

*  ansible.module_utils.network.common - command shared functions
*  ansible.module_utils.network.{{ platform }} - where platform is platform specific shared functions

*  Fix review comments

* Fix review comments
7 years ago
Tim Rupp 18aca48075
Various errors and formatting fixes (#33503)
* Various errors and formatting fixes

Mostly formatting fixes and small changes to better support debugging

* Fixes upstream errors
7 years ago
Tim Rupp 9f544cf926
Adds traffic group and fixes (#33502)
Adds the traffic group param. Adds conventions for updated f5
standards
7 years ago
Tim Rupp 00bf4ee210
routedomain fixes (#33501)
* routedomain fixes

Adds partition. Adds name. Makes name and id mutually exclusive.

* Fixes upstream errors
7 years ago
Tim Rupp dd94cc8229
Various bigip_selfip fixes (#33500)
* Various bigip_selfip fixes

Minor optimizations. Fixes address regex

* Fixing upstream errors
7 years ago
Tim Rupp df86d8f39e
Fixes ordered dict import (#33499)
Make it try to fallback to a pypi package if its not found in what
ships with python
7 years ago
Tim Rupp 07c9c28a06
Fixes for unit tests (#33498)
upstream unit tests broke downstream code. this rectifies that.
7 years ago
Tim Rupp da2e20ef45
Fixes various http monitor things (#33497)
Added token cleanup. Refactored a small amount of code. formatting
and cleanup of code.
7 years ago
Tim Rupp 798de98b0c
Adds hostname to remote-syslog (#33496)
* Adds hostname to remote-syslog

Previously, only an IP address wa allowed. This removes that restriction

* Fixes upstream errors
7 years ago
Tim Rupp a4aa00f556
Various bigip_user fixes (#33495)
There was a bit of refactoring that happened for coding standards.
Additionally, a bug fix was made for changing the root password
7 years ago
Tim Rupp bcda0db7db
Fixes tcp monitors (#33494)
* Fixes tcp monitors

Formatting fixes and a missing default parent. This patch fixes
that.

* Fixes upstream errors
7 years ago
Tim Rupp 212340bf0c
Fixes bug converning filenames with dots (#33493)
The name detminator was incorrect. This fixes it and fixes unit
tests related things that were broken downstream
7 years ago
Tim Rupp 1f1f1c9d04
Refactors bigip_node (#33492)
* Refactors bigip_node

Includes a number of fixes and enhancements in addition to refactoring
the code to be inline with f5 standards

* Fixes upstream errors
7 years ago
Tim Rupp 4f8f99479a
Various bigip policy fixes (#33491)
Test fixes, formatting, and added a difference checking method
7 years ago
Tim Rupp 008e23dcd1
Refactors bigip_sys_db (#33490)
Bringing it up to speed with the other f5 modules.
7 years ago
Tim Rupp 277d416b5b
Refactors bigip_vlan (#33489)
This patch adds tests and refactors the code to be inline with current
f5 coding standards
7 years ago
Tim Rupp 914829f56b
Adds bigip_monitor_snmp_dca module (#33483)
This module is a flavor of monitor for SNMP DCA's
7 years ago
Tim Rupp a2f19fbded
Adds bigip_policy_rule module (#33482)
* Adds bigip_policy_rule module

This module is the second component of managing LTM policies on
BIG-IP. This module lets you manage the rules of a policy

* Fixing upstream errors

* Correcting YAML errors
7 years ago
Tim Rupp abca68f5ac
Adds the bigip_monitor_udp module (#33481)
This module can be used to manage UDP monitors on a BIG-IP
7 years ago
Tim Rupp e3419fce87
Fixes and features for bigip_provision (#33480)
* Fixes and features for bigip_provision

Adds support for dedicated modules. Fixes bug in minimum name.
Adds wrappers around checking for up-ness so that they will contribute
to the watch loop

* Fixes upstream errors
7 years ago
Tim Rupp 2b1f056881
Fixes bugs in iapp template (#33478)
Fixes upstream bugs that broke downstream. Also fixes a name
matching error in the iApp's name
7 years ago
Tim Rupp f60b8a3abb
Fixes various things in bigip tests (#33477)
an upstream change was introduced that broke downstream code. This
path rectifies that error
7 years ago
Tim Rupp 1c373c112f
Minor fixes for gtm facts (#33476)
Removed unused code and fixed upstream changes that broke downstream
7 years ago
Tim Rupp e1062d1a7b
Refactors the gtm datacenter module (#33474)
* Refactors the gtm datacenter module

This module needed to be inline with current f5 coding standards.
This fixes that

* Fixes upstream errors
7 years ago
Tim Rupp 76135a500e
Refactors bigip device sshd (#33473)
* Refactors bigip device sshd

Fixes coding conventions for currect f5 conventions

* Fixes upstream errors
7 years ago
Tim Rupp a3b3dbe220
Refactors bigip_device_ntp (#33472)
* Refactors bigip_device_ntp

To be inline with current f5 conventions

* Fixed incorrect key
7 years ago
Tim Rupp 929a1df91d
Adds fixes to various bigip tests (#33471)
upstream changes broke downstream code. this rectifies that
7 years ago
Tim Rupp f6be12b5d8
Adds various fixes for bigip_config tests (#33470)
There were upstream changes that were incompatible with the downstream
code. This fixes those.
7 years ago
Samer Deeb 717b6e7c1a Add mlnxos_config module (#33356)
* Add new module mlnxos_config

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

* Add unit-test for mlnxos_config module

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Tim Rupp 5fa25a0288
Adds fixes to bigip_asm_policy (#33440)
Integrates some upstream changes that were made and fixes several
spacing and testing errors
7 years ago
Toshio Kuratomi e499bccbaa
Port some tests away from nose as examples (#33437)
We don't need to use both nose and pytest.  Once we get rid of all uses
of nose we can remove the extra dependency
7 years ago
R. Francis Smith e957760d52 updated pamd rule args regexp to match file paths also (#33432)
* Added . and / to rule args regexp

Things like pam_echo.so file=/etc/foo.txt weren't being matched and
causing incorrect change counts.  Adding / and . fixed that.

Fixes #33351

* pamd: test argument with value

Relates #33351
7 years ago
Anil Kumar Muraleedharan bada3afee9 Adding module enos_config and its UT files (#33081)
* Adding module enos_config and its UT files

* Removing trailing line

* Removing trailing lines

* Editing enos_module.py to fix build errors

* Removing blank lines in end

* Updating enos_config.py based on review comments

* Adding one more blank line

* Removing training white space

* Removing test_enos_config_force method from UT

* Updating documentation

* Comments by John, Remove version_added: "2.5"
7 years ago
Toshio Kuratomi aa7bd8bc11 Port AnsibleModule deprecate and warning tests to pytest (#33162) 7 years ago
Nathaniel Case a1da3dc997
Auth to become (#33319)
* terminal.on_(de)?authorize -> terminal.on_(un)?become

* Update network_cli

* Readd on_(de)?authorize as wrappers

* Update tests
7 years ago
George Nikolopoulos 34f965addd New module: Issue NITRO requests to a Netscaler instance (network/netscaler/netscaler_nitro_request) (#33091)
* Add netscaler_nitro_request module

* Make changes as requested.

* Fix whitepsace in EXAMPLES block.

* Set module changed status according to operation performed.
7 years ago
Alex Monteiro 2114278947 DatacenterFactsModule for HPE OneView (#32701)
* Added support to Datacenter resources in HPE OneView

* Adjusting comments in oneview_datacenter_facts

* Adding no_log on the documentation

* Using Pytest to Oneview DatacenterFactsModule tests
7 years ago
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
7 years ago
Samer Deeb cbf28c20cb Add Support for Mellanox switches: first module: mlnxos_command (#33121)
* Add Support for Mellanox switches: first module: mlnxos_command

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

* Add cliconf support for mlnxos

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

* 1- Fix short description, 2- remove waitfor

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

* remove usage of check_args

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Trishna Guha 25a465ffcb
loopback doesn't support passive_interface (#33252)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Ken Celenza 748107d369 Type manipulation (#28446)
* add type manipulation

* update for py3

* add tests for list to dict

* Add dict to list tests

* Update tests to search for regex in response

* pep8 clean up

* update Exception for py3

* update test to be py2/3 compat

* update for py26 compat

* potential fix for py3 and py26

* potential fix for py3 and py26 take2

* add new line to kick off shippable

* remove cache file created

* fix filter name

* add space for shipable
7 years ago
Ganesh Nalawade 3d63ecb6f3
Refactor junos modules to Use netconf and cliconf plugins (#32621)
* Fix junos integration test fixes as per connection refactor (#33050)

Refactor netconf connection plugin to work with netconf plugin

* Fix junos integration test fixes as per connection refactor (#33050)

Refactor netconf connection plugin to work with netconf plugin
Fix CI failure
Fix unit test failure
Fix review comments
7 years ago
James Cammarata d8ae4dfbf2 Adding aliases for field attributes and renaming async attribute (#33141)
* Adding aliases for field attributes and renaming async attribute

As of Python 3.7, the use of async raises an error, whereas before the use
of the reserved word was ignored. This adds an alias field for field attrs
so that both async and async_val (interally) work. This allows us to be
backwards-compatible with 3rd party plugins that may still reference Task.async,
but for the core engine to work on Py3.7+.

* Remove files fixed for 'async' usage from the python 3.7 skip list
7 years ago
jctanner 218987eac1
ANSIBLE_SSH_USETTY configuration option (#33148)
* Allow the user to circumvent adding -tt on ssh commands to help aid in
debugging ssh related problems.
* Move config to the plugin
* Set version_added
* Change yaml section to "connection"
* Fix ssh unit tests
7 years ago
Brian Coca ebd08d2a01 jsonify inventory (#32990)
* jsonify inventory
* smarter import, dont pass kwargs where not needed
* added datetime
* Eventual plan for json utilities to migrate to common/json_utils when we split
  basic.py no need to move jsonify to another file now as we'll do that later.
* json_dict_bytes_to_unicode and json_dict_unicode_to_bytes will also
  change names and move to common/text.py at that time (not to json).
  Their purpose is to recursively change the elements of a container
  (dict, list, set, tuple) into text or bytes, not to json encode or
  decode (they could be a generic precursor to that but are not limited
  to that.)
* Reimplement the private _SetEncoder which changes sets and datetimes
  into objects that are json serializable into a private function
  instead.  Functions are more flexible, less overhead, and simpler than
  an object.
* Remove code that handled simplejson-1.5.x and earlier.  Raise an error
  if that's the case instead.
  * We require python-2.6 or better which has the json module builtin to
    the stdlib.  So this is only an issue if the stdlib json has been
    overridden by a third party module and the simplejson on the system
    is 1.5.x or less.  (1.5 was released on 2007-01-18)
7 years ago
Matt Clay e45c763b64 Fix invalid string escape sequences. 7 years ago
Ganesh Nalawade 0ddf092ae3
Add new filter to parse xml output for network use cases (#31562)
* Add new filter to parse xml output for network use cases

Fixes #31026
*  Add parse_xml filter
*  Add documentation for parse_xml filter

* Edited for clarity.

* Fix review comment and add unit tests

* Fix unit test CI failure

* Fix CI issues

* Fix unit test failures

* Fix review comments

* More copy edits.
7 years ago
Corban Johnson d9a52db17d Adding RPC attribute parameters to junos_rpc network module (#32649)
* Adding RPC attribute arguments to `junos_rpc` network module.

* Specifying module argument version.

* Fixing DOCUMENTATION block.

* First attempt at new test fixture.

* Updated RPC_CLI_MAP.

* Use `result` instead of `reply`.
7 years ago
Mike Wiebe 95a2140f4b Use show command to support wider platform set for nxos_interface module (#33037)
* Use show command to support wider platform set

* Fix unit tests
7 years ago
Arnaud 84117e57ba nxos: 32 bits AS in as-dot format not recognized by regexp asn_regex (#30569)
* added test for 32 bits AS

* Lint not happy.
7 years ago
Tim Rupp c94d57311c
Adds bigip_vcmp_guest module (#33024)
This module can be used to manage guests on a vCMP provisioned BIG-IP.
vCMP is a hardware-only feature, therefore this module cannot be used
on the VE editions of BIG-IP.
7 years ago
Pilou a5c9726502 Unit tests: share common code (#31456)
* move set_module_args to units.modules.utils
* unit tests: reuse set_module_args
* unit tests: mock exit/fail_json in module.utils.ModuleTestCase
* unit tests: use module.utils.ModuleTestCase
* unit tests: fix 'import shadowed by loop variable'
7 years ago
Brian Coca 23b1dbacaf
Config continued (#31024)
* included inventory and callback in new config

allow inventory to be configurable
updated connection options settings
also updated winrm to work with new configs
removed now obsolete set_host_overrides
added notes for future bcoca, current one is just punting, it's future's problem
updated docs per feedback
added remove group/host methods to inv data
moved fact cache from data to constructed
cleaner/better options
fix when vars are added
extended ignore list to config dicts
updated paramiko connection docs
removed options from base that paramiko already handles
left the look option as it is used by other plugin types
resolve delegation
updated cache doc options
fixed test_script
better fragment merge for options
fixed proxy command
restore ini for proxy
normalized options
moved pipelining to class
updates for host_key_checking
restructured mixins

* fix typo
7 years ago
Tim Rupp 3f3c526026
Removes deprecated "append" param from snat pool (#32953)
This param was deprecated in 2.4 and slated for removal in 2.5. This
patch removes it.
7 years ago
Tim Rupp 0c1f493b6c
Adds module for managing bigip device connectivity (#32950)
This module is a critical part of the HA process for BIG-IPs.
7 years ago
Adrian Likins 86dc3c09ac
Fix vault --ask-vault-pass with no tty (#31493)
* Fix vault --ask-vault-pass with no tty

2.4.0 added a check for isatty() that would skip setting up interactive
vault password prompts if not running on a tty.

But... getpass.getpass() will fallback to reading from stdin if
it gets that far without a tty. Since 2.4.0 skipped the interactive
prompts / getpass.getpass() in that case, it would never get a chance
to fall back to stdin.

So if 'echo $VAULT_PASSWORD| ansible-playbook --ask-vault-pass site.yml'
was ran without a tty (ie, from a jenkins job or via the vagrant
ansible provisioner) the 2.4 behavior was different than 2.3. 2.4
would never read the password from stdin, resulting in a vault password
error like:

        ERROR! Attempting to decrypt but no vault secrets found

Fix is just to always call the interactive password prompts based
on getpass.getpass() on --ask-vault-pass or --vault-id @prompt and
let getpass sort it out.

* up test_prompt_no_tty to expect prompt with no tty

We do call the PromptSecret class if there is no tty, but
we are back to expecting it to read from stdin in that case.

* Fix logic for when to auto-prompt vault pass

If --ask-vault-pass is used, then pretty much always
prompt.

If it is not used, then prompt if there are no other
vault ids provided and 'auto_prompt==True'.

Fixes vagrant bug https://github.com/hashicorp/vagrant/issues/9033

Fixes #30993
7 years ago
Trishna Guha 3ee2501c83
multiple fixes nxos (#32903)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Anil Kumar Muraleedharan 177a4fb3ec Adding enos_command module and unit test (#32782)
* Adding git_command module and its UT file

* Changing Author Name and removing 2 blank lines

* Removing blank lines

* Adding enos_config and its UT files

* Removing config module as I am allowed to have only module per PR

* Work on Ganesh's Review comments

* John Review Comments on enos_command.py

* Review comments of John
7 years ago
Trishna Guha c40de24e9c
fix mtu check nxos_interface (#32880)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha f49555d494
nxos_bgp_neighbor_af feature idea disable-peer-as-check (#32665)
* nxos_bgp_neighbor_af feature idea disable-peer-as-check

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

* Add unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha e4052c1261
Add mtu option nxos_interface feature idea (#32680)
* Add mtu option nxos_interface feature idea

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

* Add unit test for mtu feature

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Adrian Likins 9c58827410
Better handling of malformed vault data envelope (#32515)
* Better handling of malformed vault data envelope

If an embedded vaulted variable ('!vault' in yaml)
had an invalid format, it would eventually cause
an error for seemingly unrelated reasons.
"Invalid" meaning not valid hexlify (extra chars,
non-hex chars, etc).

For ex, if a host_vars file had invalid vault format
variables, on py2, it would cause an error like:

  'ansible.vars.hostvars.HostVars object' has no
  attribute u'broken.example.com'

Depending on where the invalid vault is, it could
also cause "VARIABLE IS NOT DEFINED!". The behavior
can also change if ansible-playbook is py2 or py3.

Root cause is errors from binascii.unhexlify() not
being handled consistently.

Fix is to add a AnsibleVaultFormatError exception and
raise it on any unhexlify() errors and to handle it
properly elsewhere.

Add a _unhexlify() that try/excepts around a binascii.unhexlify()
and raises an AnsibleVaultFormatError on invalid vault data.
This is so the same exception type is always raised for this
case. Previous it was different between py2 and py3.

binascii.unhexlify() raises a binascii.Error if the hexlified
blobs in a vault data blob are invalid.

On py2, binascii.Error is a subclass of Exception.
On py3, binascii.Error is a subclass of TypeError

When decrypting content of vault encrypted variables,
if a binascii.Error is raised it propagates up to
playbook.base.Base.post_validate(). post_validate()
handles exceptions for TypeErrors but not for
base Exception subclasses (like py2 binascii.Error).

* Add a display.warning on vault format errors
* Unit tests for _unhexlify, parse_vaulttext*
* Add intg test cases for invalid vault formats

Fixes #28038
7 years ago
Frederic Lepied 35f79370e1 mock ncclient import in test_connection.py (#32786) 7 years ago
Nathaniel Case 9c0275a879
Connection plugins network_cli and netconf (#32521)
* implements jsonrpc message passing for ansible-connection

* implements more generic mechanism for persistent connections
* starts persistent connection in task_executor if enabled and supported
* supports using network_cli as top level connection plugin
* enhances logging for persistent connection to stdout

* Update action plugins

* Fix Python3 RPC

* Fix Junos bytes<-->str issues

* supports using netconf as top level connection plugin

* Error message when running netconf on an unsupported platform
* Update tests

* Fix `authorize: yes` for `connection: local`

* Handle potentially JSON data in terminal

* Add clarifying detail if possible on ConnectionError
7 years ago
Ganesh Nalawade 37b0537279
Fix ios_config file prompt issue (#32744)
Fixes #23263

Add a carriage return (\r) at end on copy config
command which results in prompt on cli terminal
7 years ago
Brian Coca db749de5b8 namespace facts
updated action plugins to use new guranteed facts
updated tests to new data clean
added cases for ansible_local and some docstrings
7 years ago
cnasten f1fe467c22 nso_config module for setting configuration in Cisco NSO (#30973) 7 years ago
Evgeny Fedoruk 59b49329b1 Module for running templates and workflows on vDirect (#31243)
Modure for running configuration templates and workflows on Radware vDirect server
7 years ago
Evgeny Fedoruk a06f06a9a3 Module for committing pending configuration on Radware devices (#31776)
With this module, pending configurations can be commited
on Radware ADC devices.
7 years ago
Anil Kumar Muraleedharan 9d98452032 New enos_facts, + module_utils/enos.py. modifying copyright year in rest all (#31696)
* Squashing all commits to one as suggested by John

* Adding Unit test method for the module enos_facts.py

* Pep8 and Ylint issues addressed

* Trying again to remove blank line. Some scripts are required for this.

* Bug Fixing for interfaces

* Editing for over indenting issue

* E203 whitespace before ','

* Update enos.py

Added warnings argument as to check_args method

* Update enos_facts.py

Added warnings to check_args method
7 years ago
paulquack a5da2e44a1 ironware_config module (#32187) 7 years ago
paulquack 806f43a9c0 ironware_facts module (#32186) 7 years ago
Tim Rupp 2bf6ac6c78
Adds bigip_device_trust module (#32608)
This module can be used to manage trusts between two bigip devices.
7 years ago
James Mighion 749197b436 Updating the options to allow decryption and new save_when. (#32602) 7 years ago
Tim Rupp 06363f6ede
Removes bigip_snmp from skip file (#32530) 7 years ago
Tim Rupp 53940670fd
Removes bigip_qkview from skip file (#32529) 7 years ago
Tim Rupp 45787f6ef2
Removes bigip_provision from skip file (#32525) 7 years ago
Tim Rupp ab71a9de14
Removes bigip_irule from the skip file (#32509) 7 years ago
Jonathan Nuñez 67b1d0f274 CloudFormation module: get StackEvents when ClientRequestToken is not used (#32434)
* When getting the stack events we need to consider the case where we don't have ClientRequestToken fixes #32396

* Adding tests for the case when the ClientRequestToken is not present in the stack creation.

* Renaming the stack that the test for Client Request Token requires so it won't cause collisions with the basic test.
7 years ago
Pilou 43914b3837 Fix include_role unit tests (#31920)
* Ensure include_role unit tests check something

This is not the case: get_tasks_vars doesn't yield

* Fix include_role unit tests

Since e609618274, include_role are not
static anymore.
7 years ago
Tim Rupp 6b6df43eae
Removes bigip_iapp_template from the skip file (#32488) 7 years ago
Tim Rupp 015baf5149
Removes bigip_iapp_service from skip list (#32482) 7 years ago
Tim Rupp 60281b85fe
Refactored bigip_device_dns (#32483)
Module was using old coding standards. This updates the module
7 years ago
Tim Rupp cbc5c2d556
Removes bigip_hostname from skip file (#32479) 7 years ago
Tim Rupp d5d4683047
Removes bigip_snmp_trap from skip file (#32470) 7 years ago
Tim Rupp e3f1198a67
Removes bigip_ucs from skip file (#32462) 7 years ago
Tim Rupp 27188d46a9
Adds bigip_iapplx_package module (#32456)
This module can be used to manage the iAppLX packages you have
installed on a device. It can install and remove packages in
their RPM format.
7 years ago
Tim Rupp c239749052
Removes bigip_user from skip file (#32451) 7 years ago
Tim Rupp 83674af284
Removes virtual_address from skip file (#32425) 7 years ago
Dave Thelen 2c99cbc874 eos_eapi: adding the desired state config to the new vrf fixes #32111 (#32112)
* adding the desired state config to the new vrf fixes #32111

* fix default vrf initial configured

* add unit test
7 years ago
Sébastien DA ROCHA bc4ba6b638 Iptables unit tests (#30762)
* Add some tests for iptables

* Fix remove bug (calls 2 times check to remove a chain)

* Add me as maintainer

* Fix PEP8

* Doc: Give more information on issue #18988

* Fix #18988 and test it

* Fix doc (thanks Pillou)

* enable PEP8 check for iptables
7 years ago
Tim Rupp fc4580b4cc
Removes bigip ssl certificate from skip file (#32424) 7 years ago
Tim Rupp 6193d5bc65
Removes gtm wide ip from skip file (#32422) 7 years ago
Tim Rupp 8868b5fa85
Removes gtm pool from skip file (#32419) 7 years ago
Tim Rupp daaf8ca86c
Fixes skip imports for bigip_configsync_action module (#32413) 7 years ago
Tim Rupp 8f2b243a3e
Fixes bigip_config to remove from skip file (#32409) 7 years ago
Tim Rupp 8c5cd9c530
Removes bigip_command from the skip file (#32407)
Includes fixes and enhancements to make it unnecessary to include this
module in the skip file
7 years ago
Tim Rupp 8037eb7474
Various fixes for bigip_remote_syslog (#32404)
This patch addresses a number of issues, large and small, that were
identified by users in the downstream repo.

* formatting of some code
* specific option combinations leading to errors
* missing includes for unit tests
7 years ago
Paul Neumann 53fead7c96 ios_logging: Fix some smaller issues, add unit test (#32321)
* ios_logging: Fix typo in documentation

* ios_logging: Fix traceback when setting buffered destination without size

When the size parameter is not configured while configuring the buffered
destination, a traceback occurs due to the fact that validate_size expects the
parameter to be an int. Explicitely converting value to int makes the
check work for every case.

* ios_logging: Update size parameter documentation

Update the documentation of the size paramter to reflect the current behaviour
of setting a default of 4096 for the buffered dest.

* ios_logging: Add unit test

Add unit test for ios_logging testing the behaviour clarified in the previous
commits.

* ios_logging: Fix python 2.6 compliance
7 years ago
Ken Evensen 8724ff3eae pamd: fix issue with trailing commas in module_arguments 7 years ago
Paul Neumann 87f663b950 ios_system: Fix typo in unit test (#32284) 7 years ago
Tim Rupp 2a5f6c28cf
Adds bigip_asm_policy module (#32281)
This module can be used to import asm policies from file or existing
template. Supported file types are xml, compact xml, and binary
7 years ago
Tim Rupp a16db95ddb
Adds the bigip_ssl_key module (#32270)
This module's purpose is to specifically manage the ssl keys. It
is essentially the key component of the bigip_ssl_certificate module.
The modules were separated and the key portion deprecated from
bigip_ssl_certificate in favor of this module.
7 years ago
Tim Rupp cc4bbb2929 Various bigip_pool fixes (#32161)
* corrects copyrights and mocks in unit tests
* fixes module code to include code to cleanup tokens
7 years ago
Kedar K e2bed36d12 - Adds iosxr_netconf module to configure netconf service on IOSXR (#31715)
* - Adds iosxr_netconf module to configure netcong service on Cisco
  IOS-XR devices

* - Adds Integration test for module
- Handles diff return from load_config

* - Adds unit test for iosxr_netconf module
7 years ago
Ryan Brown 11c225e039 Start using ClientRequestTokens in event lists (#31997)
* Start using ClientRequestTokens in event lists

* Include request token in all reqs that support it (basically all but check mode/changeset)

* Update placebo recordings

* Add comments for CRQ popping
7 years ago
Kedar K 465fe5802b -Fixes JSON parsing(use JSON object instead of string) for facts modules. (#31818) 7 years ago
Tim Rupp 965e4151df Adds the bigip_policy module (#31915)
this module allows one to manage policies and re-order their
corresponding rules
7 years ago
Tim Rupp 8085c38e05 Refactors the bigip_gtm_facts module (#31917)
Includes pep fixes and inlining code with current conventions
7 years ago
Tim Rupp f94d337ef6 Adds new module allowing you to wait for a bigip (#31846)
Module allows you to wait for a bigip device to be
"ready" for configuration. This module will wait for things like
the device coming online as well as the REST API and MCPD being
ready.

If all of the above is not online and ready, then no configuration
will be able to be made.
7 years ago
paulquack 5a6ee054c0 Network command module for Brocade IronWare routers (#31429) 7 years ago
Chris Meyers cf938e9992 tests for InventoryModule error conditions (#31381)
* tests for InventoryModule error conditions

* modified unicode in tests to ahear to Ansible best practices

* flake8 fixes
7 years ago
Brian Coca 01b6c7c9c6 better cleanup on task results display (#27175)
* better cleanup on task results display

callbacks get 'clean' copy of result objects
moved cleanup into result object itself
removed now redundant callback cleanup
moved no_log tests

* moved import as per feedback
7 years ago
Tim Rupp 02cd881697 Refactors bigip_selfip (#31732)
In this refactor we moved to the most recent coding standards for
both F5 and Ansible. Many bugs were fixed and some features were
also added (such as ipv6 support).
7 years ago
Tim Rupp 0610f09dab Adds various provision fixes (#31731)
* vcmp provisioning support
* documentation fixes
* fixes for python3 causing an exception
7 years ago
Tim Rupp 53445ded84 Fixes documentation related bugs (#31730)
New conventions for ansible warrant fixes to accomodate those
in bigip_partition.

This patch also includes an import fix that can raise an error when
Ansible unit tests run
7 years ago
Tim Rupp a969a529ab Fixes various gtm pool issues (#31728)
Various formatting related fixes. Also fixed an idempotency problem
with the 'disabled' state
7 years ago
Brian Coca 386515281e additional configmanager tests
left placeholders for more
7 years ago
Adrian Likins 297dfb1d50 Vault secrets script client inc new 'keyring' client (#27669)
This adds a new type of vault-password script  (a 'client') that takes advantage of and enhances the 
multiple vault password support.

If a vault password script basename ends with the name '-client', consider it a vault password script client. 

A vault password script 'client' just means that the script will take a '--vault-id' command line arg.

The previous vault password script (as invoked by --vault-password-file pointing to an executable) takes
no args and returns the password on stdout. But it doesnt know anything about --vault-id or multiple vault
passwords.

The new 'protocol' of the vault password script takes a cli arg ('--vault-id') so that it can lookup that specific
vault-id and return it's password.

Since existing vault password scripts don't know the new 'protocol', a way to distinguish password scripts
that do understand the protocol was needed.  The convention now is to consider password scripts that are
named like 'something-client.py' (and executable) to be vault password client scripts.

The new client scripts get invoked with the '--vault-id' they were requested for. An example:

     ansible-playbook --vault-id my_vault_id@contrib/vault/vault-keyring-client.py some_playbook.yml

That will cause the 'contrib/vault/vault-keyring-client.py' script to be invoked as:

     contrib/vault/vault-keyring-client.py --vault-id my_vault_id

The previous vault-keyring.py password script was extended to become vault-keyring-client.py. It uses
the python 'keyring' module to request secrets from various backends. The plain 'vault-keyring.py' script
would determine which key id and keyring name to use based on values that had to be set in ansible.cfg.
So it was also limited to one keyring name.

The new vault-keyring-client.py will request the secret for the vault id provided via the '--vault-id' option.
The script can be used without config and can be used for multiple keyring ids (and keyrings).

On success, a vault password client script will print the password to stdout and exit with a return code of 0.
If the 'client' script can't find a secret for the --vault-id, the script will exit with return code of 2 and print an error to stderr.
7 years ago
Tim Rupp ecee475a3a This patch fixes a number of outstanding bugs and code convention problems. (#31618)
* documentation was not inline with other Ansible modules
* Python 3 specific imports were missing
* monitor_type is no longer required when creating a new pool; it is now the default.
* A new monitor_type choice of "single" was added for a more intuitive way to specify "a single monitor". It uses "and_list" underneath, but provides additional checks to ensure that you are specifying only a single monitor.
* host and port arguments have been deprecated for now. Please use bigip_pool_member instead.
* 'partition' field was missing from documentation.
* A note that "python 2.7 or greater is required" has been added for those who were not aware that this applies for ALL F5 modules.
* Unit tests were fixed to support the above module
7 years ago
Tim Rupp 381b18fd80 Adds a refactored bigip_monitor_http module. (#30998)
This patch refactors the bigip_monitor_http module to use REST
instead of SOAP. It additionally adds unit tests and current F5
code conventions.

Integration tests can be found here
* https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_http.yaml
* https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_http/tasks
7 years ago
Brian Coca 12c8dd1893 config tests
also a couple of fixes to manager
7 years ago