Skip to content
Open
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
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Manage POSIX filesystem ACLs with Puppet.

Most (all?) other ACL modules implement a type which can be declared only once
per file, which isn't flexible. This module takes the unusual approach of
creating a single large concatenated script to manage all ACLs recursively in
creating a single large concatenated script to manage all ACLs in
a single run. Ugly, yet very efficient and flexible since ACLs aren't tied to
the `file` type in any way.

Expand Down Expand Up @@ -104,6 +104,17 @@ fooacl::conf { 'backend':
'user:userZ:rwX',
],
}
# Some configuration file
fooacl::conf { configuration':
target => [
'/etc/nginx/sites-available/backend.example.com.conf',
'/etc/nginx/sites-available/backend.example.org.conf',
],
permissions => [
'user:userZ:rwX',
],
recursive => false,
}
```

## Debugging
Expand Down
1 change: 1 addition & 0 deletions manifests/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
define fooacl::conf (
$permissions,
$target = $name,
$recurse = true,
$order = 20,
) {

Expand Down
2 changes: 1 addition & 1 deletion templates/10.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

# Initial global ACLs for each path to manage
ACLOPTS_GLOBAL="-R -b"
ACLOPTS_GLOBAL="-b"

# Create array to store ACLs, with keys for each path to manage
declare -A ACLOPTS
Expand Down
2 changes: 1 addition & 1 deletion templates/20.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ end
<% if f == 'default' -%>
ACLOPTS_GLOBAL+="<% @permissions.flatten.each do |p| %> -m <%= p %> -m d:<%= p %><% end %>"
<% else -%>
ACLOPTS[<%= f %>]+="<% @permissions.flatten.each do |p| %> -m <%= p %> -m d:<%= p %><% end %>"
ACLOPTS[<%= f %>]+="<% if @recurse %>-R<% end %><% @permissions.flatten.each do |p| %> -m <%= p %><%if @recurse %>-m d:<%= p %><% end %><% end %>"
<% end -%>
<% end -%>