Ansible安装凭证文件

时间:2017-04-11 13:26:07

标签: ansible mount mount-point

我有一个包含挂载任务的playbook,当我尝试使用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

1 个答案:

答案 0 :(得分:1)

似乎有一个错误,有一个未解决的问题#22930