Skip to content

Commit

Permalink
Install Constellation from Github
Browse files Browse the repository at this point in the history
  • Loading branch information
tdorianh committed Jun 28, 2018
1 parent 37eaf8a commit 787c748
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 23 deletions.
42 changes: 19 additions & 23 deletions roles/constellation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +58,19 @@
- uwsgi-python3
state: present

- name: Install Django
pip:
name: django
version: 1.11.13
state: present
virtualenv: /opt/constellation/venv
virtualenv_python: python3
become: true
become_user: constellation

- name: Install Python Dependencies
pip:
name:
- django
- django-auth-ldap
- pyldap
- psycopg2
- Constellation-Base
state: latest
virtualenv: /opt/constellation/venv
virtualenv_python: python3
become: true
become_user: constellation

- name: Install Constellation Modules
pip:
name: "{{ item.url | default(item.name) }}"
state: present
virtualenv: /opt/constellation/venv
virtualenv_python: python3
with_items: "{{ ConstellationApps }}"
become: true
become_user: constellation
loop_control:
label: "{{ item.name }}"

- name: Create Constellation Configuration Directory
file:
path: /opt/constellation/constellation
Expand All @@ -101,6 +79,24 @@
group: root
mode: 0755

- name: Download Constellation Modules
git:
repo: "{{ item.repo }}"
dest: "/opt/constellation/{{ item.name }}"
umask: "0022"
with_items: "{{ ConstellationModules }}"
become: true
become_user: constellation

- name: Install Constellation Modules
file:
src: "/opt/constellation/{{ item.name }}/{{ item.path }}"
dest: "/opt/constellation/{{ item.path }}"
state: link
with_items: "{{ ConstellationModules }}"
become: true
become_user: constellation

- name: Install Dynamic Constellation Site Settings
template:
src: "{{ item }}.py.j2"
Expand Down
1 change: 1 addition & 0 deletions roles/constellation/templates/settings.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# This isn't actually used by uwsgi...
SECRET_KEY = 'I_am_a_key'
SHOW_ALL_DEVICES = '{{ constellation_showdeviceskey }}'

ALLOWED_HOSTS = ["constellation.collegiumv.org"]

Expand Down
16 changes: 16 additions & 0 deletions roles/constellation/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
---
constellation_dbpassword: "{{ lookup('file', 'secret/constellation_dbpassword') }}"

constellation_showdeviceskey: "{{ lookup('file', 'secret/constellation_showdeviceskey') }}"

ConstellationApps:
- name: Constellation-OrderBoard
mountpoint: orderboard/
- name: Constellation-DeviceManager
mountpoint: devices/
- name: Constellation-Vote
mountpoint: vote/

ConstellationModules:
- name: OrderBoard
repo: https://github.com/ConstellationApps/OrderBoard
path: constellation_orderboard
- name: DeviceManager
repo: https://github.com/ConstellationApps/DeviceManager
path: constellation_devicemanager
- name: Vote
repo: https://github.com/ConstellationApps/Vote
path: constellation_vote
- name: Base
repo: https://github.com/ConstellationApps/Base
path: constellation_base

0 comments on commit 787c748

Please sign in to comment.