-
Notifications
You must be signed in to change notification settings - Fork 1
/
deployOpenstackServerStatus-controller.yml
80 lines (58 loc) · 2.32 KB
/
deployOpenstackServerStatus-controller.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
---
- name: update file to controller group
any_errors_fatal: true
hosts:
- controller
tasks:
- name: update serviceAPI programe
copy: src=/ansibleProject/ansible-hii-serviceStatus/file/ dest=/var/www/cgi-bin/ mode=777
- name: sync database config to controller
template: src=/ansibleProject/ansible-hii-serviceStatus/templates/database.ini.j2 dest=/var/www/cgi-bin/database.ini mode=0777
- name: sync database config to controller
template: src=/ansibleProject/ansible-hii-serviceStatus/templates/initProjectInfo.sql.j2 dest=/var/www/cgi-bin/initProjectInfo.sql.sh mode=0777
- name: sync serviceStatus.py
template: src=/ansibleProject/ansible-hii-serviceStatus/templates/serviceStatus.py.j2 dest=/var/www/cgi-bin/serviceStatus.py mode=0777
#---------------------------------------------------------------
#create service status database on controllerVip Host
- name: install openstackServiceStatus
any_errors_fatal: true
hosts:
- controllerVip
tasks:
- name: create datebase
mysql_db:
name: openstackService
state: present
encoding: utf8
login_port: "{{ databaseInfo.mysqlPort }}"
login_user: "{{ databaseInfo.mysqlUser }}"
login_password: "{{ databaseInfo.mysqlPass }}"
# target: /var/www/cgi-bin/openstackService.sql
- name: init datebase structure
mysql_db:
name: openstackService
state: import
login_port: "{{ databaseInfo.mysqlPort }}"
login_user: "{{ databaseInfo.mysqlUser }}"
login_password: "{{ databaseInfo.mysqlPass }}"
target: /var/www/cgi-bin/openstackService.sql
- name: setup mysql user hiiservice
mysql_user:
name: hiiservice
state: present
password: hiiservice
priv: openstackService.*:ALL,GRANT
host: "{{ item }}"
# login_host: "{{ clusterInfo.HAVip }}"
login_port: "{{ databaseInfo.mysqlPort }}"
login_user: "{{ databaseInfo.mysqlUser }}"
login_password: "{{ databaseInfo.mysqlPass }}"
with_items:
- "localhost"
- "%"
#
#--------------------------------------------------------------
- name: init service plateform
shell: /var/www/cgi-bin/initProjectInfo.sql.sh
- name: update service status
shell: /var/www/cgi-bin/plan.py