Commit fcc60156 by Kevin Falcone

Update Flower to 0.8.1

0.7.0 is from May 2014 and lacks OAuth support and a number of other
updates.

Switch to having Flower use a config file, enable OAuth

Google OAuth requires an additional 4 command line args or environment
variables, so it was time for Flower to get a proper config file.

The broker configuration remains a command line argument because it is
consumed by Celery's configuration parser, not Flower's configuration
parser.

I can't think of a reason our oauth keys need to be world readable

Move templates to live in our new directory layout

Paths under templates/ should mirror their default installation path on
disk to make it easier to correlate deployed files back to source
templates.
parent ffb60f9e
......@@ -8,16 +8,22 @@ FLOWER_BROKER_PORT: 5672
FLOWER_ADDRESS: "0.0.0.0"
FLOWER_PORT: "5555"
FLOWER_OAUTH2_KEY: "A Client ID from Google's OAUTH2 provider"
FLOWER_OAUTH2_SECRET: "A Client Secret from Google's OAUTH2 provider"
FLOWER_OAUTH2_REDIRECT: "A URL registered with Google's OAUTH2 provider"
FLOWER_AUTH_REGEX: ".*@example.com" # Can be blank to disable auth
FLOWER_USER: "flower"
flower_app_dir: "{{ COMMON_APP_DIR }}/{{ FLOWER_USER }}"
flower_data_dir: "{{ COMMON_DATA_DIR }}/{{ FLOWER_USER }}"
flower_log_dir: "{{ COMMON_LOG_DIR }}/{{ FLOWER_USER }}"
flower_conf_dir: "{{ flower_app_dir }}"
flower_venv_dir: "{{ flower_app_dir }}/venvs/flower"
flower_venv_bin: "{{ flower_venv_dir }}/bin"
flower_python_reqs:
- "flower==0.7.0"
- "flower==0.8.1"
flower_deploy_path: "{{ flower_venv_bin }}:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin"
......
......@@ -21,9 +21,19 @@
- name: create flower environment script
template: >
src=flower_env.j2 dest={{ flower_app_dir }}/flower_env
src=edx/app/flower/flower_env.j2
dest={{ flower_app_dir }}/flower_env
owner={{ FLOWER_USER }} group={{ common_web_group }}
mode=0644
mode=0640
notify:
- "restart flower"
- name: create flower configuration file
template: >
src=edx/app/flower/flowerconfig.py.j2
dest={{ flower_conf_dir }}/flowerconfig.py
owner={{ FLOWER_USER }} group={{ common_web_group }}
mode=0640
notify:
- "restart flower"
......@@ -41,7 +51,8 @@
- name: create supervisor configuration
template: >
src=flower.conf.j2 dest={{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf
src=edx/app/supervisor/conf.d.available/flower.conf.j2
dest={{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf
owner={{ supervisor_user }}
group={{ supervisor_user }}
sudo_user: "{{ supervisor_user }}"
......
# {{ ansible_managed }}
address = "{{ FLOWER_ADDRESS }}"
port = {{ FLOWER_PORT }}
oauth2_key = "{{ FLOWER_OAUTH2_KEY }}"
oauth2_secret = "{{ FLOWER_OAUTH2_SECRET }}"
oauth2_redirect_uri = "{{ FLOWER_OAUTH2_REDIRECT }}"
auth = "{{ FLOWER_AUTH_REGEX }}"
......@@ -2,6 +2,6 @@
environment=PATH="{{ flower_deploy_path }}"
user={{ common_web_user }}
command={{ flower_venv_bin }}/celery flower --broker {{ flower_broker }} --address={{ FLOWER_ADDRESS }} --port={{ FLOWER_PORT }}
command={{ flower_venv_bin }}/celery flower --broker {{ flower_broker }} --conf={{ flower_conf_dir }}/flowerconfig.py
stdout_logfile={{ supervisor_log_dir }}/{{ FLOWER_USER }}-stdout.log
stderr_logfile={{ supervisor_log_dir }}/{{ FLOWER_USER }}-stderr.log
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