Closed attrib closed 2 years ago
Does the example of the README in https://github.com/ionos-cloud/module-ansible/tree/master/plugins/inventory work?
I found this back then, but it doesn't describe how to use it with ansible-playbook. In combination with ansible-playbook I get the results describe above and didn't get it running.
Regarding the plugin approach which returned w/ unrecognized
arguments I thinks it's due to the default behavior of argparse
.
To be used in this context it, parsing should be done by ArgumentParser.parse_known_args() instead of ArgumentParser.parse_args().
Regarding the six
module error I have no clue. Do you have only one Python installation?
Description
The documentation for the inventory script is unclear to me.
I installed ionos cloud via ansible galaxy. Creating/Updating servers is working fine. But I get confused how I could use the inventory.
If I run
ansible-playbook -i ~/.ansible/collections/ansible_collections/ionoscloudsdk/ionoscloud/plugins/inventory/inventory.py test.yml
I get
Added +x to the inventory script results in:
pip install six
tells me its already installed.In theory I should be able to use the inventory as a plugin. So I created a ionos.yml file with this content:
And then using
ansible-playbook -i inventories/ionos.yml test.yml
This seems to work better as I can even revert the +x on the inventory.py but results in:
Even it it says ansible-playbook the returend message comes from the inventory script. So ansible is calling it, but the script returns this message and no inventory.
So I'm not sure how to use the inventory.py. Any help would be appreciated.
Expected behavior
Either when calling the inventory.py directly or using the better way as a inventory plugin should work to retrieve the dynamic inventory.
Environment
Ansible version:
Module version:
OS:
Configuration Files
test.yml