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 support for logging parameters in r10k.yml #586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,27 @@ This is the `deploy:` key in r10k, it accepts a hash that contains setting that
}
```

##### `log_settings`
This is the `logging:` key in r10k, it accepts a hash that contains settings for logging parameters.

```puppet
    $log_settings = {
      outputs      => [
        type       => 'file',
        level      => 'warn',
        parameters => {
          filename => '/var/log/r10k.log',
          trunc    => true,
        }
      ]
    }

class {'r10k':
remote => '[email protected]:acidprime/puppet.git',
log_settings => $log_settings,
}
```

##### `configfile_symlink`
boolean if to manage symlink

Expand Down
3 changes: 3 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# Location of symlink that points to configfile. Default: /etc/r10k.yaml
# * [*forge_settings*]
# Hash containing settings for downloading modules from the Puppet Forge.
# * [*log_settings*]
# Hash containing settings for logging parameters.
# * [*proxy*]
# String containing proxy setting for r10k.yaml.
# Default: undef
Expand Down Expand Up @@ -64,6 +66,7 @@
Hash $git_settings = $r10k::params::git_settings,
Hash $forge_settings = $r10k::params::forge_settings,
Hash $deploy_settings = $r10k::params::deploy_settings,
Hash $log_settings = $r10k::params::log_settings,
Optional[Array] $postrun = undef,
$root_user = $r10k::params::root_user,
$root_group = $r10k::params::root_group,
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Hash $git_settings = $r10k::params::git_settings,
Hash $forge_settings = $r10k::params::forge_settings,
Hash $deploy_settings = $r10k::params::deploy_settings,
Hash $log_settings = $r10k::params::log_settings,
$root_user = $r10k::params::root_user,
Optional[String[1]] $proxy = $r10k::params::proxy,
Optional[Integer[1]] $pool_size = $r10k::params::pool_size,
Expand Down Expand Up @@ -69,6 +70,7 @@
git_settings => $git_settings,
forge_settings => $forge_settings,
deploy_settings => $deploy_settings,
log_settings => $log_settings,
postrun => $postrun,
root_user => $root_user,
root_group => $root_group,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$git_settings = {}
$forge_settings = {}
$deploy_settings = {}
$log_settings = {}
# Git configuration
$git_server = $settings::ca_server #lint:ignore:top_scope_facts
$repo_path = '/var/repos'
Expand Down
3 changes: 3 additions & 0 deletions templates/r10k.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@
<% if @pool_size -%>
:pool_size: <%= @pool_size %>
<% end -%>
<% if !@log_settings.empty? -%>
<%= settings_to_yaml('logging', @log_settings) %>
<% end -%>