2 # ============LICENSE_START=======================================================
3 # Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=========================================================
17 # Runs at deployment time to set cloudify's admin password
21 # Wait for Cloudify Manager to come up
22 while ! /scripts/cloudify-ready.sh
24 echo "Waiting for CM to come up"
30 # Expect Cloudify password to be in file mounted from Kubernetes secret,
31 # but allow overriding by CMPASS environment variable,
32 # and if not provided, use the default
33 CMPASS=${CMPASS:-$(cat /opt/onap/cm-secrets/password 2>/dev/null)}
34 CMPASS=${CMPASS:-admin}
36 echo "Set Cloudify's admin password"
38 cfy_manager --reset_admin_password $CMPASS || ./env/bin/python reset_admin.py -p $CMPASS
40 echo "Set the password used by the cfy client"
41 cfy profile set -p $CMPASS
43 echo "Cloudify password set"