community.aws
community.aws copied to clipboard
cloudfront_distribution.py - wait_until_processed appears broken
SUMMARY
A cloudfront_distribution which performs its operation and the cloudfront distribution is created successfully. However, when wait: yes
is enabled the error is detailed below.
Digging around the source I've been unable to find anything on my own where the key error could be originating from.
This behavior only occurs on creation with state: present
, not on deletion with state: absent
ISSUE TYPE
- Bug Report
COMPONENT NAME
cloudfront_distribution
ANSIBLE VERSION
13:18 $ ansible --version
ansible 2.10.1
config file = /Users/redacted/redacted/ansible-roles/ansible.role-cloudfront-stream-distribution/ansible.cfg
configured module search path = ['/Users/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.7.7 (default, Mar 10 2020, 15:43:27) [Clang 10.0.0 (clang-1000.11.45.5)]
CONFIGURATION
13:43 $ ansible-config dump --only-changed
INTERPRETER_PYTHON(/Users/redacted/redacted/ansible-roles/ansible.role-cloudfront-stream-distribution/ansible.cfg) = auto
(END)
OS / ENVIRONMENT
Darwin 17.7.0 Darwin Kernel Version 17.7.0: Wed Apr 24 21:17:24 PDT 2019; root:xnu-4570.71.45~1/RELEASE_X86_64 x86_64
MacOS 10.13.6
STEPS TO REPRODUCE
I haven't been able to fully deconstruct it yet to a minimal case, I will try to update with one if I can. Right now I can reproduce by using wait: yes
, and it goes away with wait: no
EXPECTED RESULTS
The ansible routine to wait until the distribution is made and reports healthy and then exit with my registered variable populated.
ACTUAL RESULTS
TASK [/Users/redacted/redacted/ansible-roles/ansible.role-cloudfront-stream-distribution : Create / Manage / Delete distribution (This may take some time)] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'Id'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/Users/redacted/.ansible/tmp/ansible-tmp-1602015472.329021-59538-203288307626216/AnsiballZ_cloudfront_distribution.py\", line 102, in <module>\n _ansiballz_main()\n File \"/Users/redacted/.ansible/tmp/ansible-tmp-1602015472.329021-59538-203288307626216/AnsiballZ_cloudfront_distribution.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/Users/redacted/.ansible/tmp/ansible-tmp-1602015472.329021-59538-203288307626216/AnsiballZ_cloudfront_distribution.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.cloudfront_distribution', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/var/folders/w_/1n5tpdtx3h1f5k3skn3d6d9r0000gn/T/ansible_community.aws.cloudfront_distribution_payload_lk_w9xob/ansible_community.aws.cloudfront_distribution_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution.py\", line 2252, in <module>\n File \"/var/folders/w_/1n5tpdtx3h1f5k3skn3d6d9r0000gn/T/ansible_community.aws.cloudfront_distribution_payload_lk_w9xob/ansible_community.aws.cloudfront_distribution_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution.py\", line 2242, in main\n File \"/var/folders/w_/1n5tpdtx3h1f5k3skn3d6d9r0000gn/T/ansible_community.aws.cloudfront_distribution_payload_lk_w9xob/ansible_community.aws.cloudfront_distribution_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution.py\", line 2072, in wait_until_processed\nKeyError: 'Id'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @jillr @s-hertel @tremble @willthames @wilvk @wimnat click here for bot help