Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new module azure_rm_datalakestore #352

Conversation

next-davidduquehernandez
Copy link
Contributor

SUMMARY

This module allows to deploy, update and delete an Azure Data Lake Store (A.K.A. Data Lake Gen1).

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME
  • azure_rm_datalakestore
  • azure_rm_datalakestore_info
ADDITIONAL INFORMATION

All dev info could be found at https://docs.microsoft.com/en-us/rest/api/datalakestore/

@next-davidduquehernandez next-davidduquehernandez changed the title Feature/new module datalakestore Add new module azure_rm_datalakestore Dec 5, 2020
Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@next-davidduquehernandez You can check the module through the link below. Thank you very much! link: https://docs.ansible.com/ansible/devel/dev_guide/testing_sanity.html#testing-sanity

plugins/module_utils/azure_rm_common.py Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore.py Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@next-davidduquehernandez Please remove the duplicate lines!

plugins/modules/azure_rm_datalakestore_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_datalakestore.py Outdated Show resolved Hide resolved
@Fred-sun
Copy link
Collaborator

@next-davidduquehernandez Thank you for your contribution, please help to fix the plugins/module_utils/azure_rm_common.py file conflict! Thank you very much!

@next-davidduquehernandez
Copy link
Contributor Author

@Fred-sun Merge realized, sanity and integration tests passed correctly after merge. Regards

@Fred-sun Fred-sun added new_module_pr Add new modules work in In trying to solve, or in working with contributors labels Mar 16, 2021
@Fred-sun
Copy link
Collaborator

@next-davidduquehernandez Did you test the PlayBook you wrote? Can you share the results? Thank you!

@next-davidduquehernandez
Copy link
Contributor Author

@next-davidduquehernandez Did you test the PlayBook you wrote? Can you share the results? Thank you!

Hi @Fred-sun, of course.

My playbook:

---
- hosts: localhost
  connection: local

  collections:
    - azure.azcollection

  vars:
    base_dir: "{{ lookup('env','PWD') | basename }}"
    location: westeurope

  pre_tasks:

    - name: Set resource group
      set_fact:
        resource_group: "aaa"

  tasks:

    - name: Create resource group '{{ resource_group }}'
      azure_rm_resourcegroup:
        name: "{{ resource_group }}"
        location: "{{ location }}"

    - block:

        - name: Import storage test task
          import_tasks: "{{ lookup('env','PWD') }}/tests/integration/targets/azure_rm_datalakestore/tasks/main.yml"

      always:

        - name: Destroy resource group '{{ resource_group }}'
          azure_rm_resourcegroup:
            name: "{{ resource_group }}"
            location: "{{ location }}"
            force_delete_nonempty: true
            state: absent

Results:

ansible-playbook testing/playbook.yml 
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ***************************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************************
ok: [localhost]

TASK [Set resource group] ******************************************************************************************************************************************************************
ok: [localhost]

TASK [Create resource group 'aaa'] *********************************************************************************************************************************************************
changed: [localhost]

TASK [Create data lake store name] *********************************************************************************************************************************************************
ok: [localhost]

TASK [Create virtual network] **************************************************************************************************************************************************************
changed: [localhost]

TASK [Create subnet] ***********************************************************************************************************************************************************************
changed: [localhost]

TASK [Create minimal data lake store] ******************************************************************************************************************************************************
changed: [localhost]

TASK [Assert status succeeded and results] *************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Create minimal data lake store (Idempotence)] ****************************************************************************************************************************************
ok: [localhost]

TASK [Assert that status has not changed] **************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Update data lake store to add virtual_network_rules] *********************************************************************************************************************************
changed: [localhost]

TASK [Assert status succeeded and results include virtual_network_rules] *******************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Update data lake store to change encryption state that must fail] ********************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Encryption type cannot be updated."}
...ignoring

TASK [Assert that encryption state cannot change] ******************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Update data lake store to add new_tier] **********************************************************************************************************************************************
changed: [localhost]

TASK [Assert status succeeded and results include virtual_network_rules] *******************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Delete minimal data lake store] ******************************************************************************************************************************************************
changed: [localhost]

TASK [Create new data lake store] **********************************************************************************************************************************************************
changed: [localhost]

TASK [Assert status succeeded and results include an Id value] *****************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Create new data lake store (Idempotence)] ********************************************************************************************************************************************
ok: [localhost]

TASK [Assert that status has not changed] **************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Delete virtual network] **************************************************************************************************************************************************************
changed: [localhost]

TASK [Delete Data Lake Store] **************************************************************************************************************************************************************
changed: [localhost]

TASK [Destroy resource group 'aaa'] ********************************************************************************************************************************************************
changed: [localhost]

PLAY RECAP *********************************************************************************************************************************************************************************
localhost                  : ok=24   changed=11   unreachable=0    failed=0    skipped=0    rescued=0    ignored=1

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistent with the argument_spec definition!

plugins/modules/azure_rm_datalakestore.py Show resolved Hide resolved
@Fred-sun
Copy link
Collaborator

@next-davidduquehernandez Please add this line "plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented" to "tests/sanity/ignore-2.9.txt". Thanks!

@next-davidduquehernandez
Copy link
Contributor Author

@next-davidduquehernandez Please add this line "plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented" to "tests/sanity/ignore-2.9.txt". Thanks!

Hi @Fred-sun, all modifications are realized. Thanks!

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changed is OK, Please make last change!

@@ -0,0 +1,3 @@
cloud/azure
shippable/azure/group2
destructive
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@next-davidduquehernandez The datalake resource only can create in some location, Please changed as follow! Thank you much!

Suggested change
destructive
destructive
disabled

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels Mar 22, 2021
@haiyuazhang haiyuazhang merged commit 3014856 into ansible-collections:dev Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new_module_pr Add new modules ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants