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 possibility to manage encryption configuration #7

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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The `jerakia` class supports the following optional parameters
* `install_package`: If set to false, don't manage the package (default: true)
* `config_dir`: Location of the configuration directory
* `config_replace`: If set to false, will not overwrite the config after creation
* `config_mode`: Config file mode (default: 0600)
* `policy_dir`: Location of the policy directory
* `manage_config_dir`: Create/manage the config dir (default: true)
* `manage_plugin_dir`: Create/manage the plugin dir (default: true)
Expand All @@ -69,6 +70,7 @@ The `jerakia` class supports the following optional parameters
* `enable_schemas`: Enable or disable schemas by setting true or false
* `schema_opts`: A hash containing schema override options
* `plugin_opts`: A hash of options to be passed to plugins
* `encryption_opts`: A hash of options for encryption

### Examples:

Expand Down
5 changes: 1 addition & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
ensure => file,
content => template('jerakia/jerakia.yaml.erb'),
replace => $::jerakia::config_replace,
mode => $::jerakia::config_mode,
}



}

2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
$install_package = $::jerakia::params::install_package,
$config_dir = $::jerakia::params::config_dir,
$config_replace = $::jerakia::params::config_replace,
$config_mode = $::jerakia::params::config_mode,
$policy_dir = $::jerakia::params::policy_dir,
$manage_config_dir = $::jerakia::params::manage_config_dir,
$manage_plugin_dir = $::jerakia::params::manage_plugin_dir,
Expand All @@ -60,6 +61,7 @@
$enable_schemas = undef,
$schema_opts = {},
$plugin_opts = {},
$encryption_opts = {},
) inherits jerakia::params {

class { '::jerakia::package': } ->
Expand Down
3 changes: 1 addition & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

$config_dir = '/etc/jerakia'
$config_replace = true
$config_mode = '0600'
$plugin_dir = "${config_dir}/lib"
$policy_dir = "${config_dir}/policy.d"
$logfile = '/var/log/jerakia/jerakia.log'
Expand All @@ -30,6 +31,4 @@
$logfile_group = 'puppet'
$logfile_mode = '0644'



}
10 changes: 7 additions & 3 deletions templates/jerakia.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ schema:
<% end -%>
<% end -%>



<% unless scope['::jerakia::plugin_opts'].empty? -%>
# Plugin options
plugins:
Expand All @@ -38,4 +36,10 @@ plugins:
<% end -%>
<% end -%>


<% unless scope['::jerakia::encryption_opts'].empty? -%>
# Encryption options
encryption:
<% scope['::jerakia::encryption_opts'].each do |key, val| -%>
<%= key %>: <%= val %>
<% end -%>
<% end -%>