aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml63
1 files changed, 63 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml
new file mode 100755
index 00000000..eb6301b2
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml
@@ -0,0 +1,63 @@
+---
+#- hosts: webui
+# sudo: yes
+# tasks:
+
+- name: "enable supervisor webui"
+ file:
+ path: "/etc/init/supervisor-webui.override"
+ state: "absent"
+
+- name: "redis-setup"
+ include: -redis-setup.yml
+
+- name: "node-common"
+ include: -node-common.yml
+
+- name: "set first cassandra host address"
+ set_fact:
+ cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.0 == 0
+
+- name: "set second or more cassandra host addresses"
+ set_fact:
+ cassandra_addrs: "{{ cassandra_addrs }}, '{{ hostvars[item.1]['contrail_address'] }}'"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.0 > 0
+
+- name: "modify webui global js"
+ lineinfile:
+ dest: "/etc/contrail/config.global.js"
+ regexp: "{{ item.regexp }}"
+ line: "{{ item.line }}"
+ with_items:
+ - { regexp: "^\\s*config.networkManager.ip", line: "config.networkManager.ip = '{{ contrail_haproxy_address }}';" }
+ - { regexp: "^\\s*config.imageManager.ip", line: "config.imageManager.ip = '{{ contrail_keystone_address }}';" }
+ - { regexp: "^\\s*config.computeManager.ip", line: "config.computeManager.ip = '{{ contrail_keystone_address }}';" }
+ - { regexp: "^\\s*config.identityManager.ip", line: "config.identityManager.ip = '{{ contrail_keystone_address }}';" }
+ - { regexp: "^\\s*config.storageManager.ip", line: "config.storageManager.ip = '{{ contrail_keystone_address }}';" }
+ - { regexp: "^\\s*config.cnfg.server_ip", line: "config.cnfg.server_ip = '{{ contrail_haproxy_address }}';" }
+ - { regexp: "^\\s*config.analytics.server_ip", line: "config.analytics.server_ip = '{{ contrail_haproxy_address }}';" }
+ - { regexp: "^\\s*config.cassandra.server_ips", line: "config.cassandra.server_ips = [{{ cassandra_addrs }}];" }
+
+- name: "modify webui userauth js"
+ lineinfile:
+ dest: "/etc/contrail/contrail-webui-userauth.js"
+ regexp: "{{ item.regexp }}"
+ line: "{{ item.line }}"
+ with_items:
+ - { regexp: "^\\s*auth.admin_user", line: "auth.admin_user = '{{ contrail_admin_user }}';" }
+ - { regexp: "^\\s*auth.admin_password", line: "auth.admin_password = '{{ contrail_admin_password }}';" }
+ - { regexp: "^\\s*auth.admin_tenant_name", line: "auth.admin_tenant_name = 'admin';" }
+
+- name: "create symbolic link from nodejs to node"
+ file:
+ src: "/usr/bin/node"
+ dest: "/usr/bin/nodejs"
+ state: "link"
+
+- name: "restart supervisor webui"
+ service:
+ name: "supervisor-webui"
+ state: "restarted"