aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/dashboard/tasks
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2015-12-16 08:23:26 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-12-16 08:23:26 +0000
commit3e93329b962a85147ccbce77a19ad4b3b93af51a (patch)
tree10ab01d91d060ea37f96b5d4ca9936325bc4b109 /deploy/adapters/ansible/roles/dashboard/tasks
parent68f4d2a4cfe706c6e7194b270e061261403b1e2d (diff)
parentc8b272b6abef169b4fe95105378cfefa49cd4261 (diff)
Merge "fix dashboard bug"
Diffstat (limited to 'deploy/adapters/ansible/roles/dashboard/tasks')
-rw-r--r--deploy/adapters/ansible/roles/dashboard/tasks/main.yml37
1 files changed, 31 insertions, 6 deletions
diff --git a/deploy/adapters/ansible/roles/dashboard/tasks/main.yml b/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
index 52318d42..86b4f93d 100644
--- a/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
@@ -22,15 +22,40 @@
action: "{{ ansible_pkg_mgr }} name=openstack-dashboard-ubuntu-theme state=absent"
- 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