Page MenuHomePhabricator

new-es-password.sh

Authored By
taavi
Jan 20 2022, 9:19 AM
Size
573 B
Referenced Files
None
Subscribers
None

new-es-password.sh

#!/bin/bash
# Ugly script to generate password data
# for the Tool Labs elasticsearch cluster
set -o nounset
set -o errexit
USER=${1:?Missing USER}
PASS=$(openssl rand -base64 32)
SHA512=$(printf $PASS | mkpasswd --stdin --method=sha-512)
echo "${1} .elasticsearch.ini"
echo "----"
echo "[elasticsearch]"
echo "user=${USER}"
echo "password=${PASS}"
echo "----"
echo
echo "${1} puppet master private (hieradata/labs/tools/common.yaml)"
echo "----"
echo "profile::toolforge::elasticsearch::haproxy::elastic_users:"
echo " - name: '${1}'"
echo " password: '${SHA512}'"

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9329221
Default Alt Text
new-es-password.sh (573 B)

Event Timeline