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

New Module : azure_rm_hostgroup #704

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

aparna-patil
Copy link
Contributor

SUMMARY

This module supports following features -

  1. Create a new host group
  2. Update an existing host group
  3. Delete a host group
  4. Get details about specified host group
  5. List all hots groups
    Fixes Azure Host Group #262
ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

azure_rm_hostgroup
azure_rm_hostgroup_info

ADDITIONAL INFORMATION

@aparna-patil
Copy link
Contributor Author

Integration test results -

root@aparna-patil:~/ansible# ansible-test integration azure_rm_hostgroup --allow-destructive -v
Run command: /usr/bin/python /root/ansible/test/lib/ansible_test/_data/yamlcheck.py
Running azure_rm_hostgroup integration test role
Injecting "/tmp/python-pj6qpn0q-ansible/python" as a execv wrapper for the "/usr/bin/python" interpreter.
Run command: ansible-playbook azure_rm_hostgroup-7ga6x8t4.yml -i inventory -v
Using /root/ansible/test/results/.tmp/integration/azure_rm_hostgroup-eyja30g7-ÅÑŚÌβŁÈ/test/integration/integration.cfg as config file
[WARNING]: The `junit_xml` python module is not installed. Disabling the `junit` callback plugin.

PLAY [testhost] *******************************************************************************************************************************************************************************************

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

TASK [azure_rm_hostgroup : Create host group name] ********************************************************************************************************************************************************
ok: [testhost] => {"ansible_facts": {"group_name": "hostgroupc45a0c9bf44019d01fd561"}, "changed": false}

TASK [azure_rm_hostgroup : Create a host group] ***********************************************************************************************************************************************************
changed: [testhost] => {"changed": true, "state": {"id": "/subscriptions/7b1b46f1-e266-404e-96b4-8738a385c254/resourceGroups/MYAZURERESOURCEGROUP/providers/Microsoft.Compute/hostGroups/hostgroupc45a0c9bf44019d01fd561", "location": "eastus", "name": "hostgroupc45a0c9bf44019d01fd561", "platform_fault_domain_count": 1, "tags": null, "type": "Microsoft.Compute/hostGroups", "zones": ["1"]}}

TASK [azure_rm_hostgroup : Assert that host group is created] *********************************************************************************************************************************************
ok: [testhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [azure_rm_hostgroup : Create a host group again (Idempotent test)] ***********************************************************************************************************************************
ok: [testhost] => {"changed": false, "state": {"id": "/subscriptions/7b1b46f1-e266-404e-96b4-8738a385c254/resourceGroups/MYAZURERESOURCEGROUP/providers/Microsoft.Compute/hostGroups/hostgroupc45a0c9bf44019d01fd561", "location": "eastus", "name": "hostgroupc45a0c9bf44019d01fd561", "platform_fault_domain_count": 1, "tags": {}, "type": "Microsoft.Compute/hostGroups", "zones": ["1"]}}

TASK [azure_rm_hostgroup : Assert that output is not changed] *********************************************************************************************************************************************
ok: [testhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [azure_rm_hostgroup : Update a host group] ***********************************************************************************************************************************************************
changed: [testhost] => {"changed": true, "state": {"id": "/subscriptions/7b1b46f1-e266-404e-96b4-8738a385c254/resourceGroups/MYAZURERESOURCEGROUP/providers/Microsoft.Compute/hostGroups/hostgroupc45a0c9bf44019d01fd561", "location": "eastus", "name": "hostgroupc45a0c9bf44019d01fd561", "platform_fault_domain_count": 1, "tags": {"key1": "value1"}, "type": "Microsoft.Compute/hostGroups", "zones": ["1"]}}

TASK [azure_rm_hostgroup : Assert that host group is updated] *********************************************************************************************************************************************
ok: [testhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [azure_rm_hostgroup : Get host group facts] **********************************************************************************************************************************************************
ok: [testhost] => {"changed": false, "hostgroups": [{"hosts": null, "id": "/subscriptions/7b1b46f1-e266-404e-96b4-8738a385c254/resourceGroups/MYAZURERESOURCEGROUP/providers/Microsoft.Compute/hostGroups/hostgroupc45a0c9bf44019d01fd561", "location": "eastus", "name": "hostgroupc45a0c9bf44019d01fd561", "platform_fault_domain_count": 1, "tags": {"key1": "value1"}, "zones": ["1"]}]}

TASK [azure_rm_hostgroup : assert] ************************************************************************************************************************************************************************
ok: [testhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [azure_rm_hostgroup : Delete host group] *************************************************************************************************************************************************************
changed: [testhost] => {"changed": true, "state": "Deleted"}

TASK [azure_rm_hostgroup : Assert that host group is deleted] *********************************************************************************************************************************************
ok: [testhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [azure_rm_hostgroup : Delete host group again (Idempotent test)] *************************************************************************************************************************************
ok: [testhost] => {"changed": false, "state": {}}

TASK [azure_rm_hostgroup : Asset that output is not changed] **********************************************************************************************************************************************
ok: [testhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

PLAY RECAP ************************************************************************************************************************************************************************************************
testhost                   : ok=14   changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```

@Fred-sun Fred-sun added medium_priority Medium priority new_module_pr Add new modules ready_for_review The PR has been modified and can be reviewed and merged labels Dec 6, 2021
@xuzhang3
Copy link
Collaborator

LGTM

@xuzhang3 xuzhang3 merged commit 277029c into ansible-collections:dev Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority 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.

Azure Host Group
3 participants