I am using ansible.builtin.mountd module to mount and add the entry in the fstab in couple of hosts but I see that its adding \040 for the white space . How to get rid of this junk character being added to /etc/fstab?
Note that “\040” is octal. The hex equivalent is 0x20 or decimal 32, a.k.a. and ascii space.
If the octal expression is being expressed in your /etc/fstab rather than the literal space character, that sound like a bug. Which versions of Ansible and ansible.posix are you using?
you are *explicitly* asking for `src` to have a space in the middle and
one at the end. Since spaces are used as separators in /etc/fstab, the
module correctly quotes your `src` value with space being replaced by
\040.
The same is true for \040 in the options, that comes from the value you
provide, which contains spaces:
Thank you for the input. By combining the src and nfs servers to src variable I am able to get rid of one space but I have a variable path where I have this problem. not sure how to handle variable path? and for the opts i did get rid of fsck check which will default is zero