playbooks/roles/ood-applications/files/bc_codeserver/template/before.sh.erb (8 lines of code) (raw):
# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module
# Find available port to run server on
export port=$(find_port ${host})
# Export compute node the script is running on
export host="${host}"
# Generate SHA1 encrypted password (requires OpenSSL installed)
export password="$(create_passwd 16)"