Ansible中的安装模块错误

问题描述:

我正在尝试挂载远程目录.以下是代码:

I am trying to mount a remote directory. Following is the code:

- name: mount the folder.
  mount: name=/mnt/point src="//sdfs601/master.src/scm/pkgs" fstype=auto opts="domain=td,username=uname,password=pass,file_mode=0777,dir_mode=0777" state=mounted

但是它给出了以下错误:

But it is giving the following error:

fatal: [153.64.221.181]: FAILED! => {"changed": false, "failed": true, "msg": "Error mounting /mnt/15.00: mount: special device //sdfs601/master.src/scm/pkgs does not exist\n"}

但是当我尝试在目标主机上使用shell命令进行挂载时.一切正常.以下是命令:

But when i try mounting using the shell command on target host. It is working fine. Following is the command:

/bin/mount -o username=uname,password=pass,domain=dd //sdfs601/master.src/scm/pkgs /mnt/point

http://docs. ansible.com/ansible/mount_module.html

此模块控制/etc/fstab中的活动安装点和已配置的安装点. 您可以检查python代码 https://github.com. com/ansible/ansible-modules-core/blob/devel/system/mount.py#L219

This module controls active and configured mount points in /etc/fstab. You can check python code https://github.com/ansible/ansible-modules-core/blob/devel/system/mount.py#L219

请检查您的/etc/fstab并添加适当的记录.

Please check your /etc/fstab and add an appropriate record.