Commit Graph

37410 Commits (13aff08748167b761c1a61fbd517032e7ac1511c)
 

Author SHA1 Message Date
Sachidananda Urs 3324765fdd lvg: Allow unit to be specified for pesize (#39666) 6 years ago
Ganesh Nalawade 0ac222d68b
Fix nxos terminal plugin regex (#39659)
Fix nxos terminal plugin regex to match
command prompt without newline character as prefix
6 years ago
Abhijeet Kasurde d1cd6ee56d VMware: Allow user to set customization specification (#38530)
This fix adds new argument parameter which allows user to
set customization specification which is already created with required
values like Windows Product Key and Networking details etc.

Fixes: #38404

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Abhijeet Kasurde 6e6325503a VMware: check SwitchUUID value before assigning (#38369)
This fix adds a check for switchuuid value of distributed virtual switch.
When there is no association between hostsystem and distributed virtual portgroup,
both specified by user, then module does not find DVSwitch.
This patch tries to mitigate that problem.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Clay a121b5073c Temporarily disable the nuage_vspk test.
This test interferes with the uri test on centos6.
6 years ago
Seuf 82645bdf40 Added alexanderzobnin-zabbix-datasource datasource type (#36948) 6 years ago
Daniel Jaouen 63ce4cf03d Homebrew: Update _uninstall_current_package to use the --force option (#33360) 6 years ago
hyperized f210bbec50 rabbitmq_bindings rewrite (#35651)
* Attempt to get rid of globals

* Relocate imports and make formatting non-automatic

* spacing!
6 years ago
Shinichi TAMURA 75e69fe709 timezone module: fixed timezone identification logic in *BSD (#36715) 6 years ago
René Moser aa874c3c36
influxdb_query: fix use of common return results (#39626) 6 years ago
Matt Martz 3b496db4d8
Make sure that the implicit async_status gets the env from a task with async. Fixes #39699 (#39764) 6 years ago
Jordan Borean fc210a4584
base64 filter: Added ability to specify encoding (#39714)
* base64 filter: Added ability to specify encoding

* Added unicode chars for further testing

* Removed errors to keep previous behaviour in place

* Removed surrogate pairs due to issues loading YAML in CI
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
Mickaël Guérin 8ac69b0a5f Fix gathering facts in run_once play (#39453)
* Fix gathering facts in run_once play

Fixes https://github.com/ansible/ansible/issues/39312

* Check that run_once doesn't prevent fact gathering
6 years ago
Alex Stephen 05d5d21d1c New module: GCP Container Node Pools (#37325) 6 years ago
Alex Stephen 5b0ce0222b Bug fixes for GCP Compute Address (#38630) 6 years ago
Alex Stephen e177cf5831 New module: GCP Pubsub Topics (#38627) 6 years ago
Alex Stephen e116c6cee8 New module: GCP Pubsub Subscriptions (#38626) 6 years ago
Alex Stephen 478759a686 New module: GCP Compute Subnetworks (#38621) 6 years ago
Alex Stephen 01f0e4ac6f New module: GCP Compute Networks (#38618) 6 years ago
Alex Stephen 768a81dd4b New module: GCP Compute Routes (#38619) 6 years ago
Martin Krizek c57d476871
import_role docs: loop is not supported (#39725) 6 years ago
Matt Martz 1c4448666e
Add changelog entries for 2.6 include fixes (#39750) 6 years ago
Ondra Machacek 39d9ff9d2c ovirt: Don't return ID as list in fetch_nested (#39736)
* ovirt: Don't return ID as list in fetch_nested

* ovirt_permissions_facts: Fix pylint
6 years ago
Matt Martz 3d5a7d6dc2
Allow using action/local_action on includes and imports (#37260)
* Prevent using action/local_action on includes and imports. Fixes #28822

* Use ModuleArgsParser to determine action instead of disallowing action/local_action with import/include

* Add to_native

* switch back to block in task_ds, use ModuleArgsParse otherwise

* var should be task_ds

* Add test validating action+include_tasks
6 years ago
Trishna Guha dddcbb7198
use show run instead of section pipeline ios_l2_interface (#39658)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Matt Martz d44fd70d02
Fix E126, E123 pep8 errors, and ansible-format-automatic-specification pylint error (#39740) 6 years ago
Ganesh Nalawade 4c5ac16447
Fix ios integration test failures in CI (#39729)
Fix ios integration test failures in CI. Since the packet transfer and receive rate
on the interface is not determined to remove the tx_rate and rx_rate test conditions
to prevent intermittent failure.
6 years ago
Julien Palard ab4cbfd5d3 FIX: Removing superfluous bloc wrongly introduced in 2b7799f817. (#39723) 6 years ago
Ondra Machacek dda31aa3f7 ovirt: Return ID for permissions facts (#39721) 6 years ago
Trishna Guha 9eff1f1d74
Handle nxos_feature issue where json isn't supported (#39150)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Yuwei Zhou 9348809184 Fixes #37731 Create Internal Loadbalancers with azure_rm_loadbalancer, support SKU (#38077)
* create internal loadbalancer

* fix test

* remove duplicate test

* clean up

* fix doc

* lint

* add sku support

* update version

* change to the version the same as CLI

* add pip support sku

* fix lint

* fix test

* Update main.yml

* add changelog entry
6 years ago
Toshio Kuratomi 17a4553c68 Reorganize and expand the file tests
* Pull the tests for state=link into their own file
* Pull tests for what happens when dest is a directory out
* Expand both of the above sets of tests
6 years ago
Pilou a5d320f8e7 vdirect modules: fix 'import' sanity test (#39706)
* vdirect modules: fix 'import' sanity test

* Remove passing file from import skip list.

* vdirect modules: fix validate-modules warnings

- Arguments with a default should not be marked as required
- add choices in doc

* vdirect_runnable: use formatting function
6 years ago
Toshio Kuratomi 6b159fdb03 Fix for file module with recursive permission setting and broken symlinks
There was a traceback when setting permissions on a directory tree when
there were broken symlinks inside of the tree and follow=true.  chmod -R
ignores broken symlinks inside of the tree so we've fixed the file
module to do the same.

Fixes #39456
6 years ago
Toshio Kuratomi 4f664f8ff6
Fix for file module with symlinks to nonexistent target (#39635)
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes #39558
6 years ago
Jordan Borean f75b7a9437
win_get_url: Fixed a few issues with using FTP and added tests (#39646)
* win_get_url: Fixed a few issues with using FTP and added tests

* Fixed typo in docs
6 years ago
Brian Coca df1001577f
rebase base playbook base (#39533)
* rebase base playbook base

fixes issues with loop control allowing generic attributes it shouldn't
6 years ago
Kevin Breit c8d287fece Meraki organization module (#38773)
* Initial commit

Query an organization within Meraki. No support is in place for managing
or creating yet

* Change output_level method and make the state parameter required.

* Implemented listing all organizations

- Updated documentation
- Parse results and return all organizations
- Parse results and return specified organization

* Framework for creating an organization

- Documentation example for organization creation
- Framework exists for creating organizations, pending PR 36809
- Created functions for HTTP calls
- Renamed from dashboard.meraki.com to api.meraki.com
- Added required_if for state

* Remove absent state

- Meraki API does not support deleting an organization so absent is removed
- Updated documentation to call it state instead of status

* Small change to documentation

* Support all parameters associated to organization

- Added all parameters needed for all organization actions.
- None of the added ones work at this time.
- Added documentation for clone.

* Integration test for meraki_organization module

* Rename module to meraki for porting to module utility

* Meraki documentation fragment

- Created initial documentation fragment for Meraki modules

* Add meraki module utility to branch. Formerly was on a separate branch.

* CRU support for Meraki organization module

* CRU is supported for Meraki organizations
* There is no DELETE function for organizations in the API
* This code is very messy and needs cleanup
* Create and Update actions don't show status as updated, must fix

* Added Meraki module utility to module utility documentation list

* Added support for organization cloning
* Renamed use_ssl to use_https
* Removed define_method()
* Removed is_org()
* Added is_org_valid() which does all org sanity checks

* Fixes for ansibot
- Changed default of use_proxy from true to false
- Removed some commented out code
- Updated documentation

* Changes for ansibot
- Removed requirement for state parameter. I may readd this.
- Updated formatting

diff --git a/lib/ansible/module_utils/network/meraki/meraki.py b/lib/ansible/module_utils/network/meraki/meraki.py
index 3acd3d1038..395ac7c4b4 100644
--- a/lib/ansible/module_utils/network/meraki/meraki.py
+++ b/lib/ansible/module_utils/network/meraki/meraki.py
@@ -42,7 +42,7 @@ def meraki_argument_spec():
     return dict(auth_key=dict(type='str', no_log=True, fallback=(env_fallback, ['MERAKI_KEY'])),
                 host=dict(type='str', default='api.meraki.com'),
                 name=dict(type='str'),
-                state=dict(type='str', choices=['present', 'absent', 'query'], required=True),
+                state=dict(type='str', choices=['present', 'absent', 'query']),
                 use_proxy=dict(type='bool', default=False),
                 use_https=dict(type='bool', default=True),
                 validate_certs=dict(type='bool', default=True),
diff --git a/lib/ansible/modules/network/meraki/meraki_organization.py b/lib/ansible/modules/network/meraki/meraki_organization.py
index 923d969366..3789be91d6 100644
--- a/lib/ansible/modules/network/meraki/meraki_organization.py
+++ b/lib/ansible/modules/network/meraki/meraki_organization.py
@@ -20,11 +20,9 @@ short_description: Manage organizations in the Meraki cloud
 version_added: "2.6"
 description:
 - Allows for creation, management, and visibility into organizations within Meraki
-
 notes:
 - More information about the Meraki API can be found at U(https://dashboard.meraki.com/api_docs).
 - Some of the options are likely only used for developers within Meraki
-
 options:
     name:
         description:
@@ -32,21 +30,18 @@ options:
         - If C(clone) is specified, C(name) is the name of the new organization.
     state:
         description:
-        - Create or query organizations
-        choices: ['query', 'present']
+        - Create or modify an organization
+        choices: ['present', 'query']
     clone:
         description:
         - Organization to clone to a new organization.
-        type: string
     org_name:
         description:
         - Name of organization.
         - Used when C(name) should refer to another object.
-        type: string
     org_id:
         description:
         - ID of organization
-
 author:
     - Kevin Breit (@kbreit)
 extends_documentation_fragment: meraki
@@ -86,7 +81,6 @@ RETURN = '''
 response:
     description: Data returned from Meraki dashboard.
     type: dict
-    state: query
     returned: info
 '''

@@ -103,6 +97,7 @@ def main():
     argument_spec = meraki_argument_spec()
     argument_spec.update(clone=dict(type='str'),
+                         state=dict(type='str', choices=['present', 'query']),
                          )

@@ -125,11 +120,9 @@ def main():

     meraki.function = 'organizations'
     meraki.params['follow_redirects'] = 'all'
-    meraki.required_if=[
-                           ['state', 'present', ['name']],
-                           ['clone', ['name']],
-                           # ['vpn_PublicIP', ['name']],
-                       ]
+    meraki.required_if = [['state', 'present', ['name']],
+                          ['clone', ['name']],
+                          ]

     create_urls = {'organizations': '/organizations',
                    }
@@ -162,23 +155,16 @@ def main():

-
-    # method = None
-    # org_id = None
-
-
-    # meraki.fail_json(msg=meraki.is_org_valid(meraki.get_orgs(), org_name='AnsibleTestOrg'))
-
     if meraki.params['state'] == 'query':
-      if meraki.params['name'] is None:  # Query all organizations, no matter what
-        orgs = meraki.get_orgs()
-        meraki.result['organization'] = orgs
-      elif meraki.params['name'] is not None:  # Query by organization name
-        module.warn('All matching organizations will be returned, even if there are duplicate named organizations')
-        orgs = meraki.get_orgs()
-        for o in orgs:
-          if o['name'] == meraki.params['name']:
-            meraki.result['organization'] = o
+        if meraki.params['name'] is None:  # Query all organizations, no matter what
+            orgs = meraki.get_orgs()
+            meraki.result['organization'] = orgs
+        elif meraki.params['name'] is not None:  # Query by organization name
+            module.warn('All matching organizations will be returned, even if there are duplicate named organizations')
+            orgs = meraki.get_orgs()
+            for o in orgs:
+                if o['name'] == meraki.params['name']:
+                    meraki.result['organization'] = o
     elif meraki.params['state'] == 'present':
         if meraki.params['clone'] is not None:  # Cloning
             payload = {'name': meraki.params['name']}
@@ -193,7 +179,10 @@ def main():
             payload = {'name': meraki.params['name'],
                        'id': meraki.params['org_id'],
                        }
-            meraki.result['response'] = json.loads(meraki.request(meraki.construct_path('update', org_id=meraki.params['org_id']), payload=json.dumps(payload), method='PUT'))
+            meraki.result['response'] = json.loads(meraki.request(meraki.construct_path('update',
+                                                                                        org_id=meraki.params['org_id']),
+                                                                  payload=json.dumps(payload),
+                                                                  method='PUT'))

diff --git a/lib/ansible/utils/module_docs_fragments/meraki.py b/lib/ansible/utils/module_docs_fragments/meraki.py
index e268d02e68..3569d83b99 100644
--- a/lib/ansible/utils/module_docs_fragments/meraki.py
+++ b/lib/ansible/utils/module_docs_fragments/meraki.py
@@ -35,6 +35,7 @@ options:
         description:
         - Set amount of debug output during module execution
         choices: ['normal', 'debug']
+        default: 'normal'
     timeout:
         description:
         - Time to timeout for HTTP requests.
diff --git a/test/integration/targets/meraki_organization/aliases b/test/integration/targets/meraki_organization/aliases
new file mode 100644
index 0000000000..ad7ccf7ada
--- /dev/null
+++ b/test/integration/targets/meraki_organization/aliases
@@ -0,0 +1 @@
+unsupported

* Formatting fix

* Minor updates due to testing
- Made state required again
- Improved formatting for happier PEP8
- request() now sets instance method

* Fix reporting of the result

* Enhance idempotency checks
- Remove merging functionality as the proposed should be used
- Do check and reverse check to look for differences

* Rewrote and added additional integration tests. This isn't done.

* Updated is_update_required method:
- Original and proposed data is passed to method
- Added ignored_keys list so it can be skipped if needed

* Changes per comments from dag
- Optionally assign function on class instantiation
- URLs now have {} for substitution method
- Move auth_key check to module utility
- Remove is_new and get_existing
- Minor changes to documentation

* Enhancements for future modules and organization
- Rewrote construct_path method for simplicity
- Increased support for network functionality to be committed

* Changes based on Dag feedback and to debug problems

* Minor fixes for validitation testing

* Small changes for dag and Ansibot
- Changed how auth_key is processed
- Removed some commented lines
- Updated documentation fragment, but that may get reverted

* Remove blank line and comment

* Improvements for testing and code simplification
- Added network integration tests
- Modified error handling in request()
	- More testing to come on this
- Rewrote construct_path again. Very simple now.

* Remove trailing whitespace

* Small changes based on dag's response

* Removed certain sections from exit_json and fail_json as they're old
6 years ago
Matt Clay c2d7347819 Enable nuage_vspk tests for Python 2.7. 6 years ago
Julien Vey a6d5656dd8 ec2_instance: add a retry to run_instance to help with ec2 consistency 6 years ago
Julien PRIGENT 1905a6e8fb ec2_vpc_route_table: Update matching_count parsing on find_subnets fu… (#38707)
* ec2_vpc_route_table: Update matching_count parsing on find_subnets function and tests

* ec2_vpc_route_table: Update matching_count parsing on find_subnets function
6 years ago
Matt Martz aeecdbfc35
Restore previous test play, break new tests into a new play (#39688) 6 years ago
John R Barker 62b03d93bc
Use ansible-test, not nxos.yaml (#39692) 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
John R Barker 923a81e9e5
vyos_interface require multiple network nodes to run (#39670)
* vyos_interface require multiple network nodes to run

We don't have the ability to run these currently, so disable them.
The original logic was also incorrect, the tests don't pass on lab, DCI
nor single instance nodepool, so disable

https://github.com/ansible/ansible/issues/39667 tracks getting these
enabled again

* eth0 -> Gi0/0

* Correctly detect if we should run lldp

* Correctly detect if we should run lldp
6 years ago
saichint f99bae1776 Fix for nxos_snmp_host issues (#39642)
* fix snmp_host issues

* source files

* fix shippable

* remove defaults to match arg spec
6 years ago
saichint 99748cbfa4 fix nxos_snmp_traps issues (#39444)
* fix snmp_traps code

* add IT cases

* fix shippable

* fix shippable without ignore
6 years ago
Adam Miller d49a09d05e
fix sanity checks to make shippable happy (#39685)
Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Seuf cc477ba8cc Don't split line when no version available for plugin (#37907)
* Don't split line when no version available for plugin

* Fixed author github account
6 years ago