community.general.udm_share module – Manage samba shares on a univention corporate server

Note

This module is part of the community.general collection (version 4.8.3).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.udm_share.

Synopsis

  • This module allows to manage samba shares on a univention corporate server (UCS). It uses the python API of the UCS to create a new object or edit it.

Requirements

The below requirements are needed on the host that executes this module.

  • Python >= 2.6

Parameters

Parameter

Comments

directorymode

string

Permissions for the share’s root directory.

Default: “00755”

group

string

Directory owner group of the share’s root directory.

Default: “0”

host

string

Host FQDN (server which provides the share), e.g. {{ ansible_fqdn }}. Required if state=present.

name

string / required

Name

nfs_hosts

list / elements=string

Only allow access for this host, IP address or network.

Default: []

nfsCustomSettings

aliases: nfs_custom_settings

list / elements=string

Option name in exports file.

Default: []

ou

string / required

Organisational unit, inside the LDAP Base DN.

owner

string

Directory owner of the share’s root directory.

Default: “0”

path

path

Directory on the providing server, e.g. /home. Required if state=present.

root_squash

boolean

Modify user ID for root user (root squashing).

Choices:

  • no

  • yes ← (default)

sambaBlockingLocks

aliases: samba_blocking_locks

boolean

Blocking locks.

Choices:

  • no

  • yes ← (default)

sambaBlockSize

aliases: samba_block_size

string

Blocking size.

sambaBrowseable

aliases: samba_browsable

boolean

Show in Windows network environment.

Choices:

  • no

  • yes ← (default)

sambaCreateMode

aliases: samba_create_mode

string

File mode.

Default: “0744”

sambaCscPolicy

aliases: samba_csc_policy

string

Client-side caching policy.

Default: “manual”

sambaCustomSettings

aliases: samba_custom_settings

list / elements=string

Option name in smb.conf and its value.

Default: []

sambaDirectoryMode

aliases: samba_directory_mode

string

Directory mode.

Default: “0755”

sambaDirectorySecurityMode

aliases: samba_directory_security_mode

string

Directory security mode.

Default: “0777”

sambaDosFilemode

aliases: samba_dos_filemode

boolean

Users with write access may modify permissions.

Choices:

  • no ← (default)

  • yes

sambaFakeOplocks

aliases: samba_fake_oplocks

boolean

Fake oplocks.

Choices:

  • no ← (default)

  • yes

sambaForceCreateMode

aliases: samba_force_create_mode

boolean

Force file mode.

Choices:

  • no ← (default)

  • yes

sambaForceDirectoryMode

aliases: samba_force_directory_mode

boolean

Force directory mode.

Choices:

  • no ← (default)

  • yes

sambaForceDirectorySecurityMode

aliases: samba_force_directory_security_mode

boolean

Force directory security mode.

Choices:

  • no ← (default)

  • yes

sambaForceGroup

aliases: samba_force_group

string

Force group.

sambaForceSecurityMode

aliases: samba_force_security_mode

boolean

Force security mode.

Choices:

  • no ← (default)

  • yes

sambaForceUser

aliases: samba_force_user

string

Force user.

sambaHideFiles

aliases: samba_hide_files

string

Hide files.

sambaHideUnreadable

aliases: samba_hide_unreadable

boolean

Hide unreadable files/directories.

Choices:

  • no ← (default)

  • yes

sambaHostsAllow

aliases: samba_hosts_allow

list / elements=string

Allowed host/network.

Default: []

sambaHostsDeny

aliases: samba_hosts_deny

list / elements=string

Denied host/network.

Default: []

sambaInheritAcls

aliases: samba_inherit_acls

boolean

Inherit ACLs.

Choices:

  • no

  • yes ← (default)

sambaInheritOwner

aliases: samba_inherit_owner

boolean

Create files/directories with the owner of the parent directory.

Choices:

  • no ← (default)

  • yes

sambaInheritPermissions

aliases: samba_inherit_permissions

boolean

Create files/directories with permissions of the parent directory.

Choices:

  • no ← (default)

  • yes

sambaInvalidUsers

aliases: samba_invalid_users

string

Invalid users or groups.

sambaLevel2Oplocks

aliases: samba_level_2_oplocks

boolean

Level 2 oplocks.

Choices:

  • no

  • yes ← (default)

sambaLocking

aliases: samba_locking

boolean

Locking.

Choices:

  • no

  • yes ← (default)

sambaMSDFSRoot

aliases: samba_msdfs_root

boolean

MSDFS root.

Choices:

  • no ← (default)

  • yes

sambaName

aliases: samba_name

string

Windows name. Required if state=present.

sambaNtAclSupport

aliases: samba_nt_acl_support

boolean

NT ACL support.

Choices:

  • no

  • yes ← (default)

sambaOplocks

aliases: samba_oplocks

boolean

Oplocks.

Choices:

  • no

  • yes ← (default)

sambaPostexec

aliases: samba_postexec

string

Postexec script.

sambaPreexec

aliases: samba_preexec

string

Preexec script.

sambaPublic

aliases: samba_public

boolean

Allow anonymous read-only access with a guest user.

Choices:

  • no ← (default)

  • yes

sambaSecurityMode

aliases: samba_security_mode

string

Security mode.

Default: “0777”

sambaStrictLocking

aliases: samba_strict_locking

string

Strict locking.

Default: “Auto”

sambaValidUsers

aliases: samba_valid_users

string

Valid users or groups.

sambaVFSObjects

aliases: samba_vfs_objects

string

VFS objects.

sambaWriteable

aliases: samba_writeable

boolean

Samba write access.

Choices:

  • no

  • yes ← (default)

sambaWriteList

aliases: samba_write_list

string

Restrict write access to these users/groups.

state

string

Whether the share is present or not.

Choices:

  • present ← (default)

  • absent

subtree_checking

boolean

Subtree checking.

Choices:

  • no

  • yes ← (default)

sync

string

NFS synchronisation.

Default: “sync”

writeable

boolean

NFS write access.

Choices:

  • no

  • yes ← (default)

Examples

- name: Create a share named home on the server ucs.example.com with the path /home
  community.general.udm_share:
    name: home
    path: /home
    host: ucs.example.com
    sambaName: Home

Authors

  • Tobias Rüetschi (@keachi)