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

workaround "sensitive in hash" #38

Merged
merged 6 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 manifests/docker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#
class hdm::docker {
assert_private()

if $hdm::manage_docker {
include docker
}
Expand All @@ -18,6 +19,7 @@
'Debian' => '/usr/sbin/nologin',
'RedHat' => '/sbin/nologin',
}

user { $hdm::user:
ensure => present,
gid => $hdm::group,
Expand Down
29 changes: 20 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# }
# ```
#
# @param puppet_code_dir The path where HDM can find deployed
# @param puppet_code_dir The path where HDM can find deployed
# Puppet environments (similar to puppet config code_dir)
# defaults to '/etc/puppetlabs/code'
#
Expand All @@ -77,8 +77,8 @@
# Values for keys are taken from hiera.yaml file and can
# not be set individually.
#
# @param read_only Set to false if you want the ability to
# change data via HDM webfrontend.
# @param read_only Set to false if you want the ability to
# change data via HDM webfrontend.
# WARNING!! setting to true is untested!!!
# Changes are stored via GIT.
# Setting this to true also needs the git_data Array parameter
Expand All @@ -105,12 +105,13 @@
# 'port' => 389,
# 'base_dn' => 'ou=hdm,dc=nodomain',
# 'bind_dn' => 'cn=admin,dc=nodomain',
# 'bind_dn_password' => 'openldap',
# 'ldaps' => false,
# }
# ```
#
# @param hdm_hiera_config_file Set to another file if you
# @param ldap_bind_dn_password sensitive password for ldap bind
#
# @param hdm_hiera_config_file Set to another file if you
# want HDM to not use hiera.yaml.
#
# @example
Expand All @@ -135,11 +136,21 @@
Stdlib::Unixpath $puppet_code_dir = '/etc/puppetlabs/code',
String[1] $hdm_hiera_config_file = 'hiera.yaml',
# additional application parameter
Boolean $allow_encryption = false,
Boolean $read_only = true,
Optional[Hdm::Gitdata] $git_data = undef,
Optional[Hdm::Ldap_settings] $ldap_settings = undef,
Boolean $allow_encryption = false,
Boolean $read_only = true,
Optional[Hdm::Gitdata] $git_data = undef,
Optional[Hdm::Ldap_settings] $ldap_settings = undef,
Optional[Sensitive[String[1]]] $ldap_bind_dn_password = undef,
) {
if $ldap_settings {
if $ldap_bind_dn_password {
$final_ldap_settings = $ldap_settings + { bind_dn_password => $ldap_bind_dn_password }
}
else {
$final_ldap_settings = $ldap_settings
}
}

case $method {
'docker': {
$run_mode = 'production'
Expand Down
3 changes: 3 additions & 0 deletions manifests/rvm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# @api private
class hdm::rvm {
assert_private()

group { $hdm::group:
ensure => present,
}
Expand Down Expand Up @@ -53,7 +54,9 @@
package { 'devtoolset-7':
ensure => present,
}

$exec_prefix = 'scl enable devtoolset-7 '

exec { 'update sqlite':
command => 'yum install -y https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-devel-3.8.11-1.fc21.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-3.8.11-1.fc21.x86_64.rpm',
path => $facts['path'],
Expand Down
5 changes: 2 additions & 3 deletions templates/hdm.yml.epp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<%= $key %>: <%= $value %>
<%- } -%>
config_dir: <%= $hdm::puppet_code_dir %>
<%- if ! $hdm::ldap_settings.empty { -%>
<%- if ! $hdm::final_ldap_settings.empty { -%>
ldap:
<%- $hdm::ldap_settings.each |$key, $value| { -%>
<%- $hdm::final_ldap_settings.each |$key, $value| { -%>
<%= $key %>: <%= $value %>
<%- } -%>
<%- } -%>

1 change: 0 additions & 1 deletion types/ldap_settings.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
'port' => Stdlib::Port,
'base_dn' => String[1],
'bind_dn' => String[1],
'bind_dn_password' => Sensitive,
rwaffen marked this conversation as resolved.
Show resolved Hide resolved
'ldaps' => Boolean,
}
]