Comments (11)
Is there any data you can provide? Possibly some debug output, or cli testing for this issue?
from ansible-collection-morpheus-core.
root@S700LS001:/var/tmp# ansible-inventory -i morpheusinv.yml --list -vvvv --vau lt-password-file /var/opt/morpheus/morpheus-ui/ansiblevault/vault.txt
ansible-inventory [core 2.11.6]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share /ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/dist-packages/ansibl e
ansible collection location = /root/.ansible/collections:/usr/share/ansible/co llections
executable location = /usr/local/bin/ansible-inventory
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
jinja version = 2.10.1
libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /var/tmp/morpheusinv.yml as it did not pass its verif y_file() method
script declined parsing /var/tmp/morpheusinv.yml as it did not pass its verify_f ile() method
Trying secret FileVaultSecret(filename='/var/opt/morpheus/morpheus-ui/ansiblevau lt/vault.txt') for vault_id=default
Trying secret FileVaultSecret(filename='/var/opt/morpheus/morpheus-ui/ansiblevau lt/vault.txt') for vault_id=default
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:999: InsecureRequestWar ning: Unverified HTTPS request is being made to host 'ais.equinor.com'. Adding c ertificate verification is strongly advised. See: https://urllib3.readthedocs.io /en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
Parsed /var/tmp/morpheusinv.yml inventory source with auto plugin
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"LinuxCentosPatch1",
"LinuxLegacy",
"UbuntuPatch1",
"WindowsLegacy",
"WindowsPatchGroup1",
"WindowsPatchGroup2",
"WindowsPatchGroup3",
"WindowsPatchGroup4",
"WindowsPatchGroup5",
"WindowsPatchGroup6",
"ungrouped"
]
}
}
from ansible-collection-morpheus-core.
What version of Morpheus are you on? I found an issue with version detection, but I've been testing against newer builds.
from ansible-collection-morpheus-core.
We're on 5.4.1
from ansible-collection-morpheus-core.
Ok, I can test on that version. Can you share the scrubbed inventory file itself?
from ansible-collection-morpheus-core.
plugin: morpheus_inventory
groups:
-
name: WindowsPatchGroup1
searchtype: tag
searchstring:
tagName: Patch
tagValue: PatchGroup1 -
name: WindowsPatchGroup2
searchtype: tag
searchstring:
tagName: Patch
tagValue: PatchGroup2 -
name: WindowsPatchGroup3
searchtype: tag
searchstring:
tagName: Patch
tagValue: PatchGroup3 -
name: WindowsPatchGroup4
searchtype: tag
searchstring:
tagName: Patch
tagValue: PatchGroup4 -
name: WindowsPatchGroup5
searchtype: tag
searchstring:
tagName: Patch
tagValue: PatchGroup5 -
name: WindowsPatchGroup6
searchtype: tag
searchstring:
tagName: Patch
tagValue: PatchGroup6 -
name: LinuxCentosPatch1
searchtype: tag
searchstring:
tagName: Patch
tagValue: Linux Centos Patch1 -
name: UbuntuPatch1
searchtype: tag
searchstring:
tagName: Patch
tagValue: Ubuntu Patch1 -
name: LinuxLegacy
searchtype: tag
searchstring:
tagName: PatchGroup
tagValue: Linux -
name: WindowsLegacy
searchtype: tag
searchstring:
tagName: PatchGroup
tagValue: PatchGroup1
morpheus_url: https://URL_HERE/
morpheus_api_key:
morpheus_ssl_verify: no
from ansible-collection-morpheus-core.
So, there's a few issues that I've found. I tested with Ubuntu 20.04, Morpheus 5.4.1-2, ansible-core 2.11.6.
In your example, you are referencing the plugin using morpheus_inventory
. In Ansible > 2.9, plugins are usually referenced by the FQCN, which in this case is morpheus.core.morpheus_inventory
. You can confirm by using ansible-doc -t inventory -l
as the morpheus-local user. My output for that is in the gist.
I installed the ansible collection as the morpheus-local user: ansible-galaxy collection install morpheus.core
. I created an inventory file referencing tags and got a successful return.
The issue I did run into is this:
[WARNING]: * Failed to parse /opt/morpheus/.local/inv.yml with auto plugin: Invalid value "morpheus.core.morpheus_inventory" for configuration option "plugin_type:
inventory plugin: ansible_collections.morpheus.core.plugins.inventory.morpheus_inventory setting: plugin ", valid values are: ['morpheus_inventory']
I'm going to fix that issue and update the collection. The workaround is to 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']
Gist with output: https://gist.github.com/tryfan/9ff4e68f1a9c4130db11400390d189c6
from ansible-collection-morpheus-core.
Tried updating that line, no errors with the FQCN atleast, but still no hosts being fetched.
I'm wondering wether this also requires the Ansible plugin to be configured on all subtenants, or shouldn't that matter?
from ansible-collection-morpheus-core.
The plugin is executed from the morpheus-local user, the tenant uses the same task backend, so it's all the same. My suspicion is that the morpheus-local user is using a different version of the plugin, and it's just being hidden with the path. The following can test all of that:
su - morpheus-local
mkdir collectiontesttmp
cd collectiontesttmp
virtualenv venv
source venv/bin/activate
pip install ansible-core==2.11.6 requests
ansible-galaxy collection install -p ./collections https://github.com/tryfan/ansible-collection-morpheus-core/releases/download/v0.2.2/morpheus-core-0.2.2.tar.gz
COLLECTIONS_PATHS=./collections
# make a simple inventory plugin with no vault for testing, just the api key and url
ansible-inventory -i <inventory.yml> --list -vvvv
The verbosity will confirm from where the collection is being loaded. I have sourced a patched version of the plugin in my public repo that is in testing. This is my output:
ansible-inventory [core 2.11.6]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/ncelebic/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/ncelebic/tmp/collectiontesttmp/venv/lib/python3.8/site-packages/ansible
ansible collection location = /home/ncelebic/.ansible/collections:/usr/share/ansible/collections
executable location = /home/ncelebic/tmp/collectiontesttmp/venv/bin/ansible-inventory
python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
jinja version = 3.0.3
libyaml = True
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/ncelebic/tmp/collectiontesttmp/inv.yml as it did not pass its verify_file() method
script declined parsing /home/ncelebic/tmp/collectiontesttmp/inv.yml as it did not pass its verify_file() method
Loading collection morpheus.core from /home/ncelebic/.ansible/collections/ansible_collections/morpheus/core
Parsed /home/ncelebic/tmp/collectiontesttmp/inv.yml inventory source with auto plugin
{
"_meta": {
"hostvars": {
"docker-t3": {
"ansible_host": "192.168.88.208"
},
"docker1": {
"ansible_host": "192.168.88.25"
},
"docker2": {
"ansible_host": "192.168.88.26"
}
}
},
"all": {
"children": [
"blah",
"ungrouped"
]
},
"blah": {
"hosts": [
"docker-t3",
"docker1",
"docker2"
]
}
}
from ansible-collection-morpheus-core.
Made sure that it's using the correct plugin version, but still no dice.
from ansible-collection-morpheus-core.
Issue has been resolved
from ansible-collection-morpheus-core.
Related Issues (20)
- settings role not working
- Change choices for FQCN compatibility
- Can't set OS type in virtual images
- Morpheus 5.4.3 requires login for version info, update inventory plugin
- Update distutils.Looseversion to packaging.version.parse
- Running job on master tenant to subtenant hosts HOT 1
- Implement proper API result paging
- Verbose output
- f-string not supported in python 2
- Remove debug message from virtualimages role
- Fix flake8 warnings for v0.2.2
- Morpheus task API key not used when running from Morpheus task
- App searchtype not working Morpheus 5.4.3
- Failed to parse morpheusinv.yml with auto plugin: HOT 1
- Target instances only if the status is running
- Read variable for morpheus url HOT 6
- Issues with fetching hosts on 0.2.3 HOT 11
- Adding further modules HOT 2
- Bump Minimum Ansible Core version to 2.15 HOT 3
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.
from ansible-collection-morpheus-core.