Commit af01848b by Clinton Blackburn Committed by GitHub

Added continous delivery playbook to discovery service refresh metadata (#3310)

ECOM-5134
parent 5d7cebb8
# This playbook will run the refresh_course_metadata management command. It is intended solely for usage with the
# Catalog/Course Discovery Service.
#
# Required variables for this playbook:
#
# - APPLICATION_PATH - the top-level path of the Django application; the application lives underneath
# this directory in a directory with the same name as APPLICATION_NAME.
# - APPLICATION_NAME - The name of the application that we are migrating.
# - APPLICATION_USER - user which is meant to run the application
# - HIPCHAT_TOKEN - API token to send messages to hipchat
# - HIPCHAT_ROOM - ID or name of the room to send the notification
# - HIPCHAT_URL - URL of the hipchat API (defaults to v1 of the api)
#
# Example command line to run this playbook:
# ansible-playbook -vvvv -i "localhost," -c local \
# -e @overrides.yml \
# discovery_refresh_metadata.yml
#
- hosts: all
vars:
HIPCHAT_URL: https://api.hipchat.com/v2/
COMMAND_PREFIX: " . {{ APPLICATION_PATH }}/{{ APPLICATION_NAME }}_env; /edx/bin/python.{{ APPLICATION_NAME }} /edx/bin/manage.{{ APPLICATION_NAME }}"
gather_facts: False
tasks:
- name: Refresh metadata
shell: '{{ COMMAND_PREFIX }} refresh_course_metadata'
become_user: "{{ APPLICATION_USER }}"
- name: Send Hipchat notification
hipchat_2_0_0_1:
api: "{{ HIPCHAT_URL }}"
token: "{{ HIPCHAT_TOKEN }}"
room: "{{ HIPCHAT_ROOM }}"
msg: "Catalog metadata has been refreshed."
ignore_errors: yes
when: HIPCHAT_TOKEN is defined
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment