Skip to content

Commit

Permalink
Get slack token (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbeersingh1 authored Feb 4, 2025
1 parent f6bbb79 commit 959c36b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions playbooks/oracle_backup/get_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,18 @@
- name: Setup Slack Configuration
set_fact:
slack_channel: "{{ getslackchannel.stdout }}"

- name: Get Slack Token
ansible.builtin.command: >
/u02/stage/get_facts_script.sh
environment:
STEP: GET_SLACK_TOKEN
ACCOUNT_NAME: "{{ account_name }}"
ASSUME_ROLE_NAME: "{{ assume_role_name }}"
OEM_SECRET: "{{ secretsmanager_passwords['emrep'].secret }}"
register: get_slack_token
changed_when: false

- name: Setup Slack Token
set_fact:
getslacktoken: "{{ get_slack_token.stdout }}"
3 changes: 3 additions & 0 deletions playbooks/oracle_backup/templates/get_facts_script.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ then
whenever sqlerror exit failure
connect rcvcatowner/${RCVCATOWNER_PASSWORD}@{{ catalog }}
EOF
elif [[ "${STEP}" == "GET_SLACK_TOKEN" ]]
then
echo $(aws secretsmanager get-secret-value --secret-id "${OEM_SECRET_ARN}" --query SecretString --output text | jq -r .slack_token)
fi

0 comments on commit 959c36b

Please sign in to comment.