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

ansible.posix.mount NFS with auto.direct produces incorrect entries #525

Open
fk-brambles opened this issue Jan 12, 2024 · 0 comments
Open

Comments

@fk-brambles
Copy link

SUMMARY

ansible.posix.mount NFS with fstab:auto.direct produces incorrect entries
- name: dummy NFS mount
ansible.posix.mount:
path: /local_mountpoint
src: remote_server:/remote_share/
fstype: nfs4
fstab: /etc/auto.direct
opts: nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev
state: present

the above command produces an /etc/auto.direct with inverted source and destinations:
remote_server:/remote_share/ /local_mountpoint nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0

instead of the expected:
/local_mountpoint -fstype=nfs,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev remote_server:/remote_share/

ISSUE TYPE
  • Bug
COMPONENT NAME

ansible.posix.mount

ANSIBLE VERSION

ansible [core 2.15.5]


##### COLLECTION VERSION

# /home/<hidden>/.ansible/collections/ansible_collections
Collection    Version
------------- -------
ansible.posix 1.3.0

# /home/<hidden>/ansible-8.5.0/lib/python3.11/site-packages/ansible_collections
Collection    Version
------------- -------
ansible.posix 1.5.4


##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 50
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/ansible.cfg) = /home/<hidden>/.vaultPassword
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent
PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 10
PERSISTENT_CONNECT_RETRY_TIMEOUT(/etc/ansible/ansible.cfg) = 30
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30

##### OS / ENVIRONMENT
Ansible : Red Hat Enterprise Linux release 8.9 (Ootpa)
Managed server : Red Hat Enterprise Linux release 8.8 (Ootpa)

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
cf. above example 

      ansible.posix.mount:
       path: /local_mountpoint
       src: remote_server:/remote_share/
       fstype: nfs4
       fstab: /etc/auto.direct
       opts: nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev
      state: present
<!--- Paste example playbooks or commands between quotes below -->
cf. above
EXPECTED RESULTS

/etc/auto.direct should be in the right sequence. Local mountpoint, NFS options, and then remote_server:/remote_share

ACTUAL RESULTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant