-
Notifications
You must be signed in to change notification settings - Fork 18
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
chown passwd file #1
Comments
I don't think that's a good idea. If we had that parameter each htpasswd user resource could specify a different owner and the final owner would randomly change between the specified ones. |
I don't get it. Currently the owner would be user under which you run puppet. For security reasons it's a good idea to restrict the file to a specific user or group, eg. |
@deric: I agree it's a good idea to restrict the file to a specific user or group. And what I usually do when using this module is specify a file resource that just sets the owner/group and permissions for the file. Adding the owner as a property for the type would be a problem because you could have the following two definitions (maybe in two different modules) and then the ownership of the file would depend on the order in which the two modules are included.
|
Ok, your're right. We would need a resource for declaring file first and then another one for a single record. Using file is much easier.
|
Hey @leinaddm I'm not sure why, but your suggestion with using the dedicated
With the following manifest:
|
I guess the main problem is, that file { '/etc/htpasswd/graphite':
owner => 'www-data',
group => 'www-data',
mode => '0440',
}
htpasswd { $user:
ensure => 'present',
cryptpasswd => $secret,
target => '/etc/htpasswd/graphite',
require => File['/etc/htpasswd/graphite'],
} Which means that firstly would be created empty file with proper permission, then content written. (I haven't tested the code). |
For us the other way around helps: |
@Felixoid That's basically the same except all |
@deric that's not the same, File requires Htpasswd, not another way around. And yes, we are aware of possible issues on the big amount of resources, thank you. I've checked your option, it doesn't work. The
|
@Felixoid Oh, sorry I've overlooked that. Normally it should be the other way round (when autorequire is defined on the type and files are managed properly). |
Maybe, puppet's Parsedfile doesn't implement File type? I'm not able to even read ruby on the level the puppet it's written, unfortunately |
It would be cool to pass a parameter which would change ownership of the created file.
The text was updated successfully, but these errors were encountered: