Commit Graph

1768 Commits (f55481863d320e7ec5a8c2a0d273dfa0a07b8d7f)

Author SHA1 Message Date
Chris Archibald 39b1f1c363 Rewrite (#49570) 6 years ago
Sumit Jaiswal f76d7bdbef
New Module for creating, managing Infoblox NIOS nameserver groups (#49124)
* adding new nios_nsgroup module

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* adding new nios_nsgroup module

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* adding new nios_nsgroup module

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fix shippable errors

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* added unit tests

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
6 years ago
Anil Kumar Muraleedharan eab3b02cb3 Refactoring of cnos_interface module like what followed by other vendors (#49927)
* Refactoring of cnos_interface module like what followed by other vendors

* To remove cnos-interface from E326 validation ignore list

* Effect of default parameters impacted UT
6 years ago
rajaspachipulusu17 afdd4e2343 Pluribus Networks dhcp filter module with unit tests (#49848)
* Pluribus Networks dhcp filter module with unit tests
* Added type which was missing in doc
* Removed unwanted global variable
* Fix return type
6 years ago
rajaspachipulusu17 8ca02d8359 Pluribus Networks admin service module with unit tests (#49854)
* Pluribus Networks admin service module with unit tests
* Documentation fix
* import module changes
* Removed unused imports
* Fix return type
6 years ago
Wojciech Wypior 59f4871615 added bigip_asm_policy_manage (#50115)
* added bigip_asm_policy_manage

* Update bigip_asm_policy_manage.py
6 years ago
Wojciech Wypior f761cc4077 added ASM policy server technology module (#50116)
* added ASM policy server technology module

* Update bigip_asm_policy_server_technology.py
6 years ago
Toshio Kuratomi bd072fe83a
Make the timeout decorator raise an exception out of the function's scope (#49921)
* Revert "allow caller to deal with timeout (#49449)"

This reverts commit 63279823a7.

Flawed on many levels

* Adds poor API to a public function
* Papers over the fact that the public function is doing something bad
  by catching exceptions it cannot handle in the first place
* Papers over the real cause of the issue which is a bug in the timeout
  decorator
* Doesn't reraise properly
* Catches the wrong exception

Fixes #49824
Fixes #49817

* Make the timeout decorator properly raise an exception outside of the function's scope

signal handlers which raise exceptions will never work well because the
exception can be raised anywhere in the called code.  This leads to
exception race conditions where the exceptions could end up being
hanlded by unintended pieces of the called code.

The timeout decorator was using just that idiom.  It was especially bad
because the decorator syntactically occurs outside of the called code
but because of the signal handler, the exception was being raised inside
of the called code.

This change uses a thread instead of a signal to manage the timeout in
parallel to the execution of the decorated function.  Since raising of
the exception happens inside of the decorator, now, instead of inside of
a signal handler, the timeout exception is raised from outside of the
called code as expected which makes reasoning about where exceptions are
to be expected intuitive again.

Fixes #43884

* Add a common case test.

Adding an integration test driven from our unittests.  Most of the time
we'll timeout in run_command which is running things in a subprocess.
Create a test for that specific case in case anything funky comes up
between threading and execve.

* Don't use OSError-based TimeoutError as a base class

Unlike most standard exceptions, OSError has a specific parameter list
with specific meanings.  Instead follow the example of other stdlib
functions, concurrent.futures and multiprocessing and define a separate
TimeoutException.

* Add comment and docstring to point out that this is not hte Python3 TimeoutError
6 years ago
Yannig Perré 6b41588e93 Fix with_ini example and unittest
* Fix example in ini.py
* Fix unittest in test_ini.py to pass CI as latest ansible returns list in
  different order. To prevent such issues in future results are sorted
* PEP8 E501 styling improvements

Co-Authored-By: Sergii Golovatiuk <sgolovat@redhat.com>
6 years ago
Abhijeet Kasurde 139e3477a7 Review comments
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 44bd8fc0a8 Update unit tests for configmanager
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
rajaspachipulusu17 d28e700a22 Pluribus networks admin session timeout module with unit tests (#50012)
* Pluribus networks admin session timeout module with unit tests
* Doc fix
* Removed unused imports
* Removed unwanted global variable
6 years ago
rajaspachipulusu17 cf00880ab3 Pluribus Networks dscp map module with unit tests (#49849)
* Pluribus Networks dscp map module with unit tests
* Doc string fix
6 years ago
rajaspachipulusu17 4d88cdd83a Pluribus Networks cpu class module with unit tests (#49847)
* Pluribus Networks cpu class module with unit tests
* Doc string fixes
6 years ago
Matt Martz 7eb1ab45a7
Allow tags to be templated from a variable (#49833)
* Allow tags to be templated from a variable. Fixes #49825

* Restore _load_tags to ensure we do csv tag splitting

* Add tests for csv tags and templated tags

* evaluate_tags doesn't need to accept strings, because _load_tags handles this
6 years ago
Toshio Kuratomi 61b1daa65f Port from plaform.dist to ansible.module_utils.distro.linux_distribution
ci_complete
6 years ago
Adrian Likins e872811b8d WIP: add tests to compare to platform.*dist
Can be removed once everything is ported.
6 years ago
Adrian Likins 5e1f8a48f3 Bundle a copy of github.com/nir0s/distro/distro.py
Since the 'platform.dist()' and 'platform.linux_distribution()'
methods will be removed from future versions of python, this
provides an alternative to replace ansibles use of those
methods.

lib/ansible/module_utils/distro.py is a copy of
https://github.com/nir0s/distro/blob/master/distro.py

This module is originally from https://github.com/nir0s/distro
and is license under the Apache License, Version 2.0.
6 years ago
f-bor 134c1a624e new network module: edgeswitch_vlan (#48041)
* initial commit

* better commands generation
6 years ago
anasbadaha 369354547e Issue: 46475 Fix onyx magp module for supporting new json format (#49417)
Signed-off-by: Anas Badaha <anasb@mellanox.com>
6 years ago
Toshio Kuratomi 175f3b51e5 Ensure that current uses of BaseException are required
* In some cases, it appears that Exception should have been used instead
  as there's no need to catch sys.exit KeyboardInterrupt and similar.
* In a few cases, it appears that BaseException is used because
  a library we depend on calls sys.exit() contrary to good coding
  design.  Comment those so that we know that those have been audited
  and found to be correct and change to use (Exception, SystemExit)
  instead.
6 years ago
Toshio Kuratomi 3fba006207 Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions
like KeyboardInterupt and SystemExit.
6 years ago
anasbadaha c0dbc1a441 Issue/38837 (#49873)
* Fix Issue #38837

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Fix Issue #38837 2

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Enhance decumentation

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Fix Failures in Shippable

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Fix Version Added

Signed-off-by: Anas Badaha <anasb@mellanox.com>

* Add version_added:2.8 in purge attributes

Signed-off-by: Anas Badaha <anasb@mellanox.com>
6 years ago
Abhijeet Kasurde 162d9497ba
Ad-hoc command: fix 'any' call in play_ds (#49852)
* Ad-hoc command: fix 'any' call in play_ds
* Unit test for ad-hoc cli
* Review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 013c42b14f
Misc typo fixes (#49816)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Susant Sahani 59dcf3f277 nmcli: Introduce SIT Tunnel (#45937)
This work enables to add sit tunnel via nmcli module

Signed-off-by: Susant Sahani susant@redhat.com

SUMMARY
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
nmcli

ANSIBLE VERSION
2.8
ADDITIONAL INFORMATION
  - nmcli:
       state: present
       type: sit
       conn_name: sit_test1
       autoconnect: yes
       ip_tunnel_dev: enp0s8
       ip_tunnel_local: 192.168.1.2
       ip_tunnel_remote: 192.168.1.5
6 years ago
cma0 974c45a5f5 itential iap_token module (#46773) 6 years ago
WhyIsThisOpen 7bdca72713 rhn_register fixes for username and password when unregistering
- Require username and password for unregistering and avoid "cannot marshal None unless allow_none is enabled" error when using an activation key and no channels specified.
- Update test fixtures and add changelog


Co-authored-by: WhyIsThisOpen <WhyIsThisOpen@users.noreply.github.com>
6 years ago
rajaspachipulusu17 b47cde9d4c Pluribus Networks pn access list ip module with unit test cases (#49604)
* Pluribus Networks pn access list ip module with unit test cases

* Changes according to ansibot standards in unit test modules

* Remove unwanted variables

* Removed unwanted super call
6 years ago
Chris Archibald 8ad5035ce6 Bug Fix and rewrite (#49508) 6 years ago
Abhijeet Kasurde d36922064b Add support for hex color in slack module (#49804)
Fixes: #11935

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Josue David Hernandez 9202ef60b0 set ansible_os_family from name variable in os-release for clearlinux OS (#49639)
* set ansible_os_family from name variable in os-release for clearlinux system

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>

* Add os_family for clear linux and clear linux mixes

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
6 years ago
Matt Martz 2a469fd959 Consolidate handler tracking (#49338)
* Consolidate handler tracking
  -  Remove unused code. ci_complete
  - unit test fixes. ci_complete
  - Restore previous behavior of matching a single handler
  - when notifying a host for a handler, return True if it was added, False otherwise, to reduce copied logic
  - rename funcitons for clarity. ci_complete
  - Remove handler logic for static includes which was disabled previously
6 years ago
Andreas Calminder 876b637208 move some of basic into common (#48078)
* move file functions into common.file

* move *_PERM_BITS and mark as private (_*_PERM_BITS)

* move get_{platform, distribution, distribution_version} get_all_subclasses and load_platform_subclass into common.sys_info

* forgot get_distribution_version, properly rename get_all_subclasses

* add common/sys_info.py to recursive finder test

* update module paths in test_platform_distribution.py

* update docstrings, _get_all_subclasses -> get_all_subclasses

* forgot to update names

* remove trailing whitespace
6 years ago
Pavlos Tzianos a4eb4b2551 Rabbitmq user permission fixes (#49404)
* Simplify permission changing code for rabbitmq_user module

* Add check for multiple permission dicts for same host to rabbitmq_user module

* Add docstring for _get_permission method of rabbitmq_user

* Fix method that compares vhost permissions in rabbitmq_user

* Add tests for rabbitmq_user module

* Add helper function for simulating collections.Counter functionality
6 years ago
Sean Myers 9434f8608a Add rhsm_repository_release module (#43211)
* Add rhsm_repository_release module

* bump ansible version_added

* Fix imports in rhsm_repository_release unit test
6 years ago
Tim Rupp 1c3fa2b07f
Deprecate the bigip_asm_policy module (#49574)
Specific import and export modules should be used instead
6 years ago
Anil Kumar Muraleedharan dd004321d4 Refactoring code of cnos_portchannel as cnos_linkagg in tune with other vendors. (#49467)
* Refactoring code of cnos_portchannel as cnos_linkagg in tune with other vendors.
6 years ago
Josue David Hernandez 6d42c5020a Fix for changes in clearlinux (#49344)
* Fix for changes in clearlinux

clearlinux is now providing /etc/os-release file and ansible is identifying as NA
then this change allow ansible to find it

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>

* Add changelog fragment for clearlinux changes

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
6 years ago
Naval Patel 880390ca0a Added new module lxca_nodes for Lenovo XClarity Administrator (#46767)
* Added new module lxca_nodes
6 years ago
Toshio Kuratomi c817bef3ae Fix for callback plugins on Python3 when a module returns dictionary keys that aren't strings
This fixes one of the problems reported in https://github.com/ansible/ansible/issues/49343

Upstream Python3 bug for the json traceback:
https://bugs.python.org/issue25457

and PR that may fix it:
https://github.com/python/cpython/pull/8011
6 years ago
Tim Rupp 60b75c2cfd
Adds ASM policy import module (#49526) 6 years ago
Tim Rupp 7a4c7b8c0f
Adds module for gtm topology regions (#49510) 6 years ago
Tim Rupp c7dd13758e
Adds bigip_profile_analytics module (#49499) 6 years ago
Tim Rupp caa6ed3c66
Adds ASM policy fetch module (#49494) 6 years ago
Tim Rupp 138690519d
Various small fixes for f5 ansible modules (#49492) 6 years ago
Sam Doran 40a5f7bfdf Add better error when k=v syntax is used with YAML in tasks (#41754)
* Add error message for k=v and YAML in a single task

Find the correct line, column, and position for k=v errors since they are different than the position reported initially.

Document bug in quoting syntax check.

* Change tense or error message

Since the error still exists, switch to present tense rather than past tense.

* Remove double spaces after periods in error messages.

http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html

* Add changelog fragment

* Add tests for new error message

* Fix tests

* Add clarifying comments to unit test
6 years ago
Abhijeet Kasurde 1b04571ea0
VMware: Fix module usages in module_utils (#49421)
* VMware: Fix module usages in module_utils
* Skip test for Python 2.6 as SSL context is not available in Python 2.6

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
John Kerkstra 672acbea68 Adds `redshift_cross_region_snapshots` module (#35527)
* add redshift_cross_region_snapshots module, unit tests.

* fix errors

* use ec2_argument_spec as the basis for the argument spec. fixed
metadata_version

* follow best practices by naming example tasks.

* code review changes

* fix linting errors

* Update version added
6 years ago
Chris Archibald 62dd1fe29e New options of na_ontap_aggregate (#48906)
* add new options for na_ontap_aggregate

* add gpl line

* remove dup option

* Put files in wrong directory

* change unit test to match the request from PR 48941

* Changed for review comments

* pep8
6 years ago