Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Updated edxapp Elasticsearch config
Browse files Browse the repository at this point in the history
The urllib3 library (used by the Elasticsearch Python library) expects ports to be integers, not strings, when passed as kwargs. Since Ansible and Jinja2 are not capable of rendering this value as a string, an alternate format of the config has been added.
  • Loading branch information
clintonb authored and Clinton Blackburn committed May 26, 2017
1 parent 7bb07f9 commit e40c6de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions playbooks/roles/edxapp/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ EDXAPP_MYSQL_HOST: 'localhost'
EDXAPP_MYSQL_PORT: '3306'

EDXAPP_SEARCH_HOST: 'localhost'
EDXAPP_SEARCH_PORT: '9200'
EDXAPP_SEARCH_PORT: 9200

# list of dictionaries of the format
# { 'host': 'hostname', 'port': 'portnumber', 'otherconfigsuchas use_ssl': 'True' }
# http://elasticsearch-py.readthedocs.org/en/master/api.html#elasticsearch
EDXAPP_ELASTIC_SEARCH_CONFIG:
- host: "{{ EDXAPP_SEARCH_HOST }}"
port: "{{ EDXAPP_SEARCH_PORT }}"
# NOTE: We combine the host and port in this manner, as opposed to passing a dict with host and port keys, due to
# the fact that Ansible and Jinja2 will ultimately render the port as a string, which is unnacceptable by the
# consuming code. See http://elasticsearch-py.readthedocs.org/en/master/api.html#elasticsearch for alternative
# acceptable formats.
- "{{ EDXAPP_SEARCH_HOST }}:{{ EDXAPP_SEARCH_PORT }}"

EDXAPP_SETTINGS: '{{ COMMON_EDXAPP_SETTINGS }}'

Expand Down

0 comments on commit e40c6de

Please sign in to comment.