From 5b100712c03c9233ec89d6a30d568d3d296eab1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 20 Jun 2023 22:32:35 +0200 Subject: fixes --- manifests/auth/ldap.pp | 24 ++++-------------------- manifests/auth/local.pp | 22 +++------------------- 2 files changed, 7 insertions(+), 39 deletions(-) (limited to 'manifests/auth') diff --git a/manifests/auth/ldap.pp b/manifests/auth/ldap.pp index 028e898..9d10ceb 100644 --- a/manifests/auth/ldap.pp +++ b/manifests/auth/ldap.pp @@ -62,7 +62,7 @@ class concourse::auth::ldap ( String $user_search_username = 'uid', Optional[String] $display_name = undef, Optional[String] $user_search_filter = undef, - Optional[String] $user_search_id_attr = undef, + Optional[String] $user_search_id_attr = undef, Optional[String] $user_search_email_attr = undef, Optional[String] $user_search_name_attr = undef, Optional[Stdlib::Absolutepath] $ca_cert = undef, @@ -76,8 +76,6 @@ class concourse::auth::ldap ( Optional[Array[String]] $main_team_group = undef, Enum['absent', 'present'] $ensure = 'present', ) { - $env_file = "${concourse::web::conf_dir}/auth-ldap" - $environment = { 'CONCOURSE_LDAP_HOST' => $host, 'CONCOURSE_LDAP_BIND_DN' => $bind_dn, @@ -106,22 +104,8 @@ class concourse::auth::ldap ( }, } - file { $env_file: - ensure => $ensure, - content => epp("${module_name}/env.epp", { 'entries' => $environment }), - # To not show new password - show_diff => false, - mode => '0600', - } - - $dropin_content = @("EOF") - [Service] - EnvironmentFile=${env_file} - | EOF - - systemd::dropin_file { 'concourse-ldap-auth.conf': - ensure => $ensure, - unit => $concourse::web::service_unit, - content => $dropin_content, + concourse::conf::web { 'auth-ldap': + ensure => $ensure, + env => $environment, } } diff --git a/manifests/auth/local.pp b/manifests/auth/local.pp index 9329e30..a66fba5 100644 --- a/manifests/auth/local.pp +++ b/manifests/auth/local.pp @@ -15,8 +15,6 @@ class concourse::auth::local ( Optional[Array[String]] $main_team_group = undef, # ignored Enum['absent', 'present'] $ensure = 'present', ) { - $env_file = "${concourse::web::conf_dir}/auth-local" - $environment = { 'CONCOURSE_ADD_LOCAL_USER' => $users.map |$user| { $name = $user['name'] @@ -32,22 +30,8 @@ class concourse::auth::local ( }, } - file { $env_file: - ensure => $ensure, - content => epp("${module_name}/env.epp", { 'entries' => $environment }), - # To not show new password - show_diff => false, - mode => '0600', - } - - $dropin_content = @("EOF") - [Service] - EnvironmentFile=${env_file} - | EOF - - systemd::dropin_file { 'concourse-local-auth.conf': - ensure => $ensure, - unit => $concourse::web::service_unit, - content => $dropin_content, + concourse::conf::web { 'auth-local': + ensure => $ensure, + env => $environment, } } -- cgit v1.2.3