-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Manage Python related .dotfiles (for a user) #87
Comments
it might be valuable to have a python::dotfiles::config class where all manner of variables could be set (in Hiera), which are then used as defaults in this defined type… |
patches are urgently welcome! |
I'll try to make a proposal here during the day |
the day needs more hours, or less meetings. |
i have now solved this issue with a private (general) defined type (in a profile) define profile::python::dotfile (
$ensure = 'present',
$filename = $title,
$owner = 'root',
$group = 'root',
$mode = '0644',
$config = {},
) {
$parent_dir = dirname($filename)
exec { "create ${title}'s parent dir":
command => "install -o ${owner} -g ${group} -d ${parent_dir}",
creates => $parent_dir,
}
file { $filename:
ensure => $ensure,
owner => $owner,
group => $group,
content => template("${module_name}/inifile.erb"),
require => Exec["create ${title}'s parent dir"],
}
} the template is simply: # this file is managed by puppet
<%- @config.map do |section,conf| -%>
[<%= section -%>]
<%- conf.map do |key,value| -%>
<%= key %> = <%= value %>
<%- end -%>
<%- end -%> |
@igalic it will be better if you submit the Pull Request xD |
okay! |
python dotfiles are user-based ini-files. this defined type gives our users the ability to define arbitrary python related .dotfiles. (actually: arbitrary ini-files ;) This pr closes #87
There are a handful of Python related dotfiles, which don't seem to have a global option in /etc (or if they do, it's not documented)
In our very old fork of this module, we have a defined type python::dotfiles, which manages:
The main reason why we need this is because so we can direct our jenkins builds against our internal PyPy repository.
Is there any interest for such an extension to this module?
The text was updated successfully, but these errors were encountered: