dell / ansible-powerscale

PowerScale (Isilon) Ansible modules
GNU General Public License v3.0
25 stars 21 forks source link

[FEATURE]: Provide possibility to check existence and settings of a directory/filesystem w/o modifying it #78

Open fthommen opened 3 weeks ago

fthommen commented 3 weeks ago

Describe the solution you'd like I would like to see the possibility to check, if a specific path already exists (and what are its settings), before I risk overwriting it with new settings. The current filesystem module requires me to set state to either present (which creates the directory) or absent (which removes it if possible). Also a mandatory owner.name has to be provided, which changes the owner of the directory. This is unwanted when just checking on a directory state

Describe alternatives you've considered Commandline and API. Both alternatives are not an option, as they would require to break the ansible-only workflow

Additional context none

fthommen commented 3 weeks ago

Extension: Basically this request extends to all modules (nfs, smartquota ecc.), which should have the possibility for checking w/o modifying.

anupamaloke commented 3 weeks ago

@fthommen, thank you for submitting the feature request. I have added it to the backlog and will prioritize it over the upcoming future releases.

fthommen commented 3 weeks ago

Thank you @anupamaloke. I'd rather see this as a design flaw than a feature request. Or what would be the recommendation of how to check the existence of a directory/share/quota?

anupamaloke commented 3 weeks ago

@fthommen, I agree. Ideally, one should be able to use the info module to get details of the all the OneFS resources. However, it does not seem to be case. For one, it does not support all the resources (like quota for e.g.) and even for the resources that it supports, it does not always list the details but unique IDs. So, the interim solution will be to use the dellemc.powerscale.info module to get the ID details of that resource and then use that with the respective resource module to view the complete details. That still leaves resources that are not supported with Info module yet. For those modules, the interim solution would be make direct REST API calls using ansible.builtin.uri module.

Easiest way to get this supported would be to make the state argument optional. So, if the state is not provided, then the module acts as an info module by returning all the details. I have added this enhancement to the backlog.

fthommen commented 2 weeks ago

Thanks for the hint @anupamaloke For the time being I will now check the directory existence directly via API using curl