udm_share – Manage samba shares on a univention corporate server — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# udm_share – Manage samba shares on a univention corporate server

- Synopsis
- Requirements
- Parameters
- Examples
- Status

## 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 | Choices/Defaults | Comments
--- | --- | ---
directorymode - | Default: "00755" | Permissions for the share's root directory.
group - | Default: "0" | Directory owner group of the share's root directory.
host - |  | Host FQDN (server which provides the share), e.g. `{{ ansible_fqdn }}`. Required if `state=present`.
name - / required |  | Name
nfs_custom_settings - | Default: [] | Option name in exports file. aliases: nfsCustomSettings
nfs_hosts - | Default: [] | Only allow access for this host, IP address or network.
ou - / required |  | Organisational unit, inside the LDAP Base DN.
owner - | Default: 0 | Directory owner of the share's root directory.
path - |  | Directory on the providing server, e.g. `/home`. Required if `state=present`.
root_squash - | Choices: 0 1 ← | Modify user ID for root user (root squashing).
samba_block_size - |  | Blocking size. aliases: sambaBlockSize
samba_blocking_locks - | Choices: 0 1 ← | Blocking locks. aliases: sambaBlockingLocks
samba_browseable - | Choices: 0 1 ← | Show in Windows network environment. aliases: sambaBrowseable
samba_create_mode - | Default: "0744" | File mode. aliases: sambaCreateMode
samba_csc_policy - | Default: "manual" | Client-side caching policy. aliases: sambaCscPolicy
samba_custom_settings - | Default: [] | Option name in smb.conf and its value. aliases: sambaCustomSettings
samba_directory_mode - | Default: "0755" | Directory mode. aliases: sambaDirectoryMode
samba_directory_security_mode - | Default: "0777" | Directory security mode. aliases: sambaDirectorySecurityMode
samba_dos_filemode - | Choices: 0 ← 1 | Users with write access may modify permissions. aliases: sambaDosFilemode
samba_fake_oplocks - | Choices: 0 ← 1 | Fake oplocks. aliases: sambaFakeOplocks
samba_force_create_mode - | Choices: 0 ← 1 | Force file mode. aliases: sambaForceCreateMode
samba_force_directory_mode - | Choices: 0 ← 1 | Force directory mode. aliases: sambaForceDirectoryMode
samba_force_directory_security_mode - | Choices: 0 ← 1 | Force directory security mode. aliases: sambaForceDirectorySecurityMode
samba_force_group - |  | Force group. aliases: sambaForceGroup
samba_force_security_mode - | Choices: 0 ← 1 | Force security mode. aliases: sambaForceSecurityMode
samba_force_user - |  | Force user. aliases: sambaForceUser
samba_hide_files - |  | Hide files. aliases: sambaHideFiles
samba_hide_unreadable - | Choices: 0 ← 1 | Hide unreadable files/directories. aliases: sambaHideUnreadable
samba_hosts_allow - | Default: [] | Allowed host/network. aliases: sambaHostsAllow
samba_hosts_deny - | Default: [] | Denied host/network. aliases: sambaHostsDeny
samba_inherit_acls - | Choices: 0 1 ← | Inherit ACLs. aliases: sambaInheritAcls
samba_inherit_owner - | Choices: 0 ← 1 | Create files/directories with the owner of the parent directory. aliases: sambaInheritOwner
samba_inherit_permissions - | Choices: 0 ← 1 | Create files/directories with permissions of the parent directory. aliases: sambaInheritPermissions
samba_invalid_users - |  | Invalid users or groups. aliases: sambaInvalidUsers
samba_level_2_oplocks - | Choices: 0 1 ← | Level 2 oplocks. aliases: sambaLevel2Oplocks
samba_locking - | Choices: 0 1 ← | Locking. aliases: sambaLocking
samba_msdfs_root - | Choices: 0 ← 1 | MSDFS root. aliases: sambaMSDFSRoot
samba_name - |  | Windows name. Required if `state=present`. aliases: sambaName
samba_nt_acl_support - | Choices: 0 1 ← | NT ACL support. aliases: sambaNtAclSupport
samba_oplocks - | Choices: 0 1 ← | Oplocks. aliases: sambaOplocks
samba_postexec - |  | Postexec script. aliases: sambaPostexec
samba_preexec - |  | Preexec script. aliases: sambaPreexec
samba_public - | Choices: 0 ← 1 | Allow anonymous read-only access with a guest user. aliases: sambaPublic
samba_security_mode - | Default: "0777" | Security mode. aliases: sambaSecurityMode
samba_strict_locking - | Default: "Auto" | Strict locking. aliases: sambaStrictLocking
samba_valid_users - |  | Valid users or groups. aliases: sambaValidUsers
samba_vfs_objects - |  | VFS objects. aliases: sambaVFSObjects
samba_write_list - |  | Restrict write access to these users/groups. aliases: sambaWriteList
samba_writeable - | Choices: 0 1 ← | Samba write access. aliases: sambaWriteable
state - | Choices: present ← absent | Whether the share is present or not.
subtree_checking - | Choices: 0 1 ← | Subtree checking.
sync - | Default: "sync" | NFS synchronisation.
writeable - | Choices: 0 1 ← | NFS write access.

## Examples

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

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]

### Authors

- Tobias Rüetschi (@keachi)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.