Ansible 中的挂载模块错误 [英] Error in Mount Module in Ansible

查看:21
本文介绍了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

但它给出了以下错误:

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/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.

这篇关于Ansible 中的挂载模块错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆