Skip to content

Commit

Permalink
Merge register service account with get keytab in jupyterhub
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Nov 14, 2024
1 parent e0a0c6d commit 894c55a
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions site/profile/manifests/jupyterhub.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,20 @@
}

$ipa_passwd = lookup('profile::freeipa::server::admin_password')
exec { 'jupyterhub_ipa_service_register':
command => "kinit_wrapper ipa console ${jupyterhub::prefix}/bin/ipa_register_service.py",
refreshonly => true,
require => [
Exec['jupyterhub_venv'],
File["${jupyterhub::prefix}/bin/kinit_wrapper"],
Exec['ipa-install'],
],
subscribe => File["${jupyterhub::prefix}/bin/ipa_register_service.py"],
environment => ["IPA_ADMIN_PASSWD=${ipa_passwd}"],
path => ['/bin', '/usr/bin', '/sbin','/usr/sbin', "${jupyterhub::prefix}/bin"],
}

$keytab_command = @("EOT")
kinit_wrapper ipa console ${jupyterhub::prefix}/bin/ipa_register_service.py && \
kinit_wrapper ipa-getkeytab -p jupyterhub/jupyterhub -k /etc/jupyterhub/jupyterhub.keytab
|EOT
exec { 'jupyterhub_keytab':
command => 'kinit_wrapper ipa-getkeytab -p jupyterhub/jupyterhub -k /etc/jupyterhub/jupyterhub.keytab',
command => $keytab_command,
creates => '/etc/jupyterhub/jupyterhub.keytab',
require => [
File['/etc/jupyterhub'],
File["${jupyterhub::prefix}/bin/kinit_wrapper"],
Exec['jupyterhub_ipa_service_register'],
Exec['ipa-install'],
],
subscribe => File["${jupyterhub::prefix}/bin/ipa_register_service.py"],
environment => ["IPA_ADMIN_PASSWD=${ipa_passwd}"],
path => ['/bin', '/usr/bin', '/sbin','/usr/sbin', "${jupyterhub::prefix}/bin"],
}
Expand Down

0 comments on commit 894c55a

Please sign in to comment.