Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZFS module does not support property values with spaces #3545

Closed
arsatiki opened this issue Jul 16, 2013 · 1 comment · Fixed by #3549
Closed

ZFS module does not support property values with spaces #3545

arsatiki opened this issue Jul 16, 2013 · 1 comment · Fixed by #3549

Comments

@arsatiki
Copy link
Contributor

The ZFS module does not handle property values that contain spaces. Most of the time this isn't an issue, since the values are usually single words. However, it is possible to provide NFS options to sharenfs property, which must then contain spaces.

To reproduce:

Specify the following task in a playbook (adjust for pool names etc.):

zfs: name=data/share state=present sharenfs="-network 10.0.0.80 -mask 255.255.255.255"

Expected result:

The sharenfs result is set idempotently to the value specified.

Actual result:

The property value is not quoted and results in an error:

msg: cannot open '10.0.0.80': dataset does not exist
cannot open '-mask': dataset does not exist
cannot open '255.255.255.255': dataset does not exist

As a workaround, I can manually quote the property value (again), but this is very ugly. Also, the module does not then recognize that the value is unchanged, which leads to an unnecessary changed=1 at the end of the playbook.

For more details, see an example playbook and related output at https://gist.github.com/arsatiki/6006264

@arsatiki
Copy link
Contributor Author

In the pull request, I converted one string-args run_command into a list-args one. It seems that the module uses the string-based command exclusively, which does not seem to add any real value. Would it be okay to convert all of those cases into list-args format? Or would that be just pointless code churn?

mpdehaan pushed a commit that referenced this issue Jul 16, 2013
Converting the argument list to a string with ' '.join causes
the shell interpreter to misparse spaces in property values.
Since the zfs command does not need shell anywhere, using
a list instead of a string works just as well with run_command. 

Fixes #3545.
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant