1

I am attempting to administer to Samba Shares' on a Ubuntu 20.04 running Samba 4.13.17-Ubuntu.

I have an Ansible playbook that writes my Samba config to smb.conf

ansible-samba

and I am adding writable & browseable as yes

When I review the file in smb.conf

I see:

smb.confg

The yes has been changed to True (which doesn't jive with way I've seen most smb.conf examples (always using yes/no strings)

When I attempt to access the share, however I get that I am restricted from browsing the files.

browse to share

When I manually edit the file smb.conf on the server change the True to yes, and restart the service, everything works fine?

updated smb.conf updated browser

I am running ansible: stable 5.3.0

1 Answers1

2

Gotta love Ansible.

Short Answer: wrap your yes and no values in " to have the values passed as strings.

Longer Answer: Ansible will treat a couple of keywords as a boolean when recorded plainly:

Things Classified as a Boolean True Things Classified as a Boolean False
Any number greater than zero Any number less than or equal to zero
A Boolean value of true (case insensitive) A Boolean value of false (case insensitive)
An Ansible-specific Yes (case insensitive) An Ansible-specific No (case insensitive)

So, as Yes and No values are Ansible-specific keywords, you will want to wrap them in quotes to make them a string. This is also true if you are working with values such as "true" and "false".

matigo
  • 20,403
  • 7
  • 43
  • 70