Commit graph

8021 commits

Author SHA1 Message Date
Chris Van Heuveln
7aa0d26fda nxos_bfd_global / NxosCmdRef initial commit (#56317)
* nxos_bfd_global: initial commit

This is an initial POC with just a few commands included.  The code has been written somewhat generically so that it can act as a best practices template for re-use in future modules. The implementation follows the yaml cmd_ref style to define each command's getter/setter/type/default. It supports platform-specific defaults.

The basic logic is to collect all relevant data in a `cmd_ref` dict and pass that around to various methods.

In the BFD case the devices don't provide JSON output so we have to screen-scrape with show runs.

BFD does not support present/absent states so there is no state param.

BFD has three different property types to handle. We can add add'l types as needed:

- int
- int_list (list of ints)
- str (needs support for 'no' keyword)

* Use get_capabilities to find platform type

* PR comment fixes, round 1

* Minor cleanups

* nxos_bfd_global: create NxosCmdRef in module_utils

This commit just takes the latest bfd global code and moves the bulk
of the code into new `class NxosCmdRef` in `module_utils/nxos/nxos.py`.

The only remaining code in `nxos_bfd_global.py` are the calls from `main()`.

* Add remaining command properties and documentation

* update argument_spec

* Add check for _exclude; add sanity test

* Add targets files for bfd

* Context and state absent updates

* Add dict support to cmd_ref

* Changed remaining list commands to dict usage

* Add idempotence check for dict

* Fix existing overwrite bug

* Move pattern matching logic into its own method

* add support for 'command: absent'

* Add `get_platform_shortname`; update BFD platform-specific settings

* /absent/deleted/

* /sh/show/ in prepare_nxos_tests

* add dict check to get_platform_shortname

* Add normalize_defaults()

* UTs for bfd_global

* support yaml for both py2/py3

* update cmd_ref doc header

* Fix python2.6 incompatibility with dict comprehensions

* Fix bfd_global doc header (yaml syntax fail)

* more shippable fixes

* yet more shippable fixes

* shippable: remove r' ' wrappers

* docfix - remove ':'

* escape regex ctl chars in yaml table

* remove extra blank lines

* Fix str(None) issue

* Command context updates

* import PY2,PY3 instead of import sys

* fix ordereddict import & parent_context

* try/except for yaml import

* fix import issue for ordereddict

* remove epdb

* nxosCmdRef_import_check() workaround for shippable

* fix PEP ws errors
2019-06-06 15:52:55 +05:30
Will Thames
f65ac2cf23 Add tests for #56147 (#57256)
Tests are separate for easier backporting
2019-06-06 10:59:19 +02:00
Marcus Watkins
6e94b472e8 Fix #56640: Map k8s ansible keys to api keys (#57418)
* Fix #56643: Map ansible keys to api keys

* Remove errant print line

* Fix pep8 issue

* Fix doc line

* Added test for validate_certs -> verify_ssl translation for k8s module
2019-06-06 18:51:23 +10:00
Ian Wienand
6f06fc9945 openssh_keypair: make fingerprint result a string (#57295)
The extant documentation says that the fingerprint return value is a
single string, but it is currently being returned as a split list.
Convert the returned value to a string as documented, and add some
basic test-case coverage for the return values.
2019-06-06 07:58:50 +02:00
smile37773
c6097a268c rename modules azure_rm_..._facts to azure_rm_..._info (#57395) 2019-06-06 12:10:27 +08:00
Mike Wiebe
870d8bf10b Fix nxos_vtp_version test (#57358) 2019-06-06 09:35:29 +05:30
Mike Wiebe
7c73dd3e78 nxos_install_os: Fix nxapi local failures (#55993)
* Fix nxapi failures

* Remove logit debug calls

* Remove msg_timestamps

* Fix code alignment issue
2019-06-06 09:35:08 +05:30
Matt Clay
817ec5ab48 Add PyYAML check for libyaml support. 2019-06-05 15:20:47 -07:00
Matt Clay
d758d5bab1 Disable code-smell tests on Python 2.6. 2019-06-05 15:20:47 -07:00
Matt Clay
490edbdc48 Add python version checking when using --tox. 2019-06-05 15:20:47 -07:00
Matt Clay
58f6604efa Support passing CFLAGS and LDFLAGS. 2019-06-05 15:20:47 -07:00
Matt Clay
7a4dc4b1b0 Comment on OBJC_DISABLE_INITIALIZE_FORK_SAFETY. 2019-06-05 15:20:47 -07:00
Matt Clay
d80ef9e64b Update typed-ast version to support Python 3.8. 2019-06-05 15:20:47 -07:00
Matt Clay
d9fcf95758 Add missing Python 2.6 constraint for voluptuous. 2019-06-05 15:20:47 -07:00
Matt Clay
14f8aa622e Add missing constraints for hcloud requirement. 2019-06-05 15:20:47 -07:00
Andrey Klychkov
ea9a0f36f3 postgresql_table: 57352 bugfix, add schema handling (#57391)
* 57352 bugfix, add schema handling

* 57352 bugfix, added a changelog fragment

* 57352 bugfix, added tests for rename

* 57352 bugfix, fixed tests

* 57352 bugfix, fixed typos, cosmetic changes
2019-06-05 15:06:23 -04:00
xuxiaowei0512
05e6339c49 option is marked as required but specifies a default (#57257)
* required and default are conflicting
2019-06-05 10:43:45 -04:00
Kevin Breit
919f70c357 New module - meraki_malware (#56929)
* Initial commit for meraki_malware module
- Allows for manipulation of malware configuration

* Add full documentation and improve code coverage

* Add diff support

* Type change

* Sanity check fixes

* Convert org_id from str to int for consistency

* Sanity fixes again

* Fix argument type errors

* Remove ignore items for some Meraki modules so shippable is happy
2019-06-05 10:36:39 -04:00
Kevin Breit
8bcf9b5734 meraki_network - Restructure execution logic (#56818)
* Restructure meraki_network to be simpler and work for all int tests

* Enable all integration tests and enhance error reports

* Slight tweaks to integration tests
2019-06-05 10:33:55 -04:00
Daniel Mellado Area
091bebcbf7 Add support for vlan update on ovs bridges (#57168)
This commit adds support for vlan update on openvswitch_bridge module.
2019-06-05 10:32:14 -04:00
Kevin Breit
72f2d05b6f meraki_content_filtering - Enable check mode (#54638)
* Add support for check mode.

* Add diff support
- Need to analyze diff for accuracy
- Updated check mode changed value

* Improve test coverage

* Remove a duplicate integration test
2019-06-05 10:31:50 -04:00
Kevin Breit
6da2d40500 meraki_admin - Enable check mode (#54499)
* Add support for check mode

* Add changelog fragment

* Add diff support
- Fix a few changed status
- Removed auth_key check since that's done in module_utils now
2019-06-05 10:23:54 -04:00
Ed Costello
30aeab4709 Make aws_ses_identity module work when region is provided via environment or config. (#51627)
fixes #51531
2019-06-05 09:51:58 -04:00
Martin Krizek
18f2ed63e0
file: fix setting relative paths for src for hard links (#56055) 2019-06-05 15:26:40 +02:00
Martin Krizek
705d0201cf
file: fix setting attributes for symlinked file (#57217) 2019-06-05 15:25:43 +02:00
Jordan Borean
b5b75daaa5
win_chocolatey - honour version when bootstrapping chocolatey and fix package listing (#57208)
* win_chocolatey - honour version when bootstrapping chocolatey

* skip upgrade all step

* Fix install latest step

* Remove test changes now that Chocolatey is released

* tweak the package version detection
2019-06-05 09:10:10 +10:00
Matt Clay
b1e6ad9754
Limit Python 2.6 units to modules & module_utils. (#57377) 2019-06-04 15:15:36 -07:00
Jill R
47cfbd6605
Add integration test provider for vmware (#55772)
* Add integration test provider for vmware

This change adds a new remote cloud provider option for vmware,
supporting dynamic environments running on worldstream.nl as well as
static environments specific by the user in a cloud-config template.
2019-06-04 13:49:30 -07:00
Chris Archibald
57b3160f13 new feature (#57320) 2019-06-04 13:57:54 -04:00
Abhijeet Kasurde
ee8a607cca ipaddr: Handle network address in ipmath (#57149)
* Updated testcase, documentation

Fixes: #54457

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-04 14:01:18 +05:30
Chris Van Heuveln
6bb13bbb84 nxos_vlan: fix broken purge behavior (issue #57101) (#57229)
* nxos_vlan: fix broken purge behavior (issue #57101)

Symptoms/Analysis:
- `nxos_vlan` `purge: true` would fail when `purge` was trying to delete all unspecified vlans, including vlan 1.
- `nxos` devices do not allow removing vlan 1 and raise a cli exception error
- Previous fix #55144 caused a side effect when `purge` was used: vlan changes specified by `aggregate` were ignored; e.g.
 - vlan 4 is not present; playbook specifies `aggregate: { vlan: 4 }, purge: true`
 - results in proper purging but vlan 4 is not created

Solutions:
- ignore vlan 1 when purging
- remove the `not purge` check from state present logic

Added additional unit tests and integration tests.
Tested against all regression platforms.

* PEP fixes

* Add agg_show_vlan_brief.txt fixture

* Add warning for removing vlan 1

* change method name check
2019-06-04 09:14:09 +05:30
Matt Clay
858e3a7272 Correct virtualenv usage in integration tests. 2019-06-03 15:23:04 -07:00
Felix Fontein
7b40b569b2
Rename memset_*_facts to memset_*_info (#57030)
* Rename memset_*_facts to memset_*_info

* Add changelog.
2019-06-03 21:19:49 +02:00
Stefan Horning
ddfaa83ccf s3_bucket: add encryption capabilities to the module (#55985)
* s3_bucket: add encryption capabilities to the module
2019-06-03 11:25:09 -07:00
Andrey Klychkov
3e06013eb6 unittests for module_utils.common.removed.removed_module function (#57214) 2019-06-03 11:12:12 -04:00
Mike Wiebe
87422ea7e7 nxos_snmp_user, nxos_snmp_host integration test fixes. (#57201)
* Fix nxos_snmp tests

* Add imagetag check for nxos_snmp_user test
2019-06-03 18:33:52 +05:30
Sam Doran
2e0229a4b6 ansible-vault: convert vault_password_files to list to prevent traceback (#57186)
* Convert vault_password_files to a list

* Add changelog and tests
2019-06-03 12:14:06 +02:00
Sloane Hertel
21cd24a0dd improve conditional warnings (#57190)
* Fix order for warning on templated conditionals

Fix bare variable warnings when the variable is a boolean

* changelog

* Add tests for cases that should and should not give warnings

If the behavior may change when the default behavior for CONDITIONAL_BARE_VARS becomes False there should be a warning. Boolean type conditionals will not change in behavior so don't warn.

* oops, forgot to add files

* typo
2019-06-03 12:12:32 +02:00
Andrey Klychkov
96bf243265 New module postgresql_copy: copy data between a file and a table (#56835)
* New module postgresql_copy

* New module postgresql_copy: added tests

* New module postgresql_copy: changed tests

* New module postgresql_copy: doc format fixes

* New module postgresql_copy: fixes

* New module postgresql_copy: added upper, PostgreSQL

* New module postgresql_copy: fixed description

* New module postgresql_copy: added note about superuser

* New module postgresql_copy: remove SQLParseError

* New module postgresql_copy: fixed opt_need_quotes type

* New module postgresql_copy: fixed check_mode

* New module postgresql_copy: small fix
2019-06-03 19:11:50 +10:00
René Moser
0c66a5d3ca
cloudcscale_floating_ip: add types (#56924) 2019-06-03 10:43:32 +02:00
rajaspachipulusu17
6b2688245e Pluribus Networks ipv6security raguard port module with UT (#57033)
* Pluribus Networks ipv6security raguard port module with UT

* Dox fix
2019-06-03 11:44:28 +05:30
rajaspachipulusu17
b8a317c527 Pluribus Networks vrouter packet relay module with UT (#57155)
* Pluribus Networks vrouter packet relay module with UT

* Doc fix
2019-06-03 11:43:29 +05:30
Gonéri Le Bouder
e460a219cd VMware: vmware_evc_mode: fix the functional tests (#56875)
* Updated vmware_evc_mode tests
* Remove extraneous line in main.yml

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-02 08:16:05 +05:30
Felix Fontein
c54d79bc13
Extend docker_image tests. (#57090) 2019-06-01 15:29:00 +02:00
Abhijeet Kasurde
c8eda7773e
VMware: Update vmware_guest_powerstate (#57000)
* Updated documentation
* Updated testcases
* Updated example
* Updated logic
* Provided option to specify task name, task description, task enable status etc.

Fixes: #56987

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-01 08:10:05 +05:30
Felix Fontein
7cd229aa97
Fix assignments in docker tests. (#57249) 2019-05-31 23:47:53 +02:00
Matt Martz
8bd4e2a144 cert validation fixes - Attempt 2 (#55953)
* Attempt 2 of cert validation fixes

* Remove unused code

* Cleanup the tmp cert using atexit

* Fix linting issues

* Only add SSLValidationHandler when not HAS_SSLCONTEXT

* Catch value errors on non PEM certs

* Only catch NotImplementedError to avoid masking issues

* set self._context even with PyOpenSSLContext for conformity

* Fix error building

* normalize how we interact with the context we create

* Remove unused code

* Address test for py3.7 message difference

* open_url should pass the ca_path through

* Account for new error in url lookup test

* Guard some code behind whether or not we are validating certs

* Make _make_context public

* Move atexit.register up to where the tmp file is created
2019-05-31 16:35:25 -04:00
Sviatoslav Sydorenko
4c7fff315e
Fix module_utils.common.test_collections testsuite
PR #57181
2019-05-31 13:40:18 +02:00
Rohit
ae033f1ec3
vyos interfacefix and test cases (#57169)
Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
2019-05-31 16:13:40 +05:30
Sebastiaan Mannem
223f509ea3 Issue 56430 (#57147)
* Adding integration test for 127.0.0.1/32 and ::1/128.

* Making sure file is not corrupted when render fails

* Fixes #56430

* Adding changelog for MR 57147/Issue 56430
2019-05-31 12:32:28 +02:00