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 autorequire on parent ACL #18

Merged
merged 1 commit into from
Sep 23, 2015
Merged

Conversation

roidelapluie
Copy link
Member

No description provided.

@dobbymoodge
Copy link

I can't determine that this behaves any differently from what's already in master. What is really needed (and what I haven't figured out how to do yet) is to make an Acl for a directory require Files that are children of the directory. So for example, given this puppet code:

# This file is saved as ./test.pp
# The puppet-acl module is checked out into ./puppet-acl
file { "/tmp/testdir":
    ensure => directory,
}

file { [ "/tmp/testdir/a",
         ]:
    ensure => file,
}

acl { "/tmp/testdir":
    action     => set,
    permission => [
                   "user::rwx",
                   "group::---",
                   "mask::r-x",
                   "other::---",
                   "default:user::rwx",
                   "default:group::r-x",
                   "default:mask::rwx",
                   "default:other::---",
                   ],
    provider   => posixacl,
    recursive  => true,
    recursemode => deep,
#    require => File["/tmp/testdir/a"],
}

run like so:

# rm -rf /tmp/testdir
# puppet apply --verbose --debug --modulepath=. ./test.pp

the Acl should require both of the File resources, since /tmp/testdir/a will (probably) be created after the Acl is applied to /tmp/testdir, and so /tmp/testdir/a will have the ACLs that are calculated at file create (mask::rw-, user::rw-) instead of the ACLs that are intended to be applied (mask::rwx, user::rwx). If you run puppet apply ... twice without deleting /tmp/testdir, it fixes up the ACLs as desired.

Note that if you uncomment the require in the Acl resource, it still doesn't work. I'm still looking into why this is the case.

I'm not sure how to do this.

@roidelapluie
Copy link
Member Author

@dobbymoodge done

@dobbymoodge
Copy link

@roidelapluie This doesn't work because it looks for the additional requirements in the filesystem instead of in the catalog. Also, I haven't been able to get it to work (under ruby 1.8.7).

@roidelapluie
Copy link
Member Author

what about this

@dobbymoodge
Copy link

@roidelapluie I'll have to test it again tomorrow, but at first glance it isn't handling the test case outlined above. I'm out of time today, unfortunately.

@dobbymoodge
Copy link

@roidelapluie At least with the test.pp file I listed above, this still requires 2 runs before the final calculated ACLs are applied to /tmp/testdir/a. I wonder if we're trying to solve the same problem? I would really love to see the Acl resources applied only after all the File resources which are interdependent with the Acl are applied.

Maybe it's possible to force the Acl resources to only get applied after every File resource is applied? Or are the Acl autorequires unsatisfied because the interdependent File paths don't exist at the time the catalog is compiled? If that's the case, then maybe the only way to avoid multiple runs for nested ACLs is to implement #16

@roidelapluie
Copy link
Member Author

I know the problem now. Quickly taking a look.

@roidelapluie
Copy link
Member Author

now it should be fine

@roidelapluie
Copy link
Member Author

it is not good yet

@roidelapluie
Copy link
Member Author

Now it should be ok

dobbymoodge added a commit that referenced this pull request Sep 23, 2015
Add autorequire on parent ACL
@dobbymoodge dobbymoodge merged commit b62a0d7 into voxpupuli:master Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants