aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/dashboard/tasks/main.yml
blob: 86b4f93d1f495fc3d336385c7893003c5ac6b5fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
- 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: install dashboard packages
  action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
  with_items: packages | union(packages_noarch)

- name: remove ubuntu theme
  action: "{{ ansible_pkg_mgr }} name=openstack-dashboard-ubuntu-theme state=absent"

- name: update ubuntu horizon settings
  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
  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
  service: name={{ item }} state=restarted enabled=yes
  with_items: services | union(services_noarch)