crusadecoder
crusadecoder

Reputation: 669

Ansible mount with credential file

I have a playbook containing a mount task which seems to be failing when i try using the credentials option.

The task below succeeds

- 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"

While the one below fails with a credentials missing related error message.

- 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"

Below is the content of the credentials file

   [root@localhost]# cat /root/secretcreds 
                      username=john
                      password=secretpass

Upvotes: 1

Views: 1697

Answers (1)

streetturtle
streetturtle

Reputation: 5850

It seems like there is a bug, there is an open issue #22930.

Upvotes: 1

Related Questions