credentials
我有一本包含挂载任务的剧本,当我尝试使用该选项时,该任务似乎失败了。
下面的任务成功了
- name: "mount share"
mount:
state: "mounted"
fstype: "cifs"
name: "/opt/shared"
src: "//192.168.2.5/my_shared_drive"
opts: "username=john,password=secretpass,file_mode=0644,dir_mode=0755,gid=root,uid=root"
虽然下面的失败,但凭据缺少相关的错误消息。
- name: "mount share"
mount:
state: "mounted"
fstype: "cifs"
name: "/opt/shared"
src: "//192.168.2.5/my_shared_drive"
opts: "credentials=/root/secretcreds,file_mode=0644,dir_mode=0755,gid=root,uid=root"
以下是凭证文件的内容
[root@localhost]# cat /root/secretcreds
username=john
password=secretpass