summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/dashboard/tasks
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2016-03-14 15:38:33 +0800
committercarey xu <carey.xuhan@huawei.com>2016-03-18 06:41:56 +0000
commit00826d9f9131b5b3d76d01c13912496ec6067204 (patch)
treee6b81ec95c2ec555b6f4b5a0bfc4e957cec837b2 /deploy/adapters/ansible/roles/dashboard/tasks
parent2490b7463f3a2fc86277f957945b92263495c01c (diff)
seperate apache2 installtion from dashboard
JIRA: COMPASS-342 Change-Id: I8ddbef46486dbd22f1324bda2d04f7a192b2148e Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/dashboard/tasks')
-rw-r--r--deploy/adapters/ansible/roles/dashboard/tasks/main.yml67
1 files changed, 52 insertions, 15 deletions
diff --git a/deploy/adapters/ansible/roles/dashboard/tasks/main.yml b/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
index 6482017c..ce4fd978 100644
--- a/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
@@ -9,25 +9,58 @@
---
- include_vars: "{{ ansible_os_family }}.yml"
-- name: install http packages
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: http_packages
-
-- name: set http config
- lineinfile: dest={{ http_config_file }} regexp='^Listen' line='Listen {{ internal_ip }}:80'
-
-- name: restart http services
- service: name={{ http_service }} state=restarted enabled=yes
-
-- name: write services to monitor list
- lineinfile: dest=/opt/service create=yes line='{{ http_service }}'
+- name: disable auto start
+ copy:
+ content: "#!/bin/sh\nexit 101"
+ dest: "/usr/sbin/policy-rc.d"
+ mode: 0755
+ when: ansible_os_family == "Debian"
- name: install dashboard packages
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: packages | union(packages_noarch)
+- name: enable auto start
+ file:
+ path=/usr/sbin/policy-rc.d
+ state=absent
+ when: ansible_os_family == "Debian"
+
- name: remove ubuntu theme
action: "{{ ansible_pkg_mgr }} name=openstack-dashboard-ubuntu-theme state=absent"
+ when: ansible_os_family == 'Debian'
+ notify:
+ - restart dashboard services
+
+- name: remove default apache2 config
+ file:
+ path: '{{ item }}'
+ state: absent
+ when: ansible_os_family == 'Debian'
+ with_items:
+ - '{{ apache_config_dir }}/conf-available/openstack-dashboard.conf'
+ - '{{ apache_config_dir }}/conf-enabled/openstack-dashboard.conf'
+ - '{{ apache_config_dir }}/sites-available/000-default.conf'
+ - '{{ apache_config_dir }}/sites-enabled/000-default.conf'
+ notify:
+ - restart dashboard services
+
+- name: update apache2 configs
+ template:
+ src: openstack-dashboard.conf.j2
+ dest: '{{ apache_config_dir }}/sites-available/openstack-dashboard.conf'
+ when: ansible_os_family == 'Debian'
+ notify:
+ - restart dashboard services
+
+- name: enable dashboard
+ file:
+ src: "/etc/apache2/sites-available/openstack-dashboard.conf"
+ dest: "/etc/apache2/sites-enabled/openstack-dashboard.conf"
+ state: "link"
+ when: ansible_os_family == 'Debian'
+ notify:
+ - restart dashboard services
- name: update ubuntu horizon settings
lineinfile:
@@ -44,11 +77,15 @@
- regexp: '^OPENSTACK_HOST[ \t]*=.*'
line: 'OPENSTACK_HOST = "{{ internal_ip }}"'
when: ansible_os_family == 'Debian'
+ notify:
+ - restart dashboard services
- name: precompile horizon css
shell: /usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force
ignore_errors: True
when: ansible_os_family == 'Debian'
+ notify:
+ - restart dashboard services
- name: update redhat version horizon settings
lineinfile:
@@ -65,7 +102,7 @@
- regexp: '^OPENSTACK_HOST[ \t]*=.*'
line: 'OPENSTACK_HOST = "{{ internal_ip }}"'
when: ansible_os_family == 'RedHat'
+ notify:
+ - restart dashboard services
-- name: restart dashboard services
- service: name={{ item }} state=restarted enabled=yes
- with_items: services | union(services_noarch)
+- meta: flush_handlers