Skip to content

Commit

Permalink
Simplify kerberos ad createhostkeytab
Browse files Browse the repository at this point in the history
  • Loading branch information
billglick committed Dec 16, 2024
1 parent c53b63f commit d401f55
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions manifests/kerberos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,19 @@

# AD JOIN AND KEYTAB CREATION
if ( $ad_createhostkeytab and $ad_createhostuser and $ad_computers_ou and $ad_domain ) {
if $ad_domain in split($facts['kerberos_keytab_domains'], ',') {
$kerberos_domains = split($facts['kerberos_keytab_domains'], ',')
if ( $ad_domain in $kerberos_domains ) {
$ensure_parm = 'absent'
} else {
$ensure_parm = 'present'

exec { 'run_ad_create_host_keytab_script':
path => ['/usr/bin', '/usr/sbin', '/usr/lib/mit/bin'],
command => Sensitive(
path => ['/usr/bin', '/usr/sbin', '/usr/lib/mit/bin'],
command => Sensitive(
"/root/ad_createhostkeytab.sh '${ad_domain}' '${ad_computers_ou}' '${ad_createhostuser}' '${ad_createhostkeytab}' "
),
refreshonly => true,
require => File['/root/ad_createhostkeytab.sh'],
#refreshonly => true,
require => File['/root/ad_createhostkeytab.sh'],
}
}

Expand Down

0 comments on commit d401f55

Please sign in to comment.