2
2
3
3
. ~ /.bash_profile
4
4
5
- OEM_ACCOUNT_ID=$( aws ssm get-parameters --with-decryption --name account_ids | jq --arg ACCOUNT_NAME ${ACCOUNT_NAME} -r ' with_entries(if (.key|test($ACCOUNT_NAME)) then ( {key: .key, value: .value}) else empty end)' | jq -r ' to_entries|.[0].value' )
5
+ OEM_ACCOUNT_ID=$( aws ssm get-parameters --with-decryption --name account_ids | jq -r .Parameters[].Value | jq --arg ACCOUNT_NAME ${ACCOUNT_NAME} -r ' with_entries(if (.key|test($ACCOUNT_NAME)) then ( {key: .key, value: .value}) else empty end)' | jq -r ' to_entries|.[0].value' )
6
6
OEM_SECRET_ARN=" arn:aws:secretsmanager:eu-west-2:${OEM_ACCOUNT_ID} :secret:${OEM_SECRET} "
7
7
ACCOUNT_ID=$( aws sts get-caller-identity --query Account --output text)
8
8
OEM_ROLE_ARN=" arn:aws:iam::${ACCOUNT_ID} :role/${ASSUME_ROLE_NAME} "
@@ -11,12 +11,13 @@ export AWS_ACCESS_KEY_ID=$(echo "${CREDS}" | tail -1 | cut -f1)
11
11
export AWS_SECRET_ACCESS_KEY=$( echo " ${CREDS} " | tail -1 | cut -f2)
12
12
export AWS_SESSION_TOKEN=$( echo " ${CREDS} " | tail -1 | cut -f3)
13
13
14
- SYSMAN_PASSWORD=$( aws secretsmanager get-secret-value --secret-id " ${OEM_SECRET_ARN} " --query SecretString --output text | jq -r .sysman)
15
- export PATH=$PATH :/u01/app/oracle/product/oem-agent/agent_{{ OEM_AGENT_VERSION }}/oracle_common/jdk/jre/bin
16
- {{ emcli }} sync 1> /dev/null 2>&1 || ( {{ emcli }} login -username=sysman -password=${SYSMAN_PASSWORD} -force && {{ emcli }} sync ) 1> /dev/null 2>&1
17
-
18
- [[ ! -z " ${EMCLI_COMMANDS} " ]] && eval ${EMCLI_COMMANDS}
19
- if [[ " ${STEP} " == " CONNECT_CATALOG" ]]
14
+ if [[ ! -z " ${EMCLI_COMMANDS} " ]]
15
+ then
16
+ SYSMAN_PASSWORD=$( aws secretsmanager get-secret-value --secret-id " ${OEM_SECRET_ARN} " --query SecretString --output text | jq -r .sysman)
17
+ export PATH=$PATH :/u01/app/oracle/product/oem-agent/agent_{{ OEM_AGENT_VERSION }}/oracle_common/jdk/jre/bin
18
+ {{ emcli }} sync 1> /dev/null 2>&1 || ( {{ emcli }} login -username=sysman -password=${SYSMAN_PASSWORD} -force && {{ emcli }} sync ) 1> /dev/null 2>&1
19
+ eval ${EMCLI_COMMANDS}
20
+ elif [[ " ${STEP} " == " CONNECT_CATALOG" ]]
20
21
then
21
22
RCVCATOWNER_PASSWORD=$( aws secretsmanager get-secret-value --secret-id " arn:aws:secretsmanager:eu-west-2:${OEM_ACCOUNT_ID} :secret:${CATALOG_SECRET} " --query SecretString --output text | jq -r .rcvcatowner)
22
23
sqlplus -s /nolog << EOF
0 commit comments