Commit cb8350bc by Sef Kloninger Committed by Jason Bau

template subdir; ownership on sites-avail/ file

To support variations on our local LMS sites files it is helpful to have
subdirectories where we can store variations.  At Stanford I'm using
this so I can store carnegie/lms.j2, a variation on our normal lms.j2.

To use you can call the role like this:
    - {'role': 'edxapp', 'openid_workaround': true, 'template_subdir': 'carnegie'}
This would be from your main playbook file, in my case
edx-west/carnegie-prod-app.yml.

While in here I noticed we weren't setting owner or perms on the
sites-available/XX files, fix that.
parent 61c53f9a
# Requires nginx package
---
- name: nginx | Copying nginx config {{ site_name }}
template: src={{ item }} dest=/etc/nginx/sites-available/{{ site_name }}
template: src={{ item }} dest=/etc/nginx/sites-available/{{ site_name }} owner=root group=root mode=0600
first_available_file:
- "{{ local_dir }}/nginx/templates/{{ template_subdir }}/{{ site_name }}.j2"
- "{{ local_dir }}/nginx/templates/{{ site_name }}.j2"
# seems like paths in first_available_file must be relative to the playbooks dir
- "roles/nginx/templates/{{ site_name }}.j2"
......
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