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

Notify/subscribe are executed to late #114

Merged
merged 16 commits into from
Dec 5, 2023
29 changes: 29 additions & 0 deletions files/baas2/sunet-baas2-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mypy --strict sunet-baas2-bootstrap
import argparse
import os
import os.path
import platform
import shlex
import shutil
import struct
Expand Down Expand Up @@ -533,6 +534,7 @@ def handle_installation(
verify_file_hash(checksum_file)
extract_tar_file(tar_file, download_dir)
install_deb_files(download_dir)
fix_ldd()

root_cert_needed = False
root_cert_file = "/opt/tivoli/tsm/client/ba/bin/dsmcert.kdb"
Expand Down Expand Up @@ -580,5 +582,32 @@ def handle_registration() -> None:
set_encrypt_password(encrypted_passwords_db, baas_encrypt_password)


def fix_ldd() -> None:
"""Make sure the dynamic linker finds IBM's libraries
Without this fix Debian machines failed to run the IBM binaries since the linker
didn't include the directory where IBM install it's libraries.

dsmc: error while loading shared libraries: libgsk8ssl_64.so: cannot open shared object file: No such file or directory # pylint:disable=line-too-long
"""

dist_info = platform.freedesktop_os_release()
if dist_info["ID"] != "debian":
# This fix only applies to Debian
return

ldd_conf_file = "/etc/ld.so.conf.d/sunet-baas2.conf"
try:
with open(ldd_conf_file, "x", encoding="utf-8") as file:
print(f"Adding {file}")
file.write("/usr/lib64\n")
except FileExistsError:
# Assume that the existing file contains the the requested content already
pass

print("Flushing ldd cache")
# Flush the ldd cache
subprocess.run("/usr/sbin/ldconfig", check=True)


if __name__ == "__main__":
main()
10 changes: 0 additions & 10 deletions manifests/baas2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@

if $nodename and $baas_password != 'NOT_SET_IN_HIERA' and $baas_encryption_password != 'NOT_SET_IN_HIERA' {

if $facts['os']['name'] == 'Debian' {
exec { 'reload_ld_cache':
command => '/usr/sbin/ldconfig',
refreshonly => true,
}
file { '/etc/ld.so.conf.d/puppet-sunet-baas2.conf':
content => "/usr/lib64\n",
notify => Exec['reload_ld_cache']
}
}

# The dsm.sys template expects backup_dirs to not have a trailing slash, so
# make sure this is the case
Expand Down