diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 9b146ec..33f7bbb 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -67,6 +67,7 @@ jobs: org_name: ${{ secrets.ANSIBLE_TEST_ORG_NAME }} grafana_cloud_api_key: ${{ secrets.ANSIBLE_TEST_CLOUD_API_KEY }} grafana_api_key: ${{ secrets.ANSIBLE_TEST_GRAFANA_API_KEY }} + test_stack_name: ${{ secrets.ANSIBLE_TEST_CI_STACK }} EOF - name: Set up Python diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 349c90c..e2e5dc7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,19 @@ Grafana.Grafana Release Notes .. contents:: Topics +v1.1.1 +====== + +Release Summary +--------------- + +Updated return description and value for grafana.grafana.folder module + +Minor Changes +------------- + +- Updated the return message in grafana.grafana.folder module + v1.1.0 ====== diff --git a/changelogs/.plugin-cache.yaml b/changelogs/.plugin-cache.yaml index e2166c2..2a55a21 100644 --- a/changelogs/.plugin-cache.yaml +++ b/changelogs/.plugin-cache.yaml @@ -1,10 +1,12 @@ -objects: {} +objects: + role: {} plugins: become: {} cache: {} callback: {} cliconf: {} connection: {} + filter: {} httpapi: {} inventory: {} lookup: {} @@ -52,5 +54,6 @@ plugins: netconf: {} shell: {} strategy: {} + test: {} vars: {} -version: 1.1.0 +version: 1.1.1 diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 89fd240..080753d 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -75,3 +75,9 @@ releases: - Added Role for Grafana Agent release_summary: Added Role to deploy Grafana Agent on linux hosts release_date: '2022-11-22' + 1.1.1: + changes: + minor_changes: + - Updated the return message in grafana.grafana.folder module + release_summary: Updated return description and value for grafana.grafana.folder module + release_date: '2023-02-08' diff --git a/galaxy.yml b/galaxy.yml index 16b49fd..1fcc767 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: grafana name: grafana -version: 1.1.0 +version: 1.1.1 readme: README.md authors: - Grafana Labs @@ -11,4 +11,4 @@ license: tags: [grafana, observability, monitoring] repository: https://github.com/grafana/grafana-ansible-collection issues: https://github.com/grafana/grafana-ansible-collection/issues -documentation: https://grafana.github.io/grafana-ansible-collection/ +documentation: https://docs.ansible.com/ansible/devel/collections/grafana/grafana/index.html diff --git a/plugins/modules/folder.py b/plugins/modules/folder.py index 8824503..165f34f 100644 --- a/plugins/modules/folder.py +++ b/plugins/modules/folder.py @@ -114,7 +114,7 @@ output: sample: true id: description: The ID for the folder. - returned: on success + returned: state is present and on success type: int sample: 18 title: @@ -151,7 +151,7 @@ output: description: The message returned after the operation on the folder. returned: state is absent and on success type: str - sample: "Folder foldername deleted" + sample: "Folder has been succesfuly deleted" ''' from ansible.module_utils.basic import AnsibleModule, missing_required_lib @@ -213,9 +213,9 @@ def absent_folder(module): result = requests.delete(api_url, headers={"Authorization": 'Bearer ' + module.params['grafana_api_key']}) if result.status_code == 200: - return False, True, result.json() + return False, True, {"status": result.status_code, 'response': "Folder has been succesfuly deleted"} else: - return True, False, {"status": result.status_code, 'response': result.json()['message']} + return True, False, {"status": result.status_code, 'response': "Error deleting folder"} def main(): diff --git a/tests/integration/targets/cloud_stack/tasks/main.yml b/tests/integration/targets/cloud_stack/tasks/main.yml index 64c0604..861624b 100644 --- a/tests/integration/targets/cloud_stack/tasks/main.yml +++ b/tests/integration/targets/cloud_stack/tasks/main.yml @@ -1,7 +1,7 @@ - name: Create a Grafana Cloud stack grafana.grafana.cloud_stack: - name: ansiblecollectionstack - stack_slug: ansiblecollectionstack + name: "{{ test_stack_name }}" + stack_slug: "{{ test_stack_name }}" cloud_api_key: "{{ grafana_cloud_api_key }}" org_slug: "{{ org_name }}" state: present @@ -9,7 +9,7 @@ - assert: that: - - create_result.url == "https://ansiblecollectionstack.grafana.net" + - create_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net" - name: Sleep for 30 seconds ansible.builtin.wait_for: @@ -17,8 +17,8 @@ - name: Delete a Grafana Cloud stack grafana.grafana.cloud_stack: - name: ansiblecollectionstack - stack_slug: ansiblecollectionstack + name: "{{ test_stack_name }}" + stack_slug: "{{ test_stack_name }}" cloud_api_key: "{{ grafana_cloud_api_key }}" org_slug: "{{ org_name }}" state: absent @@ -27,4 +27,4 @@ - assert: that: - delete_result.changed == true - - delete_result.url == "https://ansiblecollectionstack.grafana.net" + - delete_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net" diff --git a/tests/integration/targets/folder/tasks/main.yml b/tests/integration/targets/folder/tasks/main.yml index 65450e6..452aca6 100644 --- a/tests/integration/targets/folder/tasks/main.yml +++ b/tests/integration/targets/folder/tasks/main.yml @@ -24,5 +24,5 @@ - assert: that: - - delete_result.changed == true - - delete_result.output.message == "Folder Ansible Integration test deleted" \ No newline at end of file + - delete_result.output.status == 200 + - delete_result.output.response == "Folder has been succesfuly deleted"