Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hosts_allow , host_deny, inherit_acl and host msdfs at the share level #59

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Data type: `Variant[Undef, String]`

This sets the NetBIOS name by which a Samba server is known.

Default value: `'%{facts.hostname}'`
Default value: `'%{facts.networking.hostname}'`

##### <a name="-samba--domain_master"></a>`domain_master`

Expand Down Expand Up @@ -584,6 +584,10 @@ The following parameters are available in the `samba::share` defined type:
* [`writable`](#-samba--share--writable)
* [`available`](#-samba--share--available)
* [`browseable`](#-samba--share--browseable)
* [`inherit_acl`](#-samba--share--inherit_acl)
* [`host_msdfs`](#-samba--share--host_msdfs)
* [`hosts_allow`](#-samba--share--hosts_allow)
* [`hosts_deny`](#-samba--share--hosts_deny)
* [`copy`](#-samba--share--copy)
* [`create_mask`](#-samba--share--create_mask)
* [`directory_mask`](#-samba--share--directory_mask)
Expand Down Expand Up @@ -652,6 +656,38 @@ This controls whether this share is seen in the list of available shares in a ne

Default value: `undef`

##### <a name="-samba--share--inherit_acl"></a>`inherit_acl`

Data type: `Optional[Boolean]`

The inherit acl parameter in Samba controls whether Access Control Lists (ACLs) set on parent directories are automatically inherited by new files and subdirectories created within them.

Default value: `undef`

##### <a name="-samba--share--host_msdfs"></a>`host_msdfs`

Data type: `Optional[Boolean]`

The host msdfs parameter controls whether the Samba server acts as an MSDFS root, facilitating redirection of file shares in a distributed file system.

Default value: `undef`

##### <a name="-samba--share--hosts_allow"></a>`hosts_allow`

Data type: `Optional[Array[String]]`

The hosts allow parameter limit access to these ip-addresses.

Default value: `undef`

##### <a name="-samba--share--hosts_deny"></a>`hosts_deny`

Data type: `Optional[Array[String]]`

The hosts deny parameter deny access to these ip-addresses.

Default value: `undef`

##### <a name="-samba--share--copy"></a>`copy`

Data type: `Optional[String]`
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
# Main smb.conf options
Variant[Undef, String] $workgroup = 'WORKGROUP',
Variant[Undef, String] $server_string = '%h server (Samba Server Version %v)',
Variant[Undef, String] $netbios_name = '%{facts.hostname}',
Variant[Undef, String] $netbios_name = '%{facts.networking.hostname}',
Variant[Boolean, String] $domain_master = 'auto',
Variant[Boolean, String] $preferred_master = 'auto',
Variant[Undef, Boolean] $local_master = true,
Expand Down
20 changes: 20 additions & 0 deletions manifests/share.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
# @param browseable
# This controls whether this share is seen in the list of available shares in a net view and in the browse list.
#
# @param inherit_acl
# The inherit acl parameter in Samba controls whether Access Control Lists (ACLs) set on parent directories are automatically inherited by new files and subdirectories created within them.
#
# @param host_msdfs
# The host msdfs parameter controls whether the Samba server acts as an MSDFS root, facilitating redirection of file shares in a distributed file system.
#
# @param hosts_allow
# The hosts allow parameter limit access to these ip-addresses.
#
# @param hosts_deny
# The hosts deny parameter deny access to these ip-addresses.
#
# @param copy
# This parameter allows you to "clone" service entries. The specified service is simply duplicated under the current service's name.
#
Expand Down Expand Up @@ -104,6 +116,10 @@
Optional[Boolean] $writable = undef,
Optional[Boolean] $available = undef,
Optional[Boolean] $browseable = undef,
Optional[Boolean] $host_msdfs = undef,
Optional[Boolean] $inherit_acl = undef,
Optional[Array[String]] $hosts_allow = undef,
Optional[Array[String]] $hosts_deny = undef,
Optional[String] $copy = undef,
Optional[String] $create_mask = undef,
Optional[String] $directory_mask = undef,
Expand Down Expand Up @@ -163,6 +179,10 @@
"${title}-writable": target => $target, key => 'writable', value => $writable;
"${title}-available": target => $target, key => 'available', value => $available;
"${title}-browseable": target => $target, key => 'browseable', value => $browseable;
"${title}-host_msdfs": target => $target, key => 'host msdfs', value => $host_msdfs;
"${title}-inherit_acl": target => $target, key => 'inherit acl', value => $inherit_acl;
"${title}-hosts_allow": target => $target, key => 'hosts allow', value => $hosts_allow;
"${title}-hosts_deny": target => $target, key => 'hosts deny', value => $hosts_deny;
"${title}-copy": target => $target, key => 'copy', value => $copy;
"${title}-create mask": target => $target, key => 'create mask', value => $create_mask;
"${title}-directory mask": target => $target, key => 'directory mask', value => $directory_mask;
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/share_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

it {
is_expected.to have_samba__option_resource_count(63)
is_expected.to have_samba__option_resource_count(67)
}
end
end
Expand Down