This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
/
tripleo-ui.yml
125 lines (110 loc) · 4.79 KB
/
tripleo-ui.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
- name: ensure the tripleo_ui_config.js file exists
stat:
path: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
register: ooo_ui_config_file
- when:
- enable_port_forward_for_tripleo_ui|bool
- hostvars[groups['virthost'][0]].ansible_host is defined
- tripleo_ui_secure_access|bool == false
- ooo_ui_config_file.stat.exists
block:
- name: get the heat public url
shell: |
source {{ working_dir }}/stackrc
openstack catalog show heat --format value | grep public | awk -F '/' '{print $5}'
register: heat_public_url
- name: get the swift public url
shell: |
source {{ working_dir }}/stackrc
openstack catalog show swift --format value | grep public | awk -F '/' '{print $5}'
register: swift_public_url
- name: update the keystone config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'keystone':"
line: " 'keystone': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:5000/v3/',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
when: release in ['master', 'pike']
- name: update the keystone config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'keystone':"
line: " 'keystone': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:5000/v2/',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
when: release not in ['master', 'pike']
- name: update the heat config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'heat':"
line: " 'heat': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:8004/v1/{{ heat_public_url.stdout }}',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: update the ironic config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'ironic':"
line: " 'ironic': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:6385',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: update the ironic-inspector config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'ironic-inspector':"
line: " 'ironic-inspector': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:5050',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: update the mistral config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'mistral':"
line: " 'mistral': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:8989/v2',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: update the swift config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'swift':"
line: " 'swift': 'http://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:8080/v1/{{ swift_public_url.stdout }}',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: update the zaqar-websocket config in tripleo_ui_config.js, connect via virthost ip
lineinfile:
regexp: "'zaqar-websocket':"
line: " 'zaqar-websocket': 'ws://{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}:9000',"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: restart the httpd service
service:
name: httpd
state: restarted
become: true
- when:
- enable_port_forward_for_tripleo_ui|bool
- hostvars[groups['virthost'][0]].ansible_host is defined
- tripleo_ui_secure_access|bool
- ooo_ui_config_file.stat.exists
block:
- name: update config in tripleo_ui_config.js, connect via virthost ip with ssl
replace:
regexp: \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}
replace: "{{hostvars[groups['virthost'][0]].ansible_default_ipv4.address}}"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
- name: update config in tripleo_ui_config.js, for keystone v3
replace:
regexp: keystone\/v2.0
replace: "keystone/v3"
dest: /var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js
backup: yes
become: true
when: release in ['master', 'pike']
- name: restart the httpd service
service:
name: httpd
state: restarted
become: true