From c8b272b6abef169b4fe95105378cfefa49cd4261 Mon Sep 17 00:00:00 2001 From: "carey.xu" Date: Tue, 15 Dec 2015 19:06:22 +0800 Subject: fix dashboard bug - use change option instead of copy config file - precompile horizon css, avoid http page error JIRA: COMPASS-202 Change-Id: I3f6fa494450042aa3ddb48a16454eca7f4ff1ce1 Signed-off-by: carey.xu --- .../ansible/roles/dashboard/tasks/main.yml | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'deploy/adapters/ansible/roles/dashboard/tasks') diff --git a/deploy/adapters/ansible/roles/dashboard/tasks/main.yml b/deploy/adapters/ansible/roles/dashboard/tasks/main.yml index 5afcb157..54e48c25 100644 --- a/deploy/adapters/ansible/roles/dashboard/tasks/main.yml +++ b/deploy/adapters/ansible/roles/dashboard/tasks/main.yml @@ -24,15 +24,40 @@ line="-l {{ internal_vip.ip }}" - name: update ubuntu horizon settings - template: src=local_settings_debian - dest=/etc/openstack-dashboard/local_settings.py - backup=yes + lineinfile: + dest: /etc/openstack-dashboard/local_settings.py + regexp: '{{ item.regexp }}' + line: '{{ item.line }}' + with_items: + - regexp: '^WEBROOT[ \t]*=.*' + line: 'WEBROOT = "/horizon"' + - regexp: '^COMPRESS_OFFLINE[ \t]*=.*' + line: 'COMPRESS_OFFLINE=True' + - regexp: '^ALLOWED_HOSTS[ \t]*=.*' + line: 'ALLOWED_HOSTS = ["*"]' + - regexp: '^OPENSTACK_HOST[ \t]*=.*' + line: 'OPENSTACK_HOST = "{{ internal_ip }}"' + when: ansible_os_family == 'Debian' + +- name: precompile horizon css + shell: /usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force + ignore_errors: True when: ansible_os_family == 'Debian' - name: update redhat version horizon settings - template: src=local_settings_redhat - dest=/etc/openstack-dashboard/local_settings - backup=yes + lineinfile: + dest: /etc/openstack-dashboard/local_settings + regexp: '{{ item.regexp }}' + line: '{{ item.line }}' + with_items: + - regexp: '^WEBROOT[ \t]*=.*' + line: 'WEBROOT = "/horizon"' + - regexp: '^COMPRESS_OFFLINE[ \t]*=.*' + line: 'COMPRESS_OFFLINE=False' + - regexp: '^ALLOWED_HOSTS[ \t]*=.*' + line: 'ALLOWED_HOSTS = ["*"]' + - regexp: '^OPENSTACK_HOST[ \t]*=.*' + line: 'OPENSTACK_HOST = "{{ internal_ip }}"' when: ansible_os_family == 'RedHat' - name: restart dashboard services -- cgit 1.2.3-korg