Closed fxfitz closed 4 years ago
@fxfitz, we would love to provide ansible roles. Any pointers into top use cases that you want us to provide as a role?
Sure.
Well, overall, installing these Ansible modules seems to be a bit different than "the standard way" of installing new modules for Ansible to use. We landed up just modifying our build pipeline, but this stands out as the only 3rd party library we've had to do that for.
For example, using Ansible Galaxy is the typical way to install new modules/plugins that aren't a part of the main Ansible project. Those are provided in the form of roles, and one would do something like ansible-galaxy install -r requirements.yaml
to install the roles from either galaxy.ansible.com or from some SCM (like directly from your Github repository if you didn't want to publish it to Ansible Galaxy).
The layout of the "role" would be very similar to what you have right now in your directory structure. Anything in library/*
will be "installed" as a module.
A good example is Ansible-Network's network-engine role. Take a look here: https://github.com/ansible-network/network-engine
Another vote for this. The current installation method modifies ansible in a global way instead of per-role.
Actually would be great if you could make modules available as part of Ansible Galaxy collection, similar to other providers like VMware, F5 etc...
I agree that it would be great to have this available as a Galaxy collection. After all, they seem to be the preferred distribution format for Ansible content.
I've started to re-factor this into a collection in the namespace dellemc because it already exists. There's still a lot to do, especially updating the documentation, but at least it's a start.
We don't use these modules (yet) so I couldn't do any real-world tests, but I hope it works nevertheless. Would love to get your feedback!
@jagadeeshnv @felixs88 @Sajna-Shetty You three seem to be the only ones committing to this repo at the moment so I ask you directly: What do you think about re-factoring this into a collection? On the one hand, collections only work with Ansible >= 2.9; on the other hand, they are the native packaging format since 2.9. Would you accept my branch as a base to re-factor this into a collection if I issue a PR?
I found some time to work on re-factoring this into an ansible collection, specifically on the unit tests.
ansible-test units --requirements
is quite happy now, but while 542 tests pass there is 1 that fails and 4 errors. At the moment, I don't understand why... it would be great if someone could have a look into this and give me a hint.
@jagadeeshnv @felixs88 @Sajna-Shetty I don't fully understand the unit tests, but some look like they couldn't have worked in the past, either. But maybe I've just made a stupid mistake there. However, 542 tests that pass vs. 5 that don't is already quite good imho. Can you please have a look into my branch?
I think prio 1 would be to fix the last 5 unit tests, prio 2 updating the documentation and prio 3 having a closer look at the code with ansible-test sanity
to improve the code quality.
edit: @jagadeeshnv @felixs88 @Sajna-Shetty @rajeevarakkal How do you run the unit tests at the moment? I didn't find this documented.
I got rid of one error, but there are still 3 more. But it looks like there is only one underlying problem as test_idrac_os_deployment.py
tries 3 times to acces sdkinfra
in module dellemc_idrac
which doesn't exist:
And this one looks like a genuine failure:
[gw1] linux2 -- Python 2.7.13 /bin/python2
self = <ansible_collections.dellemc.openmanage.tests.unit.modules.test_redfish_storage_volume.TestStorageVolume object at 0x7f9fb9af5d10>
def test_volume_payload_case_01(self):
param = {
"drives": ["Disk.Bay.0:Enclosure.Internal.0-0:RAID.Mezzanine.1C-1"],
"capacity_bytes": 299439751168,
"block_size_bytes": 512,
"encryption_types": "NativeDriveEncryption",
"encrypted": True,
"volume_type": "NonRedundant",
"name": "VD1",
"optimum_io_size_bytes": 65536,
"oem": {"Dell": {"DellVirtualDisk": {"BusProtocol": "SAS", "Cachecade": "NonCachecadeVD",
"DiskCachePolicy": "Disabled",
"LockStatus": "Unlocked",
"MediaType": "HardDiskDrive",
"ReadCachePolicy": "NoReadAhead",
"SpanDepth": 1,
"SpanLength": 2,
"WriteCachePolicy": "WriteThrough"}}}}
f_module = self.get_module_mock(params=param)
> payload = self.module.volume_payload(f_module)
tests/unit/modules/test_redfish_storage_volume.py:391:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
module = <MagicMock id='140323990970576'>
def volume_payload(module):
params = module.params
drives = params.get("drives")
capacity_bytes = params.get("capacity_bytes")
physical_disks = []
oem = params.get("oem")
encrypted = params.get("encrypted")
encryption_types = params.get("encryption_types")
if capacity_bytes:
capacity_bytes = int(capacity_bytes)
if drives:
> storage_base_uri = storage_collection_map["storage_base_uri"]
E KeyError: 'storage_base_uri'
plugins/modules/redfish_storage_volume.py:313: KeyError
It looks like redfish_storage_volume
tries to access storage_collection_map["storage_base_uri"]
but this key doesn't exist.
I'm afraid I need some help here. Can someone please have a look at this?
@fxfitz @luisico @markatdxb @goetzk I've issued PR #120. We don't use these modules (yet) so I couldn't do any real-world tests, but I hope it works nevertheless. Would love to get your feedback!
@fxfitz @luisico @markatdxb @goetzk
In case you're still interested, the DellEMC guys opened a new branch collections
to work on this issue (hooray!) and I've created a new PR #128 for this branch instead of against the devel
branch.
@mariolenz That's a great news, thanks for info and all your hard work in this.
@markatdxb
That's a great news, thanks for info and all your hard work in this.
Actually, the work wasn't that hard... I quite enjoyed it because I've learned a lot about Ansible collections. The real problem is to make the maintainers of this project work with me on this. At the moment, they simply refuse to talk with me :-(
thats quite sad :( these guys need a lot of help i would say as lot of things are immature and buggy :( - lets just hope it will change soon . we starting with automation some Dell related processes and depend on Dell modules reliability
On Wed, 8 Jul 2020 at 02:07, Mario Lenz notifications@github.com wrote:
@markatdxb https://github.com/markatdxb
That's a great news, thanks for info and all your hard work in this.
Actually, the work wasn't that hard... I quite enjoyed it because I've learned a lot about Ansible collections. The real problem is to make the maintainers of this project work with me on this. At the moment, they simply refuse to talk with me :-(
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dell/dellemc-openmanage-ansible-modules/issues/46#issuecomment-655063751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPVXJL7EUS6OEYMRNDJX53R2NW5RANCNFSM4HJ6W6LA .
thats quite sad :(
@jagadeeshnv told me they're still reviewing my changes, so it looks like it's probably only a communication problem.
these guys need a lot of help i would say as lot of things are immature and buggy
Yep, I agree... it's a mess. I hope that re-factoring into a collection will improve things as this would mean we'll have some kind of standardization. I think the ansible guys are very good at keeping their code base healthy and a collection can ansible-test units --requirements
and other stuff. There are generic tests for pylint or pep8 that this project could use, too.
In my case, I wanted to embed the dell modules into an existing role so I used Python GILT to blend it in.
# Embed the offical Dell ansible modules
- files:
- dst: library/
src: deprecated/*
- dst: library/
src: library/dellemc/idrac/*
- dst: library/
src: library/dellemc/ome/*
- dst: library/
src: library/dellemc/redfish/*
- dst: module_utils/
src: utils/
git: https://github.com/dell/dellemc-openmanage-ansible-modules.git
# created at: e86b20e9528e9dde7e9fef1aa07b2304618ab260
version: devel
Sofar I havn't run into any issues solong as you also ensure the running environment has omsdk available.
@fxfitz These modules were released as an ansible collection today. Is that OK for you, can this issue be closed?
Collection works for me! Awesome job guys! Closing the issue! :ty:
Great job guys, thanks a lot
On Tue, 28 Jul 2020, 00:13 Mario Lenz, notifications@github.com wrote:
@fxfitz https://github.com/fxfitz These modules were released as an ansible collection https://galaxy.ansible.com/dellemc/openmanage today. Is that OK for you, can this issue be closed?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dell/dellemc-openmanage-ansible-modules/issues/46#issuecomment-664524491, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPVXJI7FIEWVRKQODPU4GTR5WYSXANCNFSM4HJ6W6LA .
Hi there,
I'm just curious as to why this isn't bundled as an Ansible Role? Is there something different that's needed that couldn't be provided in the form of a role?
Thanks!