I have this structure in my hiera file that create some rules in my smb.conf.
samba::shares:
PDF:
- comment = "PDF"
- path = /home/smb/pdf
- browseable = yes
- hide dot files = yes
- read only = no
- public = yes
- writable = yes
- create mode = 0775
- printable = no
Partage:
- comment= "Partage"
- path = /home/smb/Partage
- browseable = yes
- hide dot files = yes
- read only = no
- public = yes
- writable = yes
- create mode = 0775
- printable = no
I want to access the path of each share for create automatically the folder with the right persmissions.
I tried many solutions with hiera_hash() but I can not find the right setting. :
define create_folder{
# I want to loop on PDF, Partage, etc. and extract path
# for each one (/home/smb/pdf, /home/smb/Partage, etc.).
$path = hiera_hash('path')
file{"$path":
path => $path,
ensure => diretory,
owner => "smb",
group => "smb",
require => File["/home/smb/"],
mode => '775',
}
}
Can you help me please ?
Regards.