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

azure_rm_sqldatabase - edition don't work #126

Closed
xkrt opened this issue May 19, 2020 · 0 comments · Fixed by #291
Closed

azure_rm_sqldatabase - edition don't work #126

xkrt opened this issue May 19, 2020 · 0 comments · Fixed by #291
Labels
has_pr PR fixes have been made medium_priority Medium priority

Comments

@xkrt
Copy link

xkrt commented May 19, 2020

SUMMARY

This issue logically the same as ansible/ansible#57965.
There is no way to specify sku for azure_rm_sqldatabase module. If I specify edition parameter - I have an exception.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure_rm_sqldatabase

ANSIBLE VERSION
ansible 2.9.9
  config file = /vagrant/ansible/ansible.cfg
  configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible
  executable location = /home/vagrant/.local/bin/ansible
  python version = 3.6.8 (default, Apr  2 2020, 13:34:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION
Not related.
OS / ENVIRONMENT

CentOS 7 + Python 3.6.8

$ pip3 list | grep azure
azure-cli-core (2.0.35)
azure-cli-nspkg (3.0.2)
azure-common (1.1.11)
azure-graphrbac (0.40.0)
azure-keyvault (1.0.0a1)
azure-mgmt-authorization (0.51.1)
azure-mgmt-automation (0.1.1)
azure-mgmt-batch (5.0.1)
azure-mgmt-cdn (3.0.0)
azure-mgmt-compute (4.4.0)
azure-mgmt-containerinstance (1.4.0)
azure-mgmt-containerregistry (2.0.0)
azure-mgmt-containerservice (4.4.0)
azure-mgmt-cosmosdb (0.5.2)
azure-mgmt-devtestlabs (3.0.0)
azure-mgmt-dns (2.1.0)
azure-mgmt-hdinsight (0.1.0)
azure-mgmt-iothub (0.7.0)
azure-mgmt-keyvault (1.1.0)
azure-mgmt-loganalytics (0.2.0)
azure-mgmt-marketplaceordering (0.1.0)
azure-mgmt-monitor (0.5.2)
azure-mgmt-network (2.3.0)
azure-mgmt-nspkg (2.0.0)
azure-mgmt-rdbms (1.4.1)
azure-mgmt-redis (5.0.0)
azure-mgmt-resource (2.1.0)
azure-mgmt-servicebus (0.5.3)
azure-mgmt-sql (0.10.0)
azure-mgmt-storage (3.1.0)
azure-mgmt-trafficmanager (0.50.0)
azure-mgmt-web (0.41.0)
azure-nspkg (2.0.0)
azure-storage (0.35.1)
msrestazure (0.5.0)
STEPS TO REPRODUCE
- name: Create sql server
  azure_rm_sqlserver:
    resource_group: myrg
    name: myserver
    admin_username: myadmin
    admin_password: mypassword

- name: Create db
  azure_rm_sqldatabase:
    edition: basic
    resource_group: myrg
    server_name: myserver
    name: mydatabase
EXPECTED RESULTS

The database should be created with Basic SKU.

ACTUAL RESULTS

There is an error:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'edition'
failed: [localhost] ("module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 102, in <module>\n  File \"<stdin>\", line 94, in _ansiballz_main\n  File \"<stdin>\", line 40, in invoke_modul
e\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_s
pec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_azure_rm_sqldatabase_payload_vis6a89q/ansible_azure_rm_sqldatabase_payload.zip/ansibl
e/modules/cloud/azure/azure_rm_sqldatabase.py\", line 514, in <module>\n  File \"/tmp/ansible_azure_rm_sqldatabase_payload_vis6a89q/ansible_azure_rm_sqldatabase_payload.zip/ansible/modules/cloud/azure/azure_rm_sqldatabase.py\", li
ne 510, in main\n  File \"/tmp/ansible_azure_rm_sqldatabase_payload_vis6a89q/ansible_azure_rm_sqldatabase_payload.zip/ansible/modules/cloud/azure/azure_rm_sqldatabase.py\", line 314, in __init__\n  File \"/tmp/ansible_azure_rm_sql
database_payload_vis6a89q/ansible_azure_rm_sqldatabase_payload.zip/ansible/module_utils/azure_rm_common.py\", line 348, in __init__\n  File \"/tmp/ansible_azure_rm_sqldatabase_payload_vis6a89q/ansible_azure_rm_sqldatabase_payload.
zip/ansible/modules/cloud/azure/azure_rm_sqldatabase.py\", line 387, in exec_module\nKeyError: 'edition'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

I think the error in the line https://github.com/ansible-collections/azure/blob/dev/plugins/modules/azure_rm_sqldatabase.py#L387 in old_response['edition'] part.

@Fred-sun Fred-sun added has_pr PR fixes have been made medium_priority Medium priority labels Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has_pr PR fixes have been made medium_priority Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants