diff options
author | Milo Casagrande <milo@ubuntu.com> | 2014-05-30 13:45:30 +0200 |
---|---|---|
committer | Milo Casagrande <milo@ubuntu.com> | 2014-05-30 13:45:30 +0200 |
commit | 2e97608824b146ca2eb422535108878d939fb48f (patch) | |
tree | 75320e3d13a5d0fce3011fa5ad5e6b41415a4758 /ansible | |
parent | a6686e99efab281d8ce16052c743848721a04e6b (diff) |
ansible: Fix PYTHONPATH.
* Make sure that when django admin programs are run we are using
the correct django settings and pythonpath.
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/host_vars/releases.linaro.org | 1 | ||||
-rw-r--r-- | ansible/host_vars/snapshots.linaro.org | 1 | ||||
-rw-r--r-- | ansible/host_vars/staging.releases.linaro.org | 1 | ||||
-rw-r--r-- | ansible/host_vars/staging.snapshots.linaro.org | 1 | ||||
-rw-r--r-- | ansible/roles/install-llp/tasks/main.yml | 41 |
5 files changed, 25 insertions, 20 deletions
diff --git a/ansible/host_vars/releases.linaro.org b/ansible/host_vars/releases.linaro.org index a907579..a4cda77 100644 --- a/ansible/host_vars/releases.linaro.org +++ b/ansible/host_vars/releases.linaro.org @@ -1 +1,2 @@ hostname: releases.linaro.org +django_settings: settings_releases diff --git a/ansible/host_vars/snapshots.linaro.org b/ansible/host_vars/snapshots.linaro.org index 8b82f49..5b500f6 100644 --- a/ansible/host_vars/snapshots.linaro.org +++ b/ansible/host_vars/snapshots.linaro.org @@ -1 +1,2 @@ hostname: snapshots.linaro.org +django_settings: settings_snapshots diff --git a/ansible/host_vars/staging.releases.linaro.org b/ansible/host_vars/staging.releases.linaro.org index 79d4381..6a50bf7 100644 --- a/ansible/host_vars/staging.releases.linaro.org +++ b/ansible/host_vars/staging.releases.linaro.org @@ -1 +1,2 @@ hostname: staging.releases.linaro.org +django_settings: settings_staging_releases diff --git a/ansible/host_vars/staging.snapshots.linaro.org b/ansible/host_vars/staging.snapshots.linaro.org index d2d2254..a8aec3a 100644 --- a/ansible/host_vars/staging.snapshots.linaro.org +++ b/ansible/host_vars/staging.snapshots.linaro.org @@ -1 +1,2 @@ hostname: staging.snapshots.linaro.org +django_settings: settings_staging_snapshots diff --git a/ansible/roles/install-llp/tasks/main.yml b/ansible/roles/install-llp/tasks/main.yml index a8e36e2..827f46d 100644 --- a/ansible/roles/install-llp/tasks/main.yml +++ b/ansible/roles/install-llp/tasks/main.yml @@ -1,8 +1,5 @@ --- -# Perform installation of linaro-license-protection. - -# Create initial directory and set correct group/owner. -- name: install-llp-create-base-dir +- name: Create base directory for installation file: path={{ install_base }}/{{ hostname }} owner={{ apache_user }} group={{ apache_user }} @@ -12,7 +9,7 @@ - install - update -- name: install-llp-checkout-code +- name: Checkout linaro-license-protection code git: repo={{ git_repo }} dest={{ install_base }}/{{ hostname }}/{{ app_name }} version={{ git_tag }} @@ -21,7 +18,7 @@ - install - update -- name: install-llp-checkout-configs +- name: Checkout linaro-license-protection-configs git: repo={{ git_repo_config }} dest={{ install_base }}/{{ hostname }}/configs version={{ git_tag }} @@ -30,32 +27,36 @@ - install - update -- name: install-llp-django-syncdb - django_manage: app_path={{ install_base }}/{{ hostname }}/{{ app_name }} - command=syncdb +- name: Create db/ directory + file: path={{ install_base }}/{{ hostname }}/db + state=directory + owner={{ apache_user }} + group={{ apache_user }} + mode=755 + recurse=yes tags: - install - update -- name: install-llp-django-collectstatic +- name: Run syncdb command django_manage: app_path={{ install_base }}/{{ hostname }}/{{ app_name }} - command=collectstatic + pythonpath="{{ install_base }}/{{ hostname }}:{{ install_base }}/{{ hostname }}/{{ app_name }}:/{{ install_base }}/{{ hostname }}/configs/django" + settings={{ django_settings }} + command=syncdb tags: - install - update -- name: install-llp-create-db-dir - file: path={{ install_base }}/{{ hostname }}/db - state=directory - owner={{ apache_user }} - group={{ apache_user }} - mode=755 - recurse=yes +- name: Run collectstatic command + django_manage: app_path={{ install_base }}/{{ hostname }}/{{ app_name }} + pythonpath="{{ install_base }}/{{ hostname }}:{{ install_base }}/{{ hostname }}/{{ app_name }}:/{{ install_base }}/{{ hostname }}/configs/django" + settings={{ django_settings }} + command=collectstatic tags: - install - update -- name: install-llp-fix-repo-perm +- name: Fix directory permissions file: path={{ install_base }}/{{ hostname }}/{{ app_name }} owner={{ apache_user }} group={{ apache_user }} @@ -65,7 +66,7 @@ - install - update -- name: install-llp-fix-configs-perm +- name: Fix configs directory permissions file: path={{ install_base }}/{{ hostname }}/configs owner={{ apache_user }} group={{ apache_user }} |