ansible-collection-morpheus-core's Issues
App searchtype not working Morpheus 5.4.3
Read variable for morpheus url
Hey, just wondering if it's possible to read a variable, or read the morpheus appliance url instead of supplying the url?
Implement proper API result paging
Currently some API calls are using ?max=-1
to get results, which is bad design.
Morpheus 5.4.3 requires login for version info, update inventory plugin
Remove debug message from virtualimages role
Verbose output
Need better debug/verbose output for helping to troubleshoot user issues
Can't set OS type in virtual images
Morpheus task API key not used when running from Morpheus task
No hosts fetched
Hi,
Seems like after some updates that the plugin doesn't fetch any hosts from Morpheus, though it does create the hostgroups.
Do you have time for a call, since this always seems easier to resolve that way?
Fix flake8 warnings for v0.2.2
Issues with fetching hosts on 0.2.3
Hi, after upgrading Morpheus to 5.4.5 and the inventory plugin to 0.2.3, it's no longer fetching hosts nor creating any of the groups?
I even tested in a virtualenv like you've suggested before.
(venv) morpheus-local@S700LS001:~/collectiontesttmp$ ansible-inventory -i morpheusinv.yml --list -vvvvvv
ansible-inventory [core 2.11.6]
config file = None
configured module search path = ['/opt/morpheus/.local/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible
ansible collection location = /opt/morpheus/.local/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/morpheus/.local/collectiontesttmp/venv/bin/ansible-inventory
python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
jinja version = 3.1.2
libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml as it did not pass its verify_file() method
script declined parsing /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml as it did not pass its verify_file() method
Loading collection morpheus.core from /opt/morpheus/.local/.ansible/collections/ansible_collections/morpheus/core
morpheus_inventory: Using Morpheus URL from inventory file
morpheus_inventory: Using Morpheus token from inventory file
toml declined parsing /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml as it did not pass its verify_file() method
[WARNING]: * Failed to parse /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml with auto plugin: 'NoneType' object is not subscriptable
File "/opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible/plugins/inventory/auto.py", line 58, in parse
plugin.parse(inventory, loader, path, cache=cache)
File "/opt/morpheus/.local/.ansible/collections/ansible_collections/morpheus/core/plugins/inventory/morpheus_inventory.py", line 353, in parse
self._set_version_from_morpheus()
File "/opt/morpheus/.local/.ansible/collections/ansible_collections/morpheus/core/plugins/inventory/morpheus_inventory.py", line 78, in _set_version_from_morpheus
self.print_verbose_message(self.extravars['morpheus']['morpheus'])
[WARNING]: * Failed to parse /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
File "/opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible/plugins/inventory/yaml.py", line 112, in parse
raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
[WARNING]: * Failed to parse /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port.
File "/opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/opt/morpheus/.local/collectiontesttmp/venv/lib/python3.8/site-packages/ansible/plugins/inventory/ini.py", line 136, in parse
raise AnsibleParserError(e)
[WARNING]: Unable to parse /opt/morpheus/.local/collectiontesttmp/morpheusinv.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped"
]
}
}
f-string not supported in python 2
Hadn't tested properly. Need to change to normal print functions.
Failed to parse morpheusinv.yml with auto plugin:
Morpheus version# 5.4.4-3
Ansible 2.9.5
installed collection via morpheus-local user
ansible-galaxy collection install morpheus.core
cp /opt/morpheus/.local/.ansible/collections/ansible_collections/morpheus/core/plugins/inventory/morpheus_inventory.py /usr/share/ansible/plugins/inventory/
bash-4.2$ ansible-doc -t inventory -l | grep morpheus
morpheus_inventory Returns Ansible inventory from Morpheus
The inventory fails to parse plugin
bash-4.2$ ansible-inventory -i /var/tmp/morpheusinv.yml --list -vvv
ansible-inventory 2.9.25
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/opt/morpheus/.local/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible-inventory
python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /var/tmp/morpheusinv.yml as it did not pass its verify_file() method
script declined parsing /var/tmp/morpheusinv.yml as it did not pass its verify_file() method
toml declined parsing /var/tmp/morpheusinv.yml as it did not pass its verify_file() method
[WARNING]: * Failed to parse /var/tmp/morpheusinv.yml with auto plugin: inventory config '/var/tmp/morpheusinv.yml' specifies unknown plugin builtins
File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", line 280, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python2.7/site-packages/ansible/plugins/inventory/auto.py", line 53, in parse
raise AnsibleParserError("inventory config '{0}' specifies unknown plugin '{1}'".format(path, plugin_name))
[WARNING]: * Failed to parse /var/tmp/morpheusinv.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", line 280, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python2.7/site-packages/ansible/plugins/inventory/yaml.py", line 112, in parse
raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
[WARNING]: * Failed to parse /var/tmp/morpheusinv.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port.
File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", line 280, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python2.7/site-packages/ansible/plugins/inventory/ini.py", line 138, in parse
raise AnsibleParserError(e)
[WARNING]: Unable to parse /var/tmp/morpheusinv.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped"
]
}
}
bash-4.2$ ls -l /var/tmp/morpheusinv.yml
-rw-r--r--. 1 morpheus-local morpheus-local 246 Apr 7 09:50 /var/tmp/morpheusinv.yml
bash-4.2$ cat /var/tmp/morpheusinv.yml
plugin: morpheus_inventory
groups:
- name: sql
searchtype: label
searchstring: centos
morpheus_url: "https://10.32.20.80/"
morpheus_api_key: <redacted>
morpheus_ssl_verify: no
any ideas what I am missing
Adding further modules
Hey,
Thanks for merging in my httpapi plugin and appliance_facts module!
As mentioned in the PR comments, I'm looking at creating further modules and happy to take requests.
At this point in time I have added a further two modules into my develop branch, an appliance_settings
module and appliance_maintenance_mode
module, both of which are ready to ship.
However, before I go ahead and raise a new PR, I wondered if there was any particular process you would like me to follow. I can't say how frequently I will create modules, as I'm doing it in my spare time, so it maybe somewhat sporadic, and dependent on the complexity of the module(s) at the time.
To keep the PR's small and easier to review I could just raise a PR as and when I complete each module, rather than throwing a bunch at you at once.
Let me know if there is anything else you would like me to consider, and if there are any particular modules you would like to see.
Many thanks
Target instances only if the status is running
if the hosts list that is generated based on the searchtype and searchstring have instances which are not in the running status then the ansible execution fails. Option to set ignore instances which are not in the running state would be useful.
Change choices for FQCN compatibility
Modify the DOCUMENTATION block on line 24 of morpheus/core/plugins/inventory/morpheus_inventory.py and add to the choices: entry:
choices: ['morpheus_inventory', 'morpheus.core.morpheus_inventory']
Update distutils.Looseversion to packaging.version.parse
Running job on master tenant to subtenant hosts
I'm having an issue now with running jobs on Master Tenant, that is targeting hosts on a subtenant, seems like it finds the hosts, but it's not allowed to run any jobs against them. Is this something related to the context you mentioned yesterday, and anyway I could make this work?
settings role not working
when: provisioning_settings is defined
to be changed to when: morpheus_settings is defined
Bump Minimum Ansible Core version to 2.15
Hi,
Currently, the collection specifies a minimum ansible-core
version of 2.9 which is really quite old.
This has remained unchanged through the modules and plugins that have since been added to the collection.
Most of the modules and plugins have been written against Python 3.10 and passes sanity tests from 3.10 through to 3.12. Tests against prior Python versions fail.
ansible-core
didn't introduce Python 3.10 support until 2.12, however this is also considered EOL. My suggestion is to track ansible-core
support in-line with Ansible's Release and Maintenance Lifecycle - Ansible Lifecycle Docs.
If agreed, I would look to bump the minimum ansible-core
version to 2.15 in my next update.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.