ngine-io / ansible-collection-vultr Goto Github PK
View Code? Open in Web Editor NEWVultr Ansible Collections
Home Page: https://galaxy.ansible.com/ngine_io/vultr
License: GNU General Public License v3.0
Vultr Ansible Collections
Home Page: https://galaxy.ansible.com/ngine_io/vultr
License: GNU General Public License v3.0
In https://docs.ansible.com/ansible/latest/collections/ngine_io/vultr/vultr_server_info_module.html the provided example:
- name: Gather Vultr servers information
ngine_io.vultr.vultr_server_info:
register: result
results in the following error:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find firewall with FIREWALLGROUPID: 0"}
Not sure how to continue or what the fix is here.
We are running sanity tests across every collection included in the Ansible community package (as part of this issue) and found that ansible-test sanity --docker
against ngine_io.vultr 1.1.1 fails with ansible-core 2.13.0rc1 in ansible 6.0.0a2.
n/a
ansible [core 2.13.0rc1]
1.1.1
ansible-test sanity --docker
Tests are either passing or ignored.
ERROR: Found 2 validate-modules issue(s) which need to be resolved:
ERROR: plugins/inventory/vultr.py:0:0: invalid-documentation: DOCUMENTATION.plugin_type: extra keys not allowed @ data['plugin_type']. Got 'inventory'
ERROR: plugins/modules/vultr_dns_domain.py:0:0: invalid-documentation-markup: DOCUMENTATION.options.server_ip.description: Directive "M(vultr_dns_record)" must contain a FQCN for dictionary value @ data['options']['server_ip']['description']. Got ['The default server IP.', 'Use M(vultr_dns_record) to change it once the domain is created.', 'Required if C(state=present).']
ERROR: The 1 sanity test(s) listed below (out of 43) failed. See error output above for details.
validate-modules
ERROR: Command "podman exec ansible-test-controller-nbyflpbE /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/ngine_io/vultr LC_ALL=en_US.UTF-8 /usr/bin/python3.10 /root/ansible/bin/ansible-test sanity --containers '{}' --skip-test pylint --metadata tests/output/.tmp/metadata-x3px4yy0.json --truncate 0 --color no --host-path tests/output/.tmp/host-3qktk3un" returned exit status 1.
Unable to create a VM attached to an existing private network.
Example playbook:
- name: Create provider routers in the Cloud
ngine_io.vultr.vultr_server:
api_account: default
api_retries: 1
name: "{{ item }}"
snapshot: Mikrotik
plan: 1024 MB RAM,25 GB SSD,1.00 TB BW
region: Singapore
private_network_enabled: yes
state: present
force: yes
This throws error from the API asking for network ID:
TASK [Create provider routers in the Cloud] ********************************************************************************************************************************************************************
failed: [localhost] (item=R1) => {"ansible_loop_var": "item", "changed": true, "item": "R1", "msg": "Reached API retries limit 1 for URL https://api.vultr.com/v1/server/create, method POST with data DCID=40&VPSPLANID=201&OSID=164&SNAPSHOTID=dc3605907389d&label=R1&SSHKEYID=&enable_private_network=yes¬ify_activate=no. Returned 412, with body: HTTP Error 412: Request Failed b'Server add failed: No NETWORKID defined, but multiple private networks exist in this location.'", "vultr_api": {"api_account": "default", "api_endpoint": "https://api.vultr.com", "api_retries": 1, "api_retry_max_delay": 12, "api_timeout": 60}, "vultr_server": {}}
And there seems no way to specify network ID(s) when creating VM.
This collection will be included in Ansible 2.10 because it contains modules and/or plugins that were included in Ansible 2.9. Please review:
The latest version of the collection available on August 18 will be included in Ansible 2.10.0, except possibly newer versions which differ only in the patch level. (For details, see the roadmap). Please release version 1.0.0 of your collection by this date! If 1.0.0 does not exist, the same 0.x.y version will be used in all of Ansible 2.10 without updates, and your 1.x.y release will not be included until Ansible 2.11 (unless you request an exception at a community working group meeting and go through a demanding manual process to vouch for backwards compatibility . . . you want to avoid this!).
Your collection versioning must follow all semver rules. This means:
Your collection should provide data for the Ansible 2.10 changelog and porting guide. The changelog and porting guide are automatically generated from ansible-base, and from the changelogs of the included collections. All changes from the breaking_changes
, major_changes
, removed_features
and deprecated_features
sections will appear in both the changelog and the porting guide. You have two options for providing changelog fragments to include:
changelogs/changelog.yaml
inside your collection (see the documentation of changelogs/changelog.yaml format).If you cannot contribute to the integrated Ansible changelog using one of these methods, please provide a link to your collection's changelog by creating an issue in https://github.com/ansible-community/ansible-build-data/. If you do not provide changelogs/changelog.yml
or a link, users will not be able to find out what changed in your collection from the Ansible changelog and porting guide.
Run ansible-test sanity --docker -v
in the collection with the latest ansible-base or stable-2.10
ansible/ansible checkout.
Be sure you're subscribed to:
If you have questions or want to provide feedback, please see the Feedback section in the collection requirements.
(Internal link to keep track of issues: ansible-collections/overview#102)
Not sure if this is due to the API change, but my Ansible Runs are failing with the following output, the only change in my playbook is around the plan definition, this has now changed on the Vultr API to "vc2-2c-4gb"
ESTABLISH LOCAL CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp
"&& mkdir "echo /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133
" && echo ansible-tmp-1654631972.6608722-30354-211416328878133="echo /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133
" ) && sleep 0'
redirecting (type: modules) ansible.builtin.vultr_server to ngine_io.vultr.vultr_server
Using module file /root/.local/lib/python3.6/site-packages/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py
PUT /root/.ansible/tmp/ansible-local-30249c_wa2x6q/tmpy541dbze TO /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/ /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py && sleep 0'
EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 100, in
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 92, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 41, in invoke_module
run_name='main', alter_sys=True)
File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 933, in
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 926, in main
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 508, in present_server
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 529, in _create_server
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 444, in get_region
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/module_utils/vultr.py", line 248, in query_resource_by_key
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 1: ordinal not in range(128)
fatal: [localhost -> localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 100, in \n _ansiballz_main()\n File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 41, in invoke_module\n run_name='main', alter_sys=True)\n File "/usr/lib64/python2.7/runpy.py", line 176, in run_module\n fname, loader, pkg_name)\n File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code\n mod_name, mod_fname, mod_loader, pkg_name)\n File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code\n exec code in run_globals\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 933, in \n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 926, in main\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 508, in present_server\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 529, in _create_server\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 444, in get_region\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/module_utils/vultr.py", line 248, in query_resource_by_key\nUnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 1: ordinal not in range(128)\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
big parts of these modules are similar. create a new module_utils for servers in which we consolidate the common parts of these modules into a new class
When I create a new instance, providing the name: "A"
and hostname: "B"
and then use the dynamic inventory script, I get and inventory_hostname_short: "A"
and inventory_hostname: "A"
. Wouldn't it make more sense to provide inventory_hostname_short: "A"
and inventory_hostname: "B"
, potentially with a config option, so it doesn't break previous playbooks? Or at least some other way to access B (it's not in the hostvars)?
Most scenario guides need to be moved from the ansible/ansible repository to the related collection. See these steps for details how to do this.
Dear maintainers,
This is important for your collections!
In accordance with the Community decision, we have created the news-for-maintainers repository for announcements of changes impacting collection maintainers (see the examples) instead of Issue 45 that will be closed soon.
Watch
button in the upper right corner on the repository's home page.Issues
.Also we would like to remind you about the Bullhorn contributor newsletter which has recently started to be released weekly. To learn what it looks like, see the past releases. Please subscribe and talk to the Community via Bullhorn!
Join us in #ansible-social (for news reporting & chat), #ansible-community (for discussing collection & maintainer topics), and other channels on Matrix/IRC.
Help the Community and the Steering Committee to make right decisions by taking part in discussing and voting on the Community Topics that impact the whole project and the collections in particular. Your opinion there will be much appreciated!
Thank you!
Based on the community decision to use true/false
for boolean values in documentation and examples, we ask that you evaluate booleans in this collection and consider changing any that do not use true/false
(lowercase).
See documentation block format for more info (specifically, option defaults).
If you have already implemented this or decide not to, feel free to close this issue.
P.S. This is auto-generated issue, please raise any concerns here
Hi @resmo. Great job on this project! Sorely needed! Specially considering how bad Vultr's v1 API is.
I noticed that the project doesn't provide the ability to resize volumes, or attach/detach them from servers. I've implemented those features (and integration tests for them) in the following MR: #14
I ran the integration tests for the new features against my Vultr account, and they work without issues.
Let me know what you think. All feedback welcome.
The Vultr v1 API is deprecated and it would be great to be able to use the v2 API.
The vultr API lists the parameter for user-data as 'userdata', not 'user_data'. Changes /plubins/modules/vultr_server.py to use the correct parameter name. Interestingly, the set_user_data API call already used the correct name.
Dear maintainers,
This is important for your collections!
In accordance with the Community decision, we have created the news-for-maintainers repository for announcements of changes impacting collection maintainers (see the examples) instead of Issue 45 that will be closed soon.
Watch
button in the upper right corner on the repository's home page.Issues
.Also we would like to remind you about the Bullhorn contributor newsletter which has recently started to be released weekly. To learn what it looks like, see the past releases. Please subscribe and talk to the Community via Bullhorn!
Join us in #ansible-social (for news reporting & chat), #ansible-community (for discussing collection & maintainer topics), and other channels on Matrix/IRC.
Help the Community and the Steering Committee to make right decisions by taking part in discussing and voting on the Community Topics that impact the whole project and the collections in particular. Your opinion there will be much appreciated!
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.