Commit Graph

1757 Commits (6025990fe9a3d517f6cab7eb448471df3e048c55)

Author SHA1 Message Date
Sloane Hertel 5467ac3454
[aws unit test utils] only create a recordings directory when the env var is set (#45752)
* Only create placebo recording test directories when the environment variable PLACEBO_RECORD is set
6 years ago
Aidan Feldman fa18d45eb3 Link to the Galaxy platforms list from the meta file template (#34046)
* Link to the Galaxy platforms list from the meta file template
Fixes https://github.com/ansible/galaxy/issues/52.
* make ansible/ansible text match mazer text on platforms
6 years ago
Maugli 235b11f681 Return correct version on installed VyOS (#39115)
* Return correct version on installed VyOS

Previously existing regexp will shows only "VyOS" without numeric output of router version.
For example: from  "Version:      VyOS 1.1.6" only VyOS will be written in ansible_net_version variable
For more informative output numeric value should be returned as well

* Fixed unittests
6 years ago
Anton Nikulin b7263eab1d Store Authorization header inside HttpApi connection plugin (#45598) 6 years ago
Nathaniel Case 285b927889
network command modules cleanup (#45242)
* Standardize _command modules

* Centralize command transformation process

* Fix check mode error test
6 years ago
Nathaniel Case 0b433b3ea9
Clean up after cnos tests (#45564) 6 years ago
Anil Kumar Muraleedharan ac58c36ad0 Lenovo cli bugfixes (#45278)
* To change all CLIs present in the code to latest CNOS CLI. One bug of executing with Lenovo Jakku switch is also getting fixed.

* To change the file names as the commands have changed from display to show

* To change to new CLI in test_cnos_comand.py as well
6 years ago
Matt Clay c0bf9815c9 Fix ACI unit test on Python 3.7.0.
The previous logic was only needed for pre-release versions of 3.7.
6 years ago
James Cassell 211aeebd0d remove unused templar._clean_data() (#42739) 6 years ago
Jon Dufresne ef67d4074b Prefer io.BytesIO over six; available on all supported Pythons (#45388)
On all supported Pythons, the io.BytesIO is always a stream
implementation using an in-memory bytes buffer. Makes code slightly more
forward compatible by reducing use of the six module.
6 years ago
Matt Clay f7979e4938 Skip ipaddr test that fails on Python 3.7+. 6 years ago
Abhijeet Kasurde 4e9b8136c2 Add support for Devuan (#45148)
Devuan is part of Debian family. This fix adds support for Devuan OS.

Fixes: #45047

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ganesh Nalawade c0326aea2f
Fix cli_command multiple prompt issue (#44922)
* Add check in network_cli to handle all prompts

* Add check_all flag to mandatory handle all the command prompt
  in prompts list. By default if any one prompt is handled
  remaining prompts are ignored.

* Fix cli_command multiple prompt issue

* If multiple prompt and answers are given as input network_cli
  handles only the first prompt that matched by default
* If a command execution results in muliple prompt the fix
  add support to set a boolean option C(check_all) to indicate
  network_cli to wait till all the prompts and answers are processed.

* Update cli_command

* Update api doc

* Fix unit test failure

* Fix CI failure

* Update network_cli

* Fix review comment
6 years ago
Deepak Agrawal 50c7702e46
cisco firepower : Make API endpoints configurable via hostvars (#44952)
* httpapi host vars

* Make configurable end-points for firepower

* pep8 fix
6 years ago
Alex Stephen 276ad32a45 removing libcloud secrets support for legacy gcp modules (#44932)
* removing libcloud secrets support for legacy gcp modules

* test fixes
6 years ago
Nilashish Chakraborty 0f268e70a1
Fix ios_user issues (#44904)
* Fix ios_user issues

* Modify regex and fix unittests
6 years ago
Alex Stephen 3550f342e0 Gcp auth deprecation (#44866) 6 years ago
Sam Doran 8cd8d17980
Add ability to unlock 1Password vault to lookup plugins (#44923)
* Add ability to use login to 1Password vault to 1Password lookups

* Adjust unit tests

* Add changelog
6 years ago
Senthil Kumar Ganesan a64b97da42 Support for Openswitch (OPX) Control Plane Services (CPS) Module (#44745)
* Generic module to support Openswitch (OPX) Contorl Plane Services (CPS)

* Address ansible-test sanity issues
6 years ago
Ganesh Nalawade 1a684df109
Fix iosxr cli_config module diff issue (#44898)
* Fix iosxr cli_config module diff issue

* Modify iosxr plugin to support configuration
  diff capability (get_diff()) within Ansible
  to be in sync with iosxr_config module.

* Fix unit test case failure
6 years ago
Matt Martz 0221d1ad20
Introduce and use locale-naive rfc2822 date format function (#44868)
* Introduce and use locale-naive rfc2822 date format function. Fixes #44857

* Adjust test expected response
6 years ago
Ghilli3 7bc2660017 fortimanager/fmgr_provisioning.py (#35743)
* Initial commit for new provisioning module
6 years ago
pierremahot d11e078366 adding an option for the filter ipsubnet and testing (#40670)
* adding an option for the filter ipsubnet
6 years ago
lwm fbcdf8ba5b Linode: Mark 'name' as required. Fixes #29785 (#44699)
* Mark 'name' parameter as required.

Closes https://github.com/ansible/ansible/issues/29785.

* Add the `linode-python` dependency for unit tests.

* Add unit test for linode name parameter.

* Add note about where to find required arguments.

Closes https://github.com/ansible/ansible/issues/44696.
6 years ago
Anton Nikulin 40a97d43d1 New modules and updated HTTP API plugin for FTD devices (#44578)
* Add common and Swagger client utils for FTD modules

* Update FTD HTTP API plugin and add unit tests for it

* Add configuration layer handling object idempotency

* Add ftd_configuration module with unit tests

* Add ftd_file_download and ftd_file_upload modules with unit tests

* Validate operation data and parameters

* Fix ansible-doc, boilerplate and import errors

* Fix pip8 sanity errors

* Update object comparison to work recursively

* Add copyright
6 years ago
Michael Price 70fd1ec130 Define module for NetApp E-Series iSCSI targets (#40632)
Create a new module for managing E-Series iSCSI targets.
6 years ago
ndswartz d31e25acbd Define netapp_e_mgmt_interface storage module. (#42519)
* Define netapp_e_mgmt_interface storage module.

The netapp_e_mgmt_interface module provides management configuration for
e-series storage array interface points including remote ssh access, NTP
and DNS services.

This patch also includes integration and unit tests.

* Fix netapp_e_mgmt_interface ssh option documentation and name/channel exclusivity.
6 years ago
Michael Price 054b87acb8 Define module for managing E-Series email alerts (#42643)
Email alerts can be enabled for an E-Series system to provide
information to interested users by email when a warning or critical
level event occurs on the system. This module will allow a system owner
to configure whether or not system alerts are enabled, and who will
receive them.
6 years ago
Michael Price 97157cf876 New module for managing NetApp E-Series iSCSI Interfaces (#39877)
* New module for NTAP E-Series iSCSI Interfaces

Define a new module for configuring NetApp E-Series iSCSI interfaces.

* Improve netapp_e_iscsi_interface integration tests

Restructured integration test to set all iscsi ports to disabled, then
defines the ports either statically or with dhcp, next updates the ports
with the other definition type (static <-> dhcp), and lastly disables
all ports.  Each netapp_eseries_iscsi_interface call is verified with the
array.
6 years ago
Michael Price f781f341a2 Define NetApp E-Series ASUP module (#41153)
* Define NetApp E-Series ASUP module

ASUP, or Auto-Support, is a mechanism that allows NetApp support
to receive information on the status of E-Series storage-systems
in order to proactively resolve issues for customers. This module
gives customers the ability to tune ASUP settings to their liking,
including disabling the feature entirely.

* Improved testing for netapp_e_asup module

Added coverage and validation to asup integration and unit testing
6 years ago
Michael Price 1f2ae0d4cd Define a module for managing E-Series settings (#41010)
There are multiple settings that are defined at a global level for
E-Series systems, but don't necessarily fit with anything else. This
module is intended to provide a place to encapsulate those.
6 years ago
ndswartz cf41415bdf Define netapp_e_auditlog storage module. (#42535)
This module allows NetApp E-Series storage system's audit-log feature to be configured.
6 years ago
ndswartz 7eda94dc8d Defined netapp_e_syslog storage module (#42421)
Module allows syslog server configuration on NetApp E-Series storage arrays.
6 years ago
Michael Price feb212b0a1 Define module for managing LDAP for E-Series (#42356)
This module will allow users to manage LDAP authentication domains for
accessing E-Series systems.
6 years ago
Tim Rupp 0dacc606b4
Various fixes for f5 modules (#44734)
A number of bugfixes for the remaining 2.7 work on the F5 modules.
6 years ago
Tim Rupp c7eeb37f64
Adds bigip_software_install module (#44733)
This module can be used to install existing images on a bigip.
6 years ago
Matthias Fuchs 7871027c9d Share the implementation of hashing for both vars_prompt and password_hash (#21215)
* Share the implementation of hashing for both vars_prompt and password_hash.
* vars_prompt with encrypt does not require passlib for the algorithms
  supported by crypt.
* Additional checks ensure that there is always a result.
  This works around issues in the crypt.crypt python function that returns
  None for algorithms it does not know.
  Some modules (like user module) interprets None as no password at all,
  which is misleading.
* The password_hash filter supports all parameters of passlib.
  This allows users to provide a rounds parameter, fixing #15326.
* password_hash is not restricted to the subset provided by crypt.crypt,
  fixing one half of #17266.
* Updated documentation fixes other half of #17266.
* password_hash does not hard-code the salt-length, which fixes bcrypt
  in connection with passlib.
  bcrypt requires a salt with length 22, which fixes #25347
* Salts are only generated by ansible when using crypt.crypt.
  Otherwise passlib generates them.
* Avoids deprecated functionality of passlib with newer library versions.
* When no rounds are specified for sha256/sha256_crypt and sha512/sha512_crypt
  always uses the default values used by crypt, i.e. 5000 rounds.
  Before when installed passlibs' defaults were used.
  passlib changes its defaults with newer library versions, leading to non
  idempotent behavior.

  NOTE: This will lead to the recalculation of existing hashes generated
        with passlib and without a rounds parameter.
        Yet henceforth the hashes will remain the same.
        No matter the installed passlib version.
        Making these hashes idempotent.

Fixes #15326
Fixes #17266
Fixes #25347 except bcrypt still uses 2a, instead of the suggested 2b.

* random_salt is solely handled by encrypt.py.
  There is no _random_salt function there anymore.
  Also the test moved to test_encrypt.py.
* Uses pytest.skip when passlib is not available, instead of a silent return.
* More checks are executed when passlib is not available.

* Moves tests that require passlib into their own test-function.

* Uses the six library to reraise the exception.

* Fixes integration test.

When no rounds are provided the defaults of crypt are used.
In that case the rounds are not part of the resulting MCF output.
6 years ago
Tim Rupp 24a379f0b7
adds the bigip_cli_script module (#44674)
This module can be used to manage tmsh cli scripts on a BIG-IP
6 years ago
Toshio Kuratomi 8ec973b453 Fix unittests for always adding basic to the AnsiBallZ zips 6 years ago
Tim Rupp ee1b899b18
Adds AS3 module (#44655)
This adds the as3 module for bigip to ansible.
6 years ago
Tim Rupp 639cfe3b6f
Refactors device group (#44599)
Make module use patterns that other modules use
6 years ago
Michael Price ad91793428 Resolve issues in NetApp E-Series Host module (#39748)
* Resolve issues in NetApp E-Series Host module

The E-Series host module had some bugs relating to the update/creation
of host definitions when iSCSI initiators when included in the
configuration. This patch resolves this and other minor issues with
correctly detecting updates.

There were also several minor issues found that were causing issues with
truly idepotent updates/changes to the host definition.

This patch also provides some unit tests and integration tests to help
catch future issues in these areas.

fixes #28272

* Improve NetApp E-Series Host module testing

The NetApp E-Series Host module integration test lacked feature test
verification to verify the changes made to the storage array.

The NetApp E-Series rest api was used to verify host create, update, and
remove changes made to the NetApp E-Series storage arrays.
6 years ago
Samer Deeb a07af2a1f7 issue:43021 add support for onyx version 3.6.6000 and above (#44527)
* issue:43021 add support for onyx version 3.6.6000

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

* issue:43021 add support for onyx version 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Toshio Kuratomi f46c943d3d Fix another corner case of too many warnings for world readable current working directory
There should be no warning if there is no ansible.cfg file i nthe
current working directory.
6 years ago
Matt Martz dab975d302
Unit tests for ansible.playbook.become (#38541) 6 years ago
Matt Martz 88509e75ad
Remove bare_deprecated functionality (#44517)
* Remove bare_deprecated functionality

* Change tests due to bare_deprecated removal
6 years ago
jctanner 653d9c0f87 New keyword: ignore_unreachable (#43857) 6 years ago
Sumit Jaiswal 1d2bb34992
Includes support for Reverse-Mapping zone in nios_zone module (#44525)
* support reverse mapping

* support reverse mapping

* support reverse mapping

* fix shippable errors

* fix shippable errors

* fix shippable errors
6 years ago
photoninger d68c734ae2 Fix for "cannot marshal None unless.." (#33660)
when using only an activation key without any channels.
As already suggested by mattclay in
https://github.com/ansible/ansible/pull/25079

and also patch unit test for rhn_register and
add test case for activationkey only
6 years ago
Tim Rupp 49f34fec13
Correct unit tests and module fixes (#44488)
Cleanup of unit tests. Modules fixes in iapp_template nad profile_dns
to support unit tests.
6 years ago
Jordan Borean 6982dfc756 psrp: Added new Windows connection plugin (#41729)
* psrp: Added new Windows connection plugin

* Tweaks to connection options from review
6 years ago
Tim Rupp 07a011cd6f
Various bigiq fixes (#44487)
Fixes usage of the RestClient class. Documentation fixes. Removal
of dependency code.
6 years ago
Tim Rupp d39a711aa1
Adds the bigip firewall DoS profile module (#44486)
This module can be used to manage AFM DoS profiles on a BIG-IP
6 years ago
Tim Rupp d05da83495
Removes dependencies and cleans up code (#44484)
Portions of the f5-sdk were removed as well as the netaddr library
and were replaced with libraries that are part of ansible. Additionally,
deprecated code has been removed.
6 years ago
Tim Rupp b5e99949e2
Adds the bigip_profile_http module (#44473)
This module can be used to manage HTTP profiles on a BIG-IP.
6 years ago
Lindsay Hill bec0a1ceb3 nos_facts module and tests (#44094) 6 years ago
Lindsay Hill b0a25d321d new nos_config module (#44140)
* new nos_config module

* Update cliconf/nos.py to add missing 'end'
6 years ago
Matt Martz 617372f8c0
Mass nuke deprecated items that are easily removed. ci_complete (#44320) 6 years ago
Matt Martz 9b2baebe64
Don't use copy.deepcopy in high workload areas, use naive_deepcopy (#44337)
* Don't use copy.deepcopy in high workload areas, use deepishcopy. ci_complete

* Add tests

* Add changelog fragment

* rename to naive_deepcopy and add extra docs

* Rename to module_response_deepcopy and move to vars/clean
6 years ago
Artem Leshchev 8323f3e3b7 Fix module name in error text at parse_xml filter (#44313)
* Fix module name in error text at parse_xml filter

* Fix test that includes erroneous module name in error text at parse_xml filter
6 years ago
Tim Rupp 359d97f01b
Adds bigip_device_auth module (#44373)
This module can be used to configure auth settings to the mgmt
interface on a BIG-IP.
6 years ago
Tim Rupp b54f6cd132
Adds bigip_firewall_rule module (#44370)
This module can be used to manage rules in either a firewall policy
or a firewall rule list in AFM, on BIGIP.
6 years ago
Tim Rupp d8ea154fb8
Adds the firewall-rule-list module for BIGIPs (#44368)
This module allows one to manage rule lists in AFM on a BIGIP.
6 years ago
Tim Rupp 8dd39a031f
Adds module to manage srcaddr persistence profiles (#44364)
This module can manage source address persistence profiles on a BIG-IP
6 years ago
Tim Rupp 3a15b6512c
Adds bigip http compression profile module (#44362)
This module can be used to manage http compression profiles on
a BIG-IP.
6 years ago
Tim Rupp 1148d57012
Adds bigip_firewall_policy module (#44361)
This module is used to manage firewall policy objects on a bigip.
6 years ago
Tim Rupp e95dbf5f47
Adds oneconnect profile module (#44360)
This module can be used to manage oneconnect profiles on a BIG-IP
6 years ago
Tim Rupp fae42c83f1
Adds bigip_monitor_dns module (#44359)
This module can be used to manage DNS monitors on a BIG-IP.
6 years ago
Tim Rupp 783b565583
Adds bigip_remote_role module (#44358)
This module can be used to manage remote roles on a BIG-IP used
for remote authentication to management interfaces.
6 years ago
Tim Rupp 0eb284b040
Adds cli alias module for BIG-IP (#44357)
This module allows one to manage CLI aliases in a BIG-IP.
6 years ago
Tim Rupp 41df1e15fe
Adds module for utility license assignment on BIG-IQ (#44356)
This module can be used to distribute utility licenses to BIG-IPs
from a BIG-IQ
6 years ago
Tim Rupp 48e99982ff
Adds bigip_software_image module (#44355)
This module can be used to manage software images on a BIG-IP.
6 years ago
Tim Rupp c1b2ef2c1a
Adds bigip_tunnel module (#44354)
This module can be used to manage tunnels on a BIG-IP.
6 years ago
Tim Rupp e204098646
Adds more unit test fixtures (#44353)
Fixtures for new modules
6 years ago
Tim Rupp ee5b761c21
Adds bigip_device_facts module (#44351)
This is a new module to manage the different facts that can be gathered
from a bigip.
6 years ago
Tim Rupp 47b527224a
Renames the security_port_list module (#44350)
Renames the module by adding a symlink, introducing the new module,
and naming the symlink so that it identifies as deprecated.
6 years ago
Tim Rupp b65f05f9c0
Renames the security_address_list module (#44348)
Renames module and includes a symlink with the old name so that it
will still work, though will be deprecated too.
6 years ago
Zhikang Zhang 501503f4cb
Allow version specifiers for pip install (#41792)
Allow version specifiers for pip install.
6 years ago
Adam Miller 6d95624c22 Refactor yum and dnf, add feature parity (#43621)
* Refactor yum and dnf, add feature parity

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove unnecessary module_utils, move the classes into the module code

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove yum -> yum4, out of scope

Signed-off-by: Adam Miller <admiller@redhat.com>

* use ABCMeta

Signed-off-by: Adam Miller <admiller@redhat.com>

* re-arrange run() caller vs callee

Signed-off-by: Adam Miller <admiller@redhat.com>

* make sanity checks happy

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix yum unit tests

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove unecessary debug statements, fix typo

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix licensing and attribution in yumdnf module_util

Signed-off-by: Adam Miller <admiller@redhat.com>

* include fix from PR 40737

original commit 5cbda9658a
original Author: Strahinja Kustudic <kustodian@gmail.com>

yum will fail on 'No space left on device', fixes #32791 (#40737)

During the installing of packages if yum runs out of free disk space,
some post install scripts could fail (like e.g. when the kernel
package generates initramfs), but yum would still exit with a status
0.  This is bad, especially for the kernel package, because it makes
it unable to boot.  Because the yum module is usually used for
automation, which means the users cannot read every message yum
prints, it's better that the yum module fails if it detects that
there is no free space on the disk.

Signed-off-by: Adam Miller <admiller@redhat.com>

* Revert "fix licensing and attribution in yumdnf module_util"

This reverts commit 59e11de5a2.

* move fetch_rpm_from_url out of yumdnf module_util

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix the move of fetch_rpm_from_url

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Lindsay Hill 3960ebb8e8 new voss_facts module (#44234)
@LindsayHill Thank you!
6 years ago
Lance Richardson dc08b9a738 new module exos_config (#43902)
- support config operations for EXOS-based platforms
- add regex to detect command failure responses
- add exos action plugin for "backup" operation
- add unit tests for exos_command (currently 94% coverage of
  exos_config.py)
6 years ago
Zhikang Zhang 0971a342d8
Solve race condition in password lookup (#42529)
NOTE:
1. use os.open() with os.O_CREAT|os.O_EXCL to check existence
and create a lock file if not exists, it's an atomic operation
2. the fastest process will create the lock file and others will
wait until the lock file is removed
3. after the writer finished writing to the password file, all the reading
operations use built-in open so processes can read the file parallel
6 years ago
Matt Martz 17c89d1ffa
Remove unused rslt_q, rename the one queue to final_q everywhere (#43894)
* Remove unused rslt_q, rename the one queue to final_q everywhere

* Test update
6 years ago
Lindsay Hill 5981a7489b new nos_command module (#43056) 6 years ago
Matt Martz c1c229c6d4
Remove use of simplejson throughout code base (#43548)
* Remove use of simplejson throughout code base. Fixes #42761

* Address failing tests

* Remove simplejson from contrib and other outlying files

* Add changelog fragment for simplejson removal
6 years ago
Trishna Guha 96346938ee
nxos_vlan refactor to support non structured output (#43805)
* nxos_vlan refactor to support non structured output

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

* unittest fix

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

* minor fixes

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

* use check_rc

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

* address review comment

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

* remove additional return statement

* address Nate's review

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Ganesh Nalawade d1de1e0449
Update iosxr cliconf plugin (#43837)
* Update iosxr cliconf plugin

Fixes #39056

*  Update iosxr cliconf plugin
*  Modify iosxr module_utils code to support
   refactored cliconf plugin api's
*  Other minor changes

* Fix unit test failure

* Update ios, eos, nxos plugin for diff

* Fix review comment
6 years ago
Deepak Agrawal 8eaebf86b6
openvswitch_db : Handle column value conversion and idempotency in no_key case (#43869)
* change column value to string. handle idempotency in no key case

* fix unit test failures in baseline
6 years ago
Lance Richardson bd4d68c785 network/exos: add exos_facts module (#43210)
Add exos_facts module. Known limitations at this time include:
   - Interface MTU is not reported.
   - Only primary interface IP is reported.

Add basic unit tests for the exos_facts module.

An EXOS CLI prompt can be prefixed with '! ' (shutting down), '* '
(running configuration does not match saved configuration), and
can include various status tokens within parentheses after these
prefixes. Update prompt regex to accept valid CLI prompts.
6 years ago
Lindsay Hill 8429f777da New networking module: voss_command (#43741)
* new voss_command module

* Removed incorrect version_added line
6 years ago
Toshio Kuratomi 30662bedad
Only print warning when ansible.cfg is actually skipped (#43583)
Only print warning when ansible.cfg is actually skipped

* Also add unittests for the find_ini_config_file function
* Add documentation on world writable current working directory
  config files can no longer be loaded from a world writable current
  working directory but the end user is allowed to specify that
  explicitly.  Give appropriate warnings and information on how.

Fixes #42388
6 years ago
Anil Kumar Muraleedharan 119376a685 Refactoring to persistence connection BGP, factory, reload, save, showrun modules (#43534)
* Refactoring to persistence connection BGP, factory, reload, save, showrun modules

* Refactoring methods from Util to module file

* Removing BGP Utility methods

* Adding to errors that need to be ignored
6 years ago
Zhikang Zhang 3a3869f4c8
Clarify usage of encrypt arg (#43330)
According to the do_encrypt interface, encrypt arg should be the hash method name used for encrypting returning password. But in the doc and lookup code it's a boolean flag, correct it to string.
6 years ago
Trishna Guha 09ae1ec308
cliconf refactor eos, nxos fix (#43596)
* cliconf refactor eos and nxos fix

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

* move nxos replace check to plugins

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

* address review comment

* fix shippable
6 years ago
Sumit Jaiswal e96f90b440
Nios integration and unit tests for all remaining nios new modules (#43399)
* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* new nios module integration test support

* test/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml

new nios module integration test support

* fix pep8 error

* fix pep8 error

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end

* adding newline at end
6 years ago
Joren Vrancken b954917761 Surround top-level function and class definitions with two blank lines. 6 years ago
Alex Dukhno dd28be3aab Update pagerduty modules to rest v2 (#42618)
* refactored from procedural to OOP

* updated ongoing maintenance windows to PagerDuty REST API v2

* update create maintenance windows to PagerDuty REST API v2

* update absent maintenance windows to PagerDuty REST API v2

* update pager alert module to PagerDuty REST API v2

* removed basic HTTP authorization
updated parameter description and examples

* fix failed sanity checks

* revised documentation according to review

* make obsolete service key parameter an alias to a new integration key parameter
6 years ago
Egor Zaitsev 249a6aae22 New module: routeros — manage MikroTik RouterOS (#41155)
* Implement initial RouterOS support

* Correct matchers for license prompts

* Documentation updates & mild refactor

* Remove one last Cisco function

* Sanity test fixes

* Move imports to the beginning

* Remove authorize property

* Handle ANSI codes

* Revert to_lines function

* CR fixes

* test(routeros): add unit tests

* Added another test (with ANSI colors and banner in fixture).

* Ignore CRLF line endings in system_package_print file

* fix: review by ganeshrn
6 years ago
tstoner 2c3d418e53 Nxapi ssl (#42905)
* NXAPI ssl ciphers & protocols default values

* TLSv1, TLSv1.1, TLSv1.2 and weak cipher support

* NXOS NXAPI weak/strong cipher & TLSv 1.2, 1.1 & 1.0 support

* Version checking for strong/weak ciphers & TLS 1.2, 1.1 & 1.0 support

* Cleaned up erroneously committed changes.

* Specific NXOS platform checking for nxapi ssl ciphers & protocols

* Fixed ansibot reported errors.

* Resolved ansibot reported error.

* Added network_os_version to mocked up N7K unit test device_info

* Calling get_capabilities() once in main and passing results into methods.

* Removed raising exceptions when platform capabilities return None
per reviewers request. Skipping nxapi ssl options when capabilities
are None and generating a warning when these options are skipped

* Cleaned up explicit checks for None/not None
6 years ago
Anil Kumar Muraleedharan f2c9a6b126 Lenovo port to persistence 1 (#43194)
* CNOS Vlag module is refactored to use persistence connection instead of paramiko.

* Changing interface and port channel modules to persistent connection and adding UT for them.

* Fixing pep8 issues

* Removing trailing new line

* Removing trailing new line

* Removing trailing new line

* Correcting indentation mistake

* Update cnos_vlag.py

* Removing commented examples

They are commented because those configurations are not meant for L2 ports
6 years ago
Ganesh Nalawade af3f510316
nxos cliconf plugin refactor (#43203)
* nxos cliconf plugin refactor

Fixes #39056

*  Refactor nxos cliconf plugin as per new api definition
*  Minor changes in ios, eos, vyos cliconf plugin
*  Change nxos httpapi plugin edit_config method to be in sync with
   nxos cliconf edit_config

* Fix CI failure

* Fix unit test failure and review comment
6 years ago
Toshio Kuratomi 52449cc01a AnsiballZ improvements
Now that we don't need to worry about python-2.4 and 2.5, we can make
some improvements to the way AnsiballZ handles modules.

* Change AnsiballZ wrapper to use import to invoke the module
  We need the module to think of itself as a script because it could be
  coded as:

      main()

  or as:

      if __name__ == '__main__':
          main()

  Or even as:

      if __name__ == '__main__':
          random_function_name()

  A script will invoke all of those.  Prior to this change, we invoked
  a second Python interpreter on the module so that it really was
  a script.  However, this means that we have to run python twice (once
  for the AnsiballZ wrapper and once for the module).  This change makes
  the module think that it is a script (because __name__ in the module ==
  '__main__') but it's actually being invoked by us importing the module
  code.

  There's three ways we've come up to do this.
  * The most elegant is to use zipimporter and tell the import mechanism
    that the module being loaded is __main__:
    * 5959f11c9d/lib/ansible/executor/module_common.py (L175)
    * zipimporter is nice because we do not have to extract the module from
      the zip file and save it to the disk when we do that.  The import
      machinery does it all for us.
    * The drawback is that modules do not have a __file__ which points
      to a real file when they do this.  Modules could be using __file__
      to for a variety of reasons, most of those probably have
      replacements (the most common one is to find a writable directory
      for temporary files.  AnsibleModule.tmpdir should be used instead)
      We can monkeypatch __file__ in fom AnsibleModule initialization
      but that's kind of gross.  There's no way I can see to do this
      from the wrapper.

  * Next, there's imp.load_module():
    * https://github.com/abadger/ansible/blob/340edf7489/lib/ansible/executor/module_common.py#L151
    * imp has the nice property of allowing us to set __name__ to
      __main__ without changing the name of the file itself
    * We also don't have to do anything special to set __file__ for
      backwards compatibility (although the reason for that is the
      drawback):
    * Its drawback is that it requires the file to exist on disk so we
      have to explicitly extract it from the zipfile and save it to
      a temporary file

  * The last choice is to use exec to execute the module:
    * https://github.com/abadger/ansible/blob/f47a4ccc76/lib/ansible/executor/module_common.py#L175
    * The code we would have to maintain for this looks pretty clean.
      In the wrapper we create a ModuleType, set __file__ on it, read
      the module's contents in from the zip file and then exec it.
    * Drawbacks: We still have to explicitly extract the file's contents
      from the zip archive instead of letting python's import mechanism
      handle it.
    * Exec also has hidden performance issues and breaks certain
      assumptions that modules could be making about their own code:
      http://lucumr.pocoo.org/2011/2/1/exec-in-python/

  Our plan is to use imp.load_module() for now, deprecate the use of
  __file__ in modules, and switch to zipimport once the deprecation
  period for __file__ is over (without monkeypatching a fake __file__ in
  via AnsibleModule).

* Rename the name of the AnsiBallZ wrapped module
  This makes it obvious that the wrapped module isn't the module file that
  we distribute.  It's part of trying to mitigate the fact that the module
  is now named __main)).py in tracebacks.

* Shield all wrapper symbols inside of a function
  With the new import code, all symbols in the wrapper become visible in
  the module.  To mitigate the chance of collisions, move most symbols
  into a toplevel function.  The only symbols left in the global namespace
  are now _ANSIBALLZ_WRAPPER and _ansiballz_main.

revised porting guide entry

Integrate code coverage collection into AnsiballZ.

ci_coverage
ci_complete
6 years ago
Toshio Kuratomi 5b4a7cc283 Fix journald unittests
d7df072b96 changed how we call
journal.send() from positional arguments to keyword arguments.  So we
need to update the test to check for the arguments it was called with in
the keyword args, not in the positional args.
6 years ago
Gregory Hellings 6f007c35c1 Improved the documentation of known_hosts
The documentation for the key parameter was lacking in specificity and
also lacking in testing. These parts are both remedied herein.

Fixes #43157
6 years ago
Adam Miller 562ff66a98 Fix pkg_mgr_name fact finding for Fedora (#40922)
* Properly handle default package manager vs apt

For distros where apt might be installed but is not the default
package manager for the distro, properly identify the default distro
package manager during fact finding and re-use fact finding from
DistributionFactCollector and instead of reimplementing small
portions of it in PkgMgrFactCollector

Add unit test to always check the apt + Fedora combination to test
the new code.

Fixes #34014

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove q debugging output I accidentally left behind

Signed-off-by: Adam Miller <admiller@redhat.com>

* add os_family to the conditional so we're only hitting that code path when needed

Signed-off-by: Adam Miller <admiller@redhat.com>

* setup for a _check* pattern for general os_family group pkg_mgr checking

Signed-off-by: Adam Miller <admiller@redhat.com>

* use Mock.patch decorator for os.path.exists in TestPkgMgrFactsAptFedora

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Andrey Laguta 2e62e36590 Fix multiple var files combining (followup to #36357) 6 years ago
Matej Vadnjal 7c318d4e30 ios_user module - implement sshkey option (#38782)
* ios_user module - add sshkey support

* ios_user - Add version_added to sshkey option

* ios_user - pep8 indentation fixes in unit tests

* ios_user - use b64decode method that works on python 2 and 3
6 years ago
Samer Deeb 3ca4a35334 Add support for global IGMP configuration on onyx switches (#42164)
* Add support for global IGMP configuration on onyx switches

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

* Add support for global IGMP configuration on onyx switches

Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Anil Kumar Muraleedharan 0897e79bd1 Persistence connection for cnos_vlan (#42500)
* Changing Lenovo Inc to Lenovo and update License file to be consistent.

* Changing cnos_vlan from paramiko to persistence connection of Ansible. Also talking care of CLI changes in CNOS commands with backward compatibility.

* Fixing Validation issues

* Trailing lines removal

* Review comments of Gundalow are getting addressed. He mentioned only at one place for cnos.py. But I have covered the entire file.

* Changes to incorporate Review comments from Qalthos

* Removing configure terminal command from module code

* Aligning with change in run_cnos_commands method changes

* Editing cliconf for latest CNOS CLIs
6 years ago
Sloane Hertel 1fdd84b88c Rename AWS unit tests that are not running when changing the module (#42712)
now can use `ansible-test units module_name` for the aws_s3 and aws_api_gateway modules

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

changes to module_utils/aws/core.py are only being unit tested on modules that import from the file (if they have a corresponding test) or tests that import from the file themselves.
6 years ago
Ryan Brown 45f5964fed Fix patching of wrong boto3_conn in API Gateway tests (#42700) 6 years ago
Clement Trebuchet 7c97bb5077 Devel ios vrf submode (#41659)
* add submode features ipv4/ipv6

* add tests for submode

* the parameters both_ * were not idempotent, in what is read in the configuration we have a list with 2 entries (import, export) while the input parameter has only one parameter which will be applied twice

* add docstring to the ios_vrf module + provide a fix for: https://github.com/ansible/ansible/issues/41581

* complete tests

* add missing description

* fix KeyError for address-family ipv*

* fix both_* tests

* fix E231, W292, W293

* fix W293

* remove set has it doesn't preserve order of routes

* fix E106

* remove ImportError: cannot import name OrderedDict

* We should be able to mix the parameters for the routes targets , while remaining imdepotent. During the first implementation we did not take this into account, which did not correspond to the reality of the needs in production (to be able to use each parameter indifemently together)

* remove epdb reference

* FIX E111, E106

* FIX E302

* using loop produce a result who  was not imdepotent

* FIX E241

* fix: used pass intead of list
6 years ago
Clement Trebuchet c7981c4cc8 Add the NIOS RECORD PTR Module (#41900)
* Add the NIOS RECORD PTR Module

* FIX E241,E231, E105

* FIX module should not be executable

* FIX module RWX

* Remove change in nios_srv_record

* Remove change in nios_srv_record

* FIX test_nios_ptr_record_update_comment

* ADD: Integration and target tests for the NIOS PTR RECORD module.

* FIX module name in integrations tests

* Update integration

* Refactor nios_ptr_record module

* Refactor the nios_ptr_record_idempotence

* FIX name

* Smoketests for the NIOS modules does not take care of the PTR:RECORD object

* REM the default for view

* Add finals test, after adding the PR (https://github.com/ansible/nios-test-container/pull/1) in order to handle PTR:RECORD

* add the define nios specific constant for PTR:RECORD

* fix: documentation style

* add create an ipv6 ptr record

* rename class name, add ipv6 unittest
6 years ago
Fran Fitzpatrick 5928ec04ca Adds an ipmath filter (#41985) 6 years ago
Will Thames 42eaa00371 Provide kubernetes definition diffs in check_mode (#41471)
Move dict_merge from azure_rm_resource module to
module_utils.common.dict_transformations and add tests.

Use dict_merge to provide a fairly realistic, reliable
diff output when k8s-based modules are run in check_mode.

Rename unit tests so that they actually run and reflect
the module_utils they're based on.
6 years ago
hitsumabushi cf7a42b4f4 allow empty line in src template file (#42493) 6 years ago
Jordan Borean 940d4a0e89
win_reboot: fix 2.6 issues and better handle post reboot reboot (#42330)
* win_reboot: fix 2.6 issues and better handle post reboot reboot

* changed winrm _reset to reset

* Add handler to reset calls when .reset() throws an AnsibleError on older hosts

* Moving back to _reset to get the issue fixed
6 years ago
Zhikang Zhang 70e33ef92c
Make ios_vlan identify vlans starting with 9 (#42247)
* Make ios_vlan identify vlans starting with 9

* Add unit test for vlan id start with 9
6 years ago
Jakub Libosvar 26b0908270 openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is
required only for columns with type of a 'map'. This patch makes 'key'
an optional parameter to allow setting values for other column types
like int.

Fixes #42108
6 years ago
Paul Neumann dfb2b3fdd5 ios_facts: Report space of file systems (#41850)
* ios_facts: Report file system space

Parse total and free space from dir output. For this, add a hash
filesystems_info containing the keys spacetotal_kb and spacefree_kb.

* ios_facts: Add unit test for file system space reporting

* ios_facts: Add integration test for file system space reporting
6 years ago
Jordan Borean 8bdd04c147 Fix remote_tmp when become with non admin user (#42396)
* Fix tmpdir on non root become

 - also avoid exception if tmpdir and remote_tmp are None
 - give 'None' on deescalation so tempfile will fallback to it's default behaviour
   and use system dirs
 - fix issue with bad tempdir (not existing/not createable/not writeable)
   i.e nobody and ~/.ansible/tmp
 - added tests for blockfile case

* Revert "Temporarily revert c119d54"

This reverts commit 5c614a59a6.

* changes based on PR feedback and changelog fragment

* changes based on the review

* Fix tmpdir when makedirs failed so we just use the system tmp

* Let missing remote_tmp fail

If remote_tmp is missing then there's something more basic wrong in the
communication from the controller to the module-side.  It's better to
be alerted in this case than to silently ignore it.

jborean and I have independently checked what happens if the user sets
ansible_remote_tmp to empty string and !!null and both cases work fine.
(null is turned into a default value controller-side.  empty string
triggers the warning because it is probably not a directory that the
become user is able to use).
6 years ago
Ganesh Nalawade c068b88b38
Update eos, ios, vyos cliconf plugin (#42300)
* Update eos cliconf plugin methods

*  Refactor eos cliconf plugin
*  Changes in eos module_utils as per cliconf plugin refactor

* Fix unit test and sanity failures

* Fix review comment
6 years ago
hlrichardson 2aa81bf05d add tests for exos_command module (#42268) 6 years ago
Nathaniel Case 5850591d14
Base connection class for network-style connections (#41839)
* Create base class for network-style connections

* clean up some differences

* Move NetworkConnectionBase

* Tweak netconf for tests

* Tweak when network_os is checked to avoid failing tests

* Pull back exec_command
6 years ago
Ganesh Nalawade e41d427d1b
Add run_commands api for ios and vyos cliconf plugin (#42093)
* Add run_commands api for ios and vyos cliconf plugin

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

* Fix Ci failures
6 years ago
Yanis Guenane 42c2fd72ae Fix test_create_jks_success failing on SELinux machine (#42001)
Currently TestCreateJavaKeystore::test_create_jks_success is failing on
a machine with SELinux because set_context_if_different is not mocked
and hence tries to access a file that doesn't exist because it has been
mocked previously.

Also, changing path to a path that won't exist for sure.
6 years ago
Eitan Akman fb7882bf86 Issue #39860: Add 'not_contains' method to parsing.py (#39874)
* Issue #39860: Add 'not_contains' method to parsing.py

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

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

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

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

* Issue #39860 Fix singleton comparison issue

* Fix E302 expected 2 blank lines, found 1

* Issue #39860 Add license header to unit tests

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

* Issue #39860 remove unnecessary comment from unit test
6 years ago
Troy Murray 15ce7c5bab change OS X to macOS (#41294)
* change OS X to macOS

<!--- Your description here -->

+label: docsite_pr

* Update all Mac OS X references to be macOS

* Drop extra Mac
6 years ago
Matthew Stone c5c3900c52 Adding slxos_lldp module (#39259)
* Adding slxos_lldp module
6 years ago
Jordan Borean 9b7b564d75
Stop displaying kinit pass input on a failure (#41882)
* Stop displaying kinit pass input on a failure

* Fixed up minor logic info and added tests
6 years ago
Dennis Benkert 28d0a173db [aws] add limit on number of CloudFormation stack events fetched by cloudformation module (#41840)
* Add a module parameter to configure the max fetched AWS CFN stack events
* Add version documentation for new configuration option
* Increase default in order to make sure that enough are fetched by default. This align roughly with the limit of manageable resources in CloudFormation.
6 years ago
Ganesh Nalawade 773c031d33
vyos and ios cliconf plugin refactor (#41846)
* vyos and ios cliconf plugin refactor

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

* Fix unit test failure

* Fix sanity issues

* Add get_diff to rpc list
6 years ago
Nathaniel Case 9aa8c652ba
Netconf bytes fixes (#41607)
* Solve some bytes issues on iosxr

* Solve some bytes issues in junos

* Do the correct thing with tostring based on lxml or not
6 years ago
Brian Coca 27c43daab8
fix minor issues with debug and item labels (#41331)
* fix minor issues with debug and item labels

 - no more `item=None`, we always have a label now
 - debug should only show expected information, either msg= or the var in var=
 - also fixed method name, deprecated misleading _get_item
6 years ago
Jordan Borean 11bd3fd318 win_updates fix when win_updates is run with async (#41756) 6 years ago
Tim Rupp 6c654b6947
Fixes the default assignment of values (#41672)
Fixes: #41640

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

Before this patch we get this on openSUSE Leap 15

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

After this patch we get this

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

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

Fixes: #41410
6 years ago
Tim Rupp 16466f3171
Fixes usage of popen in bigip iapplx package (#41612)
This functionality is superceeded by the run_command method in the
ansible module class.
6 years ago
Matt Davis b01779ad18
skip winrm unit tests if winrm is not installed (#41596) 6 years ago
Sharp Hall 3935cce394 docker: Allow publishing of ports with the same number but different protocol (#38412)
* Don't deduplicate docker container ports with different protocols

* Test _parse_exposed_ports
6 years ago
Andrew Gaffney 0ff04ad41b Fix wrong python keyword (followup to #36357) (#41067)
Also add tests around that code path
6 years ago
Jordan Borean ad8e13e9f8
winrm: fix up unit tests (#41112) 6 years ago
Martin Krizek 77e2bd5f8e
Fix inserting noop tasks by using active state (#36056) 6 years ago
Ganesh Nalawade ba4b12358c
Refactor ios cliconf plugin and ios_config module (#39695)
* Refactor ios cliconf plugin and ios_config module

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

* Fix unit test and other minor changes

* Doc update

* Fix CI failure

* Add default flag related changes

* Minor changes

* redact input command logging by default
6 years ago
Matt Martz d4930e6692
Add requests.Session like class (#37622)
* Adds requests.Session like class

* py2 syntax fix

* Add a few examples to the Request docstrings

* Add helper methods and docs

* Fix test failures

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

* Fix filename in replace-urlopen code smell test
6 years ago
Nathaniel Case e7afd3d378
Search for macaddresses more stringently (#40901)
* Search for macaddresses more stringently

Fixes #40829
6 years ago
James Mighion 083ddb9bc2 Adding changed option to save_when for aireos (#40681)
* Adding changed option to save_when for aireos

* Deprecating save option for aireos_config.

* Updating version_added to 2.7 since the PR missed the window for 2.6
6 years ago
Sumit Jaiswal 81510970ae
Fix for updating the name in case of host record and network view and also display meaningful error in case of connection timeout (#40597)
* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* to resolve the bug 40709

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* to fix shippable nios automation error

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* shippable error fix

* shippable error fix

* shippable error fix

* shippable error fix

* shippable error fix

* review comment fix

* shippable error fix

* shippable error fix
6 years ago
Matt Martz ad7ba91f75 Use _remote_is_local=True for local connection in synchronize (#40833)
* All instances of local connection should use _remote_is_local=True. Fixes #40551

* Switch to instance attribute for synchronize

* Add test that shows that synchronize _remote_is_local addresses tmpdir building
6 years ago
Nathaniel Case 82dfa542c2
Replace bogus (but routeable) ip addresses with RFC 5737 example addresses (#40554)
* Remove 1.1.1.1 from *_config tests

* remove from *_smoke and *_system

* Miscellaneous other tests

* Remove from module documentation as well

* Remove from unit tests as well

* Remove accidental duplication from rebase
6 years ago
Guillaume Grossetie 5ffa1a1b2a Add a module to create a java key store (jks) from a certificate (#35273)
* Add a module to create a java key store (jks) from a certificate
* Create a jks from a certificate and a private key (secured by a password)
* Add an option to recreate the jks (useful when you want to update the jks password)
* If the certificate changed, recreate the jks
* Version added is now 2.7
6 years ago
Sviatoslav Sydorenko 6cafa73441 Add is_iterable utility function 6 years ago
Sviatoslav Sydorenko e6eec79bca Add tests for module_utils.common.collections 6 years ago
Yanis Guenane 496d10f7a8 Remove support for SSLv2 in test suite when not defined. (#39183)
When running the test test/units/module_utils/urls/test_open_url.py
test_open_url_no_validate_certs, the test fails because of the SSLv2
check.

Test is run on a machine using openssl 1.1.0g. By reading the openssl
man page[1], one can see that support for SSLv2 has been removed.

> Support for SSLv2 and the corresponding SSLv2_method(),
> SSLv2_server_method() and SSLv2_client_method() functions where removed
> in OpenSSL 1.1.0.
>
> SSLv23_method(), SSLv23_server_method() and SSLv23_client_method() were
> deprecated and the preferred TLS_method(), TLS_server_method() and
> TLS_client_method() functions were introduced in OpenSSL 1.1.0.

Hence this commit remove the uses of this flag when it is not defined.

[1] https://www.openssl.org/docs/man1.1.0/ssl/SSLv23_method.html
6 years ago
Adrian Likins 1613a739ad fix decrypted vault utf8 values (#37539)
* Fix errors decrypted non-ascii vault vars

AnsibleVaultEncryptedUnicode was just using b"".decode()
instead of to_text() on the bytestrings returned from
vault.decrypt() and could cause errors on python2
if non-ascii since decode() defaults to ascii.
Use to_text() to default to decoding utf-8.

add intg and unit tests for value of vaulted vars
being non-ascii utf8

based on https://github.com/ansible/ansible/issues/37258

Fixes #37258

* yamllint fixups
6 years ago
Sloane Hertel cba64f5869 Fix inventory plugin cache + add tests (#38229)
* Fix setting the cache when refresh_cache or --flush-cache are used

* Use jsonify function that handles datetime objects in jsonfile cache plugin

* Don't access self._options directly

* Add initial integration tests for aws_ec2 inventory plugin

* Add CI alias

* Fix and add a few more unit tests

* Add integration tests for constructed

* Fix typo

* Use inventory config templates

* Collect all instances that are not terminated by default

* Create separate playbook for setting up the VPC, subnet, security group, and finding an image for the host

Create a separate playbook for removing the resources

* Allow easier grouping by region and add an example

* use a unified json encode/decode that can handle unsafe and vault
6 years ago
James Mighion d9533c3cbf Adding changed option to save_when (#40640)
* Adding changed option to save_when

* Fixing version when changed was added.
6 years ago
Ryan Brown 858a1b09bb EC2_group module refactor (formerly pr/37255) (#38678)
* Refactor ec2_group

Replace nested for loops with list comprehensions

Purge rules before adding new ones in case sg has maximum permitted rules

* Add check mode tests for ec2_group

* add tests

* Remove dead code

* Fix integration test assertions for old boto versions

* Add waiter for security group that is autocreated

* Add support for in-account group rules

* Add common util to get AWS account ID

Fixes #31383

* Fix protocol number and add separate tests for egress rule handling

* Return egress rule treatment to be backwards compatible

* Remove functions that were obsoleted by `Rule` namedtuple

* IP tests

* Move description updates to a function

* Fix string formatting missing index

* Add tests for auto-creation of the same group in quick succession

* Resolve use of brand-new group in a rule without a description

* Clean up duplicated get-security-group function

* Add reverse cleanup in case of dependency issues

* Add crossaccount ELB group support

* Deal with non-STS calls to account API

* Add filtering of owner IDs that match the current account
6 years ago
Jordan Borean 5e28e282a5 winrm: add better exception handling for krb5 auth with pexpect (#39930)
* winrm: add better exception handling for krb5 auth with pexpect

* Added changelog fragment

* Added exception handler in case kinit path isn't valid, added test cases

* fixed for Python 2 compatibility
6 years ago
Jordan Borean 457bccf540 win_updates: add scheduled tasks back in for older hosts (#38708)
* win_updates: add scheduled tasks back in for older hosts

* Fixed up typo in category name error message

* Fixed up some minor issues after merge

* added changelog fragment

* Default to become but add override to use scheduled tasks

* Added basic unit tests for win_updates

* fix minor typos
6 years ago
flowerysong e2c1589201 Add cidr_merge filter (#36081) 6 years ago
Adam Miller bc7ff83cd9 parted module not idempotent for esp flag and name (#40547)
* parted module not idempotent for esp flag and name

Fixes #40452

Currently the parted module doesn't take into account names with
spaces in them which leads to non-idempotent transactions on the
state of the system because the name comparison will never succeed.

Also, when the esp flag is set, parted infers the boot flag and the
parted module did not previously account for this. This lead to
non-idempotent transactions as well.

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix unit tests, expected command changed in the patch

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
pierremahot 3903ca5c8e Fix ios_vlan to correctly identify unmodified config when having long interface names (#40145)
Change the command to get the interface in a vlan "show vlan" => "show vlan brief"
Change the parsing of the return command of the switch.
The return of the ios command is fixed so i cut with fix number of carracter.
Adding looking for the next line to add the forgeted interfaces.
6 years ago
Ken Evensen fabce98104 Pamd++ (#35709)
* Cleaner, more pythonic, shorter, easier to maintain

* Added validation
6 years ago
Matt Clay 8deced3e04
Fix shebangs and file modes and update tests. (#40563)
* Add execute bit sanity test and apply fixes.
* Add shebang test for `lib` dirs and apply fixes.
* Shebang and execute bit cleanup.
6 years ago
Jordan Borean 070a5557d1
always_run: removed deprecated always_run task option (#40470) 6 years ago
Tim Rupp 29559d8f25
Adds the bigip_gtm_monitor_external module (#40560)
This module can be used to manage GTM external monitors
6 years ago
Tim Rupp 1d2d4a9015
Adds bigip_monitor_external module (#40558)
This module can be used to manage external LTM monitors on a bigip
6 years ago
Ken Celenza dd02a4e943 create cisco type 5 filters (#39901) 6 years ago
Matthew Stone c0b264d7b7 Adding slxos_vlan module (#39197)
* Adding slxos_vlan module
6 years ago
Matthew Stone 683ab9bb9f Adding slxos_l3_interface module (#39320)
* Adding slxos_l3_interface module

* Corrected return values

The returned IPv4 address has a prefix length, not a subnet mask
6 years ago
Tim Rupp 9b22438a9b
Adds bigiq utility license module (#40518)
This module can be used to manage utility licenses on a BIG-IQ
6 years ago
Jordan Borean 1ac180c74d
winrm: source user from options than remote_user (#40467)
* winrm: source user from options than remote_user

* fixed up mock for kerberos import

* Added changelog fragment

* get hostname from option as well
6 years ago
Antoine Catton 39f9d3e4a6 Add the ability to specify an install_dir to the gem module (#38195)
* Add the ability to specify an install_dir to the gem module

* Add GEM_HOME when installing a non-global gem

* Add tests for custom gem path

* Fix sanity tests

* Add changelog entry

* Rebase and add tests for incorrect options

Co-authored by: Antoine Catton <devel@antoine.catton.fr>
6 years ago
Sumit Jaiswal fc8663edc0
Integration tests for Infoblox 2.5 modules (#40344)
* Update nios.py

* Update nios.py

* Update nios.py

* nios lookup errors out when there are no results #37970  Open	

Indentation failure issue resolved

* Returning empty list instead of None

In case of no results, res will be returned as an empty list instead of None (implementing ganeshrn comment)

* infoblox ipv6 support changes

* infoblox ipv6 support changes

* for fixing pep8 errors

* moving ipaddr check to utils

* adding ipv6addr check

* increasing space to resolve pep8 error

* modified the playbook examples to valid ones

* Update nios_network.py

* integration tests for nios 2.5 modules

* modification done in existing integration nios testcases

* dns_view nios module tc

* host_record nios module tc

* network nios module tc

* network_view nios module tc

* zone nios module tc

* changes to fix shippabe errors for PR 40344

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable fix

* PR40344 shippable error fix

* 40344 shippable fix

* 40344 shippable fix

* 40344 shippable fix

* 40344 shippable fix

* 40344 shippable fix

* 40344 shippable fix

* PR40344 shippable error fix for block comment should start with '# '
6 years ago
Tim Rupp 1190591e3c
Adds the bigip_gtm_global module (#40430)
This module can be used to manage the global GTM settings on a BIGIP
6 years ago
Tim Rupp 510995bd83
Adds remaining fqdn params to bigip_node (#40427)
This patch adds params for auto_populate, address type, up interval
and down interval params to bigip node
6 years ago
Tim Rupp f87cda8a54
small fixes and additions to bigip_virtual_address (#40362)
* Updated parameter names to match updated features in BIGIP
* Added support for route domains
6 years ago
Scott Buchanan b12cf754f6 1Password lookup plugin (#37207)
* add pytest_cache to gitignore

* onepassword lookup plugin

* fix linter/style test complaints

* second pass at making pycodestyle happy

* use json module instead of jq

* update copyrights, license & version added

* fix python2 compatibility

* doh. fix spacing issue.

* use standard ansible exception

* remove potentially problematic stdin argument

* actually call assertion method

* add support for top-level fields

* make vault uuids pedantically consistent in fixture

* fix new style issues

* ability specify section & correct case handling

* improve error handling

* add onepassword_raw plugin

* Add maintainer info

* Move common code to module_utils/onepassword.py

* Load raw data JSON data for easier use in Ansible

* Put OnePass class back inside lookup plugin

There is no good place for sharing code across lookups currently.

* Remove debugging code in unit tests

* Patche proper module in raw unit tests

* Add changelog entry

Co-authored-by: Scott Buchanan <sbuchanan@ri.pn>
6 years ago
Sam Doran c9d3bb59a4 Do not join flag parameters in iptables module (#36658)
* Do not join flag parameters

This put a comma between every character of the tcp flag parameters, resulting in a bad iptables command.

Fixes #36490

* Use suboptions to ensure tcp_flags options are lists

* Add unit tests for tcp_flags

* Add example of how to use tcp_flags
6 years ago
Marcus Watkins 279cf596dc New Module: gitlab_hooks module and related tests (#40096)
* Added gitlab_hooks module and related tests

* Fix sanity check issues

* Refactor to use common util method, add check_mode support

* Fix module shebang
6 years ago
Marcus Watkins 7d87995207 New Module: gitlab_deploy_key and related tests (#40097)
* Added module gitlab_deploy_key and related tests

* Fix sanity check issues

* Refactor to use common util method, add check_mode support

* Fix module shebang
6 years ago
Anil Kumar Muraleedharan 1cb4619c9a Modifying cnos-facts, cnos_command and cnos-config in line with the design followed in Ansible. Adding unit test cases for these modules. Added plugins to support them. (#39955)
* Modifying cnos-facts, cnos_command and cnos-config in line with the design followed in Ansible. Adding unit test cases for these modules. Added plugins to support them.

* Removing doc fragment conflicts with other modules

* Replacing show with display
6 years ago
Jordan Borean 5c39c3b2d1
Module basic.py to create parent dirs of tmpdir if needed (#40201)
* Module basic.py to create parent dirs of tmpdir if needed

* Added warning to dir creation

* Assert if make_dirs was called or not in unit tests
6 years ago
Tim Rupp b325e9900c
Adds BIGIQ application HTTPS WAF module (#40270)
This module can be used to manage HTTPS WAF applications on a BIGIQ
6 years ago
Tim Rupp 1f2cfb0a91
Adds the BIGIQ application HTTPS offload module (#40269)
This module allows you to manage HTTPS offload applications on a BIGIQ
6 years ago
Toshio Kuratomi ca4147f2cc Fixes #34893 (#40166)
Fixes several bugs exposed in #34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances
6 years ago
Tim Rupp 4f19e6f436
Adds the BIGIQ FastL4 UDP application module (#40257)
This module allows you to manage FastL4 applications on a BIGIQ
6 years ago
Tim Rupp 398c57e70d
Adds the BIGIQ application fastl4 tcp module (#40216)
This module allows you to manage FastL4 TCP Applications on a BIGIQ
6 years ago
Ricardo Carrillo Cruz 62e1c14edc
Pull persistent connection parameters via get_option (#39367)
* WIP Pull persistent connection parameters via get_option

* Fix pep8

* Add use_persistent_connection setting to paramiko_ssh plugin

* Add vars section to persistent_command_timeout setting and prevail provider values over config manager

* Use persistent_command_timeout on network_cli instead of timeout

* Fix unit tests

If we don't call loader to get network_cli, then _load_name is never
set and we get KeyError.

* Pull persistent_command_timeout via config  manager for ios connection local

* Pull persistent_command_timeout via config manager on connection local
6 years ago
Ganesh Nalawade 865f2c5990
Fix junos_config confirm timeout issue (#40238)
* Fix junos_config confirm timeout issue

* Fix unit test
6 years ago
Tim Rupp 5ae499466b
Adds BIGIQ Fast HTTP module (#40213)
This module can be used to manage Fast HTTP applications on a BIGIQ
6 years ago
Tim Rupp 576ad58b0f
Adds the BIGIQ application HTTP module (#40211)
This module can be used to manage http applications on a BIGIQ
6 years ago
Jordan Borean 44ab948e5d
create module tmpdir based on remote_tmp (#39833)
* create module tmpdir based on remote_tmp

* Source remote_tmp from controller if possible

* Fixed sanity test and not use lambda

* Added expansion of env vars to the remote tmp

* Fixed sanity issues

* Added note around shell remote_tmp option

* Changed fallback tmp dir to ~/.ansible/tmp to make shell defaults
6 years ago
Abhijeet Kasurde e53d9b0017
icinga2_feature: fix module in check_mode (#39853)
* icinga2_feature: fix module in check_mode

* modify check_mode logic

Fixes: #39830

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Tim Rupp 383a4f026e
Various f5 modules fixes (#40037)
* Add members to bigip_gtm_pool
* Add monitors to bigip_gtm_pool
* Add availability_requirements to bigip_gtm_pool
* Refactor bigip_gtm_pool
* Normalize the product value returned by gtm facts
* Corrected various documentation
* Updated various F5 coding conventions
* Add partition to bigip_static_route
* Added more unit tests
6 years ago
Tim Rupp 61e7c77dec
Various bigip gtm server and vs enhancements (#40033)
* Refactor bigip_gtm_virtual_server
* Add translation_address to bigip_gtm_virtual_server
* Add translation_port to bigip_gtm_virtual_server
* Add availability_requirements to bigip_gtm_virtual_server
* Add monitors to bigip_gtm_virtual_server
* Add virtual_server_dependencies to bigip_gtm_virtual_server
* Add link to bigip_gtm_virtual_server
* Add limits to bigip_gtm_virtual_server
* Add partition to bigip_gtm_virtual_server
* Fix bigip_gtm_server to correctly create other server types
6 years ago
Tim Rupp 1aa248f4e2
Adds various features to bigip virtual server (#40031)
* Add type to virtual_server
* Add address_translation to virtual_server
* Add port_translation to virtual_server
* Add ip_protocol to virtual_server
* Add firewall_enforced_policy to virtual_server
* Add firewall_staged_policy to virtual_server
* Add security_log_profiles to virtual_server
6 years ago
Tim Rupp d312c2aed7
Various bigiq fixes (#40024)
Udpdating coding conventions
6 years ago
Tim Rupp ea77c0d4f5
Adds the bigiq regkey license assignment module (#40025)
This module can be used to assign licenses to a bigip from a bigiq
regkey pool
6 years ago
Tim Rupp 48e5791860
Minor fixes and additions to f5 modules (#39987)
* Fixes to docs
* Fix escaping quotes in bigip_command
* F5 coding conventions cleanup
* “warn” and “chdir” parameters added to bigip_command
6 years ago
Tim Rupp c5fa718174
Adds bigip_device_license module (#39985)
This module can be used to license and unlicense BIGIP devices. This
does not include licensing them via BIGIQ. To do that, use BIGIQ modules
6 years ago
Tim Rupp 4d691e9d7b
Various fixes and features for bigip modules (#39972)
* Removed forwarders parameter that did not work
* Updated coding conventions
* Added ssl_cipher_suite and ssl_protocols to bigip_device_httpd
* Added more unit tests
6 years ago
Tim Rupp 742fd3a91a
Adds misc fixes for gtm facts module (#39966)
Codifies some parameters and fixes f5 coding conventions
6 years ago
Tim Rupp 84136c0248
Adds the bigip gtm monitor bigip module (#39965)
This module can be used to manage bigip monitors on a bigip's GTM
6 years ago
Tim Rupp 08516df29d
Adds bigip gtm monitor firepass module (#39964)
This module can be used to manage firepass monitors on a bigip's GTM
6 years ago
Tim Rupp 115ba79f10
Adds the bigip gtm monitor https module (#39943)
This module is used to manage the HTTPS monitors on a GTM
6 years ago
Tim Rupp 4f703cf299
Adds module for F5 gtm tcp half open monitors (#39939)
This module can assist in managing TCP half open monitors in GTM
6 years ago
Tim Rupp 632a39232c
Adds the bigip gtm monitor tcp module (#39942)
This module can be used to manage tcp monitors on GTM
6 years ago
Tim Rupp 868c2630dd
Adds bigip gtm monitor http module (#39944)
This module can be used to manage http monitors on a GTM
6 years ago
Matthew Stone e80ea39903 Adding slxos_l2_interface module (#39309) 6 years ago
Matthew Stone fb457b4200 Adding slxos_linkagg module (#39190) 6 years ago
Matthew Stone a8156c52d4 Adding slxos_interface module (#39123)
* Adding slxos_interface module

* Fixing sanity checks

* Fixing slxos_config tests for fixture change in slxos_interface
6 years ago
Tim Rupp 64ee8da3f1
Adds the bigip_gtm_pool_member module (#39937)
This module can be used to manage individual pool members on a bigip's
GTM installation
6 years ago
Tim Rupp ad5fdf5eb7
Fixes for bigip_gtm_wide_ip (#39931)
Added the irules parameter. Misc corrections of invalid parameter
names and internal behaviors.
6 years ago
Jeffrey Forman be3670f528 fix 'doas' become_method support, previously committed patch not submitted to devel branch (#37511)
* fix become_method 'doas' support by properly specifying becomecmd

a repatch of https://github.com/ansible/ansible/pull/13451/ which was never committed to 'devel' branch.

* fix play_context test for become_method doas to match new becomecmd
6 years ago
Matt Martz 1663b64e18
Allow subspec defaults to be processed when the parent argument is not supplied (#38967)
* Allow subspec defaults to be processed when the parent argument is not supplied

* Allow this to be configurable via apply_defaults on the parent

* Document attributes of arguments in argument_spec

* Switch manageiq_connection to use apply_defaults

* add choices to api_version in argument_spec
6 years ago
Rob b5cffe8ced [aws] Create classes for Application Load Balancer (#33769)
* Create classes for Application Load Balancer
* Add unsupported CI alias
* Add AWSRetry
* Add integration tests using the ALB
6 years ago
Sloane Hertel 923f676836
[ec2_vpc_vgw] [ec2_vpc_vpn] stabilize modules for PR 35983 (#38666)
* Stabilize ec2_vpc_vgw and ec2_vpc_vpn so tests for ec2_vpc_vpn_facts in PR 35983 can be run in CI

* Add updated placebo recordings

* ensure find_vgw uses the virtual gateway id if available

Add AWSRetry.jittered_backoff to attach_vpn_gateway to deal with errors when attaching a new VPC directly after detaching

Add integrations tests for ec2_vpc_vgw

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

fixes #36616


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

* Adding slxos module_utils load_config test

* Adding slxos_config module tests

* Removing unneeded required false statements from slxos_config module

* Removing version_aded from slxos_config module

* Removing force and save from slxos config module

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

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

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

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

* Update copyright in header

* Adding missing module init

* Cleaning up shebangs/licensing.

* Incorporating feedback

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

* Adding cliconf tests

* Fixing 3.X tests

* Adding docstrings to test methods for slxos cliconf tests

* Adding slxos terminal tests

* Adding slxos module_utils tests

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

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

fixes #37162

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

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

* Ensure proper cookie ordering, make key plural

* Add note about cookie sort order

* Add tests for duplicate headers and cookies_string

* Extend tests, normalize headers between py2 and py3

* Add some notes in test code

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

* shippable fix

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

* Start adding file for generic functions throughout urls

* Add tests for maybe_add_ssl_handler

* Remove commented out line

* Improve coverage of maybe_add_ssl_handler, test basic_auth_header

* Start tests for open_url

* pep8 and ignore urlopen in test_url_open.py tests

* Extend auth tests, add test for validate_certs=False

* Finish tests for open_url

* Add tests for fetch_url

* Add fetch_url tests to replace-urlopen ignore

* dummy instead of _

* Add BadStatusLine test

* Reorganize/rename tests

* Add tests for RedirectHandlerFactory

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

* Update tests to handle recent changes to RedirectHandlerFactory

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

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

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

Fix the following error (related to b455901):

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #36848

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

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

* Add handlers scaffolding

* Fix shippable errors by setting default

* Add unit tests and fix shippable

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

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

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

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

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

* speed idempotence and add unittest

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

* fabric_forwarding_anycast_gateway applicable for svi type intf only

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

* fix speed

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

* gitlab_project: report encountered errors

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

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

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

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

fixes #36563

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

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

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

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

* add terminal dont-ask to nxos_feature and nxos_lldp

* put interfaces in L2 mode for N35

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

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

* shippable fix

* review comments

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

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

Migrate all OpenStack modules to use openstack_cloud_from_module.

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

Only pull specific OpenStack arguments for the constructor

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

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

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

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

* add unit tests

* optimize a bit

* re-add get_exception import

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

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

* Add edgeos_config module

* Remove debugging statements

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

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

* Add documentation and some sanity test fixes

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

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

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

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

* aws ssm parameter lookup - pep8 / style clean up

* aws_ssm lookup plugin rewrite for more standard interface

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

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

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

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

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

* aws ssm parameter lookup - integrate with new documentation fragment

* aws ssm parameter lookup - accept either aws_profile or boto_profile

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

* Add options for gracefully disabling netscaler_server

* Add "state" suboption for netscaler_servicegroup servicemembers
Fix servicemember modification algorithm in netscaler_servicegroup
Fix monitorbindings modification algorithm in netscaler_servicegroup
7 years ago
Ken Evensen 5cce0249f3 Fixes #35629 (#35668) 7 years ago