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_deployment_facts fails to fetch the facts for the templates specified inline #61306

Open
wants to merge 3 commits into
base: devel
from

Conversation

@sparampalli
Copy link

commented Aug 26, 2019

SUMMARY

azure_rm_deployment_facts module fails to get the facts for ARM deployment when a template is defined inline in azure_rm_deployment module of the playbook. So modified the code to check if template is inline or not based on that get the right value.

Fixes#57989

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

azure_rm_deployment_facts

ADDITIONAL INFORMATION

Create the ARM stack using azure_rm_deployment and then try to get the facts of this deployment.
azure_rm_deployment:
resource_group:
auth_source: credential_file
deployment_mode: complete
location:
name:
profile: default
subscription_id:
state: present
template:
Specify the template here

**Before the change -**
fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/Users/psrikantha/.ansible/tmp/ansible-tmp-1560846234.11-254137282894546/AnsiballZ_azure_rm_deployment_facts.py", line 114, in \n _ansiballz_main()\n File "/Users/psrikantha/.ansible/tmp/ansible-tmp-1560846234.11-254137282894546/AnsiballZ_azure_rm_deployment_facts.py", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/Users/psrikantha/.ansible/tmp/ansible-tmp-1560846234.11-254137282894546/AnsiballZ_azure_rm_deployment_facts.py", line 49, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/main.py", line 243, in \n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/main.py", line 239, in main\n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/main.py", line 153, in init\n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/ansible_azure_rm_deployment_facts_payload.zip/ansible/module_utils/azure_rm_common.py", line 325, in init\n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/main.py", line 160, in exec_module\n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/main.py", line 176, in get\n File "/var/folders/l8/nzzx3fy16xg9zkv36kc_mkdh0000gn/T/ansible_azure_rm_deployment_facts_payload_b1lp_g/main.py", line 233, in format_response\nAttributeError: 'NoneType' object has no attribute 'get'\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}

**After the change-**
ARM facts were displayed correctly for the cases of inline templates.
@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2019

@sparampalli, just so you are aware we have a dedicated Working Group for azure.
You can find other people interested in this in #ansible-azure on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@Fred-sun

This comment has been minimized.

Copy link
Contributor

commented Aug 27, 2019

@sparampalli Thank you for submit this PR. Please fixes the CI fail when you're free! Thank a lot!

@Fred-sun

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

kindly ping

@sparampalli

This comment has been minimized.

Copy link
Author

commented Sep 12, 2019

@Fred-sun , can you please let me know what action I am supposed to do here?

@Fred-sun

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

@sparampalli Need you to rebase PR, fix the conflict! Thanks!

@Fred-sun

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

kindly ping

@sparampalli

This comment has been minimized.

Copy link
Author

commented Sep 16, 2019

done. Plz check.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

@sparampalli this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/azure/azure_rm_deployment_info.py:11:0: import-before-documentation: Import found before documentation variables. All imports must appear below DOCUMENTATION/EXAMPLES/RETURN/ANSIBLE_METADATA.

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.