diff --git a/plugins/modules/azure_rm_notificationhub.py b/plugins/modules/azure_rm_notificationhub.py index b35bdc818..5ed75f18d 100644 --- a/plugins/modules/azure_rm_notificationhub.py +++ b/plugins/modules/azure_rm_notificationhub.py @@ -113,7 +113,7 @@ "region": null, "scale_unit": null, "service_bus_endpoint": "https://testnaedd3d22d3w.servicebus.windows.net:443/", - "sku": "Free", + "sku": { "name":"Free" }, "tags": { "a": "b" }, @@ -205,7 +205,7 @@ def exec_module(self, **kwargs): if update_tags: changed = True elif self.namespace_name and not self.name: - if self.sku != results['sku'].lower(): + if self.sku != results['sku']['name'].lower(): changed = True elif self.state == 'absent': @@ -365,7 +365,7 @@ def namespace_to_dict(item): type=namespace.get('type', None), location=namespace.get( 'location', '').replace(' ', '').lower(), - sku=namespace.get("sku").get("name"), + sku=namespace.get("sku"), tags=namespace.get('tags', None), provisioning_state=namespace.get( 'provisioning_state', None), diff --git a/plugins/modules/azure_rm_notificationhub_info.py b/plugins/modules/azure_rm_notificationhub_info.py index 6c8f8f311..707042e1c 100644 --- a/plugins/modules/azure_rm_notificationhub_info.py +++ b/plugins/modules/azure_rm_notificationhub_info.py @@ -67,7 +67,7 @@ "region": null, "scale_unit": null, "service_bus_endpoint": "https://testnaedd3d22d3w.servicebus.windows.net:443/", - "sku": "Free", + "sku": {"name":"Free"}, "tags": { "a": "b" }, @@ -188,7 +188,7 @@ def namespace_to_dict(self, item): type=namespace.get('type', None), location=namespace.get( 'location', '').replace(' ', '').lower(), - sku=namespace.get("sku").get("name"), + sku=namespace.get("sku"), tags=namespace.get('tags', None), provisioning_state=namespace.get( 'provisioning_state', None), diff --git a/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml b/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml index 8ad053c9d..ed79aff83 100644 --- a/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml +++ b/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml @@ -28,6 +28,17 @@ - assert: that: results.changed +- name: Create Namespace Hub + azure_rm_notificationhub: + location: eastus2 + namespace_name: "{{ namespace_name }}" + resource_group: "{{ resource_group }}" + sku: "free" + register: results + +- assert: + that: results.changed + - name: Create Notification Hub azure_rm_notificationhub: location: eastus2 @@ -140,4 +151,3 @@ - assert: that: not results.changed - \ No newline at end of file