Skip to content

aymericDD/ansible-role-samba

Repository files navigation

Ansible Role: Samba

Build Status test-suite Ansible Galaxy

Installs Samba client and server for Debian Stretch/Buster.

Requirements

Samba requires ports 137, 138, 139, 445 to be open to function properly.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

samba_global_workgroup: WORKGROUP
samba_home_browseable: no
samba_home_read_only: yes
samba_home_create_mask: 0700
samba_home_directory_mask: 0700
samba_home_valid_users: '%S'
samba_shares: [] # functionality to manage share directory

You can add unlimited shared directories. To add a shared directory, you can add variable like:

samba_shares:
  - name: example
    options: |
      create mask = 0777
      directory mask = 0777

Something along those lines (at a minimum), and it would output in /etc/samba/smb.conf:

[example]
   create mask = 0777
   directory mask = 0777

Dependencies

None.

Example Playbook

- hosts: servers
  roles:
     - { role: aymericdd.samba }

License

BSD

Author Information

This role is based on samba role written by Jeff Geerling, author of Ansible for DevOps.

This role was created in 2019 by AymericDD.