-
Notifications
You must be signed in to change notification settings - Fork 57
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
networks ( both v4 and v6 ) in droplet.networks are empty #220
Comments
Looks like the module isn't waiting long enough, or polling correctly -- I've tried this with state
...after your creation play. |
I'm getting the following when the droplet is being created now: The full traceback is:
Traceback (most recent call last):
File "/home/flask/.ansible/tmp/ansible-tmp-1644265527.2138073-146419079816711/AnsiballZ_digital_ocean_droplet.py", line 102, in <module>
_ansiballz_main()
File "/home/flask/.ansible/tmp/ansible-tmp-1644265527.2138073-146419079816711/AnsiballZ_digital_ocean_droplet.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/flask/.ansible/tmp/ansible-tmp-1644265527.2138073-146419079816711/AnsiballZ_digital_ocean_droplet.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.digitalocean.plugins.modules.digital_ocean_droplet', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_community.digitalocean.digital_ocean_droplet_payload_w31be1sn/ansible_community.digitalocean.digital_ocean_droplet_payload.zip/ansible_collections/community/digitalocean/plugins/modules/digital_ocean_droplet.py", line 909, in <module>
File "/tmp/ansible_community.digitalocean.digital_ocean_droplet_payload_w31be1sn/ansible_community.digitalocean.digital_ocean_droplet_payload.zip/ansible_collections/community/digitalocean/plugins/modules/digital_ocean_droplet.py", line 905, in main
File "/tmp/ansible_community.digitalocean.digital_ocean_droplet_payload_w31be1sn/ansible_community.digitalocean.digital_ocean_droplet_payload.zip/ansible_collections/community/digitalocean/plugins/modules/digital_ocean_droplet.py", line 858, in core
File "/tmp/ansible_community.digitalocean.digital_ocean_droplet_payload_w31be1sn/ansible_community.digitalocean.digital_ocean_droplet_payload.zip/ansible_collections/community/digitalocean/plugins/modules/digital_ocean_droplet.py", line 734, in create
AttributeError: 'NoneType' object has no attribute 'get' |
Interesting; is the behavior different with |
This happens specifically if unique_name is true |
Hrm, the reason why I asked is because |
Something like the following will trigger it: - name: Create a new Droplet
community.digitalocean.digital_ocean_droplet:
state: present
name: "{{ droplet_name }}"
unique_name: yes
oauth_token: "{{ do_oauth_token }}"
size_id: s-1vcpu-2gb
region_id: nyc1
image_id: ubuntu-20-04-x64
ipv6: yes
monitoring: yes
ssh_keys: ['Redacted']
wait_timeout: 300
tags: ['test']
register: my_droplet |
I wasn't able to reproduce this, here's my first run output and playbook. |
Kind of weird, I'm not getting the issue now. |
Since that's the case, likely something going on with the Cloud at that point in time. Regardless, tracebacks shouldn't happen; so, we can leave this open for sure. |
Looks like the traceback is happening in this section of code; when the It might be possible that the API returned an error and the code didn't catch it; I don't see any checking for |
To elaborate on the above, it looks like creation of a droplet seems to take as long as the timeout. |
I ran into this problem, and adding |
When updating droplet info while waiting after creation, instead of using `get_droplet()` and being dependent upon the optional `unique_name` feature, use `get_by_id()` with the droplet's ID which we definitively have having just created the droplet. Fixes ansible-collections#220.
When updating droplet info while waiting after creation, instead of using `get_droplet()` and being dependent upon the optional `unique_name` feature, use `get_by_id()` with the droplet's ID which we should have having just created the droplet. Fixes ansible-collections#220.
the problem was during the post-API-create wait the updated droplet info was retrieved with relevant code block is here. |
When updating droplet info while waiting after creation, instead of using `get_droplet()` and being dependent upon the optional `unique_name` feature, use `get_by_id()` with the droplet's ID which we should have having just created the droplet. Fixes ansible-collections#220.
When updating droplet info while waiting after creation, instead of using `get_droplet()` and being dependent upon the optional `unique_name` feature, use `get_by_id()` with the droplet's ID which we should have having just created the droplet. Fixes ansible-collections#220.
When updating droplet info while waiting after creation, instead of using `get_droplet()` and being dependent upon the optional `unique_name` feature, use `get_by_id()` with the droplet's ID which we should have having just created the droplet. Fixes ansible-collections#220.
When updating droplet info while waiting after creation, instead of using `get_droplet()` and being dependent upon the optional `unique_name` feature, use `get_by_id()` with the droplet's ID which we should have having just created the droplet. Fixes #220.
SUMMARY
When creating a droplet, there are no ipv4 or ipv6 addresses present.
ISSUE TYPE
COMPONENT NAME
community.digitalocean
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 20.04 LTS
STEPS TO REPRODUCE
EXPECTED RESULTS
IP addresses are present
ACTUAL RESULTS
They are not present
The text was updated successfully, but these errors were encountered: