2016-02-17 48 views
1

我正在嘗試掛載遠程目錄。以下是代碼:Ansible模塊中的錯誤

- 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命令安裝。它工作正常。以下是命令:

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

回答

0

對於將來出現相同錯誤的人,請設置相應的fstype

當我試圖做類似的事情時,我得到了完全相同的錯誤消息,掛載了一個NFS共享。它在shell中也工作得很好。但是之後它在Ansible任務中設置fstype: nfs後工作。

得知此處的線索:Why won't Ansible mount Vagrant remote NFS share