cloudscale-ch / ansible-collection-cloudscale Goto Github PK
View Code? Open in Web Editor NEWcloudscale.ch Ansible Collection
Home Page: https://galaxy.ansible.com/cloudscale_ch/cloud
License: GNU General Public License v3.0
cloudscale.ch Ansible Collection
Home Page: https://galaxy.ansible.com/cloudscale_ch/cloud
License: GNU General Public License v3.0
idempotency currently not given due to API does not have a description or name field which could be used to identify the resource.
We evaluate a way to provide idempotency by using a custom tag as a name. Per definition, a new required field would be a breaking change and therefore available in the next major release.
Hi all
There seems to be an Issue with the cloudscale_ch.cloud.server module when using ansible 6.0. The module fails with the following error:
msg: dictionary requested, could not parse JSON or key=value
Steps to reproduce:
cloudscale_ch.cloud.server
moduleWe 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 cloudscale_ch.cloud 2.2.1 fails with ansible-core 2.13.0rc1 in ansible 6.0.0a2.
n/a
ansible [core 2.13.0rc1]
2.2.1
ansible-test sanity --docker
Tests are either passing or ignored.
ERROR: Found 1 validate-modules issue(s) which need to be resolved:
ERROR: plugins/inventory/inventory.py:0:0: invalid-documentation: DOCUMENTATION.plugin_type: extra keys not allowed @ data['plugin_type']. Got 'inventory'
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-C24clIj5 /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/cloudscale_ch/cloud 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-og9ot2ka.json --truncate 0 --color no --host-path tests/output/.tmp/host-rrgtk4l2" returned exit status 1.
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)
While debugging an issue with our cloudscale volumes I've noticed that the module still makes use of server_uuids
despite the api documentation mentioning it being deprecated and recommending the use of servers
instead. Could this be an issue?
See:
Please make the final changes for breaking the backwards compatibility. I'll create a the new major release (and document the steps)
Output of ansible-inventory --list -i inventory-dynamic-cloudscale.yml -vvv
ansible-inventory 2.10.4
config file = /home/my-user/git/ansible/ansible.cfg
configured module search path = ['/home/my-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
executable location = /usr/bin/ansible-inventory
python version = 3.9.1 (default, Dec 13 2020, 11:55:53) [GCC 10.2.0]
Using /home/my-user/git/ansible/ansible.cfg as config file
ERROR! Unexpected Exception, this is probably a bug: cannot import name 'API_URL' from 'ansible_collections.cloudscale_ch.cloud.plugins.module_utils.api' (/home/my-user/git/ansible/collections/ansible_collections/cloudscale_ch/cloud/plugins/module_utils/api.py)
the full traceback was:
Traceback (most recent call last):
File "/usr/bin/ansible-inventory", line 123, in <module>
exit_code = cli.run()
File "/usr/lib/python3.9/site-packages/ansible/cli/inventory.py", line 128, in run
self.loader, self.inventory, self.vm = self._play_prereqs()
File "/usr/lib/python3.9/site-packages/ansible/cli/__init__.py", line 467, in _play_prereqs
inventory = InventoryManager(loader=loader, sources=options['inventory'])
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 166, in __init__
self.parse_sources(cache=True)
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 224, in parse_sources
parse = self.parse_source(source, cache=cache)
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 275, in parse_source
for plugin in self._fetch_inventory_plugins():
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 203, in _fetch_inventory_plugins
plugin = inventory_loader.get(name)
File "/usr/lib/python3.9/site-packages/ansible/plugins/loader.py", line 780, in get
return self.get_with_context(name, *args, **kwargs).object
File "/usr/lib/python3.9/site-packages/ansible/plugins/loader.py", line 800, in get_with_context
self._module_cache[path] = self._load_module_source(name, path)
File "/usr/lib/python3.9/site-packages/ansible/plugins/loader.py", line 764, in _load_module_source
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/my-user/git/ansible/collections/ansible_collections/cloudscale_ch/cloud/plugins/inventory/inventory.py", line 82, in <module>
from ..module_utils.api import API_URL
ImportError: cannot import name 'API_URL' from 'ansible_collections.cloudscale_ch.cloud.plugins.module_utils.api' (/home/my-user/git/ansible/collections/ansible_collections/cloudscale_ch/cloud/plugins/module_utils/api.py)
Inventory inventory-dynamic-cloudscale.yml
:
plugin: cloudscale_ch.cloud.inventory
api_token: ENTER_API_TOKEN_HERE
keyed_groups:
- prefix: os
key: cloudscale.image.operating_system | lower
Inventory config from ansible.cfg
[inventory]
enable_plugins = ini, cloudscale_ch.cloud.inventory
Installed configuring requirements.txt
and executing ansible-galaxy collection install -r requirements.yml -p collections
collections:
- name: cloudscale_ch.cloud
version: 1.3.0
It works for me with the following changes:
from ..module_utils.api import API_URL
from plugins/inventory/inventory.py#L82API_URL + '/servers',
with self.get_option('api_url') + '/servers',
in plugins/inventory/inventory.py#L99Is there something wrong with my setup or is this a bug?
TASK [custom_image : Wait for import of first image] ***************************
fatal: [testhost]: FAILED! => {"msg": "The conditional check 'import_status.import_status == 'failed'' failed. The error was: error while evaluating conditional (import_status.import_status == 'failed'): 'dict object' has no attribute 'import_status'"}
The module claims to have check mode support but actually it has not.
We would like to be able to add several disks to a newly created server right at the start, similar to how it is possible with the API.
If I read it correctly the ansible module currently supports adding an additional bulk volume via the bulk_volume_size_gb
param.
However adding 2+ bulk volumes or any additional ssd volume besides the root volume is not possible.
Our current workaround is to add the desired disks right after the server creation with the volume module, but we are looking to simplify the setup. Because of the well established workaround this is not a high priority issue for us.
CI integration needs a secret to run
name:
CONFIG_FILE
value:
[default]
cloudscale_api_token = <api_token>
Some users might want to use fixed names for their resources in their playbooks:
- name: Create volume
cloudscale_ch.cloud.volume:
name: 'my_ssd_volume'
...
- name: Start a server
cloudscale_ch.cloud.server:
name: 'my_server'
...
- name: Attach volume to server
cloudscale_ch.cloud.volume:
name: 'my_ssd_volume'
servers:
- 'my_server'
Other users don't want to dig into the structure of return values to pass a uuid to another task:
- name: Create volume
cloudscale_ch.cloud.volume:
name: my_ssd_volume
...
register: volume
- name: Start a server
cloudscale_ch.cloud.server:
name: my_server
...
register: server
- name: Attach volume to server
cloudscale_ch.cloud.volume:
name: "{{ volume }}"
servers:
- "{{ server }}"
Create a function that can compare uuid
, name
or an object
with a given object
.
Spot all parameters that take only name
, uuid
or an object
and make it possible to use any.
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
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.