-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonasca-post-upgrade.yml
113 lines (107 loc) · 3.67 KB
/
monasca-post-upgrade.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
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: FND-KFK:MON-API:MON-PST:MON-THR
vars_files:
- roles/monasca-variables/vars/{{ ansible_os_family | lower }}.yml
tasks:
- name: monasca-post-upgrade | Remove OS specific packages
become: yes
package:
name: "{{ item }}"
state: absent
with_items: monasca_post_upgrade_cleanup
- name: Stop monasca-api
hosts: MON-API
become: yes
tags: [monasca-api]
vars:
run_mode: Stop
vars_files:
- roles/monasca-variables/vars/configuration.yml
- roles/monasca-variables/defaults/main.yml
roles:
- {role: monasca-api, tags: [monasca-api]}
- name: Start monasca-api
hosts: MON-API
become: yes
tags: [monasca-api]
vars:
run_mode: Start
vars_files:
- roles/monasca-variables/vars/configuration.yml
- roles/monasca-variables/defaults/main.yml
roles:
- {role: monasca-api, tags: [monasca-api]}
- name: Delete Alarms for Old Storm Version
hosts: MON-API
tags: [alarms]
vars_files:
- roles/monasca-variables/vars/configuration.yml
- roles/monasca-variables/defaults/main.yml
- roles/monasca-default-alarms/defaults/main.yml
- roles/monasca-api/defaults/main.yml
roles:
- { role: monasca-alarm-definition }
tasks:
- name: start | wait for api port
wait_for: port={{monasca_api_client_port}} host={{monasca_api_bind_host | default('127.0.0.1') }} state=started timeout={{ monasca_wait_for_period }}
when: verify
- name: Clean up old Storm Alarms
monasca_alarm_cleanup:
alarm_definition_name: "Process Check"
metric_dimensions:
process_name: "backtype.storm.daemon.nimbus|backtype.storm.daemon.supervisor|backtype.storm.daemon.worker"
keystone_url: "{{ monasca_keystone_url }}"
keystone_user: "{{ monasca_keystone_user }}"
keystone_password: "{{ monasca_keystone_password }}"
keystone_project: "{{ monasca_keystone_project }}"
keystone_project_domain: "{{ monasca_keystone_project_domain }}"
keystone_user_domain: "{{ monasca_keystone_user_domain }}"
monasca_api_url: "{{ monasca_api_url }}"
run_once: True
register: alarm_cleanup_result
until: not alarm_cleanup_result | failed
retries: "{{ monasca_client_retries }}"
delay: "{{ monasca_client_retry_delay }}"
- hosts: all:!MON-API--first-member
tags: [alarms]
tasks:
- name: cleanup | Remove old VM alarm cleanup from crontab
cron:
name: "Alarm cleanup for deleted VMs"
minute: "*/5"
job: "/opt/monasca/bin/vm_alarm_cleanup"
state: absent
become: yes
- name: cleanup | Remove old VM alarm cleanup cron job file
file:
src: vm_alarm_cleanup.j2
dest: /opt/monasca/bin/vm_alarm_cleanup
state: absent
become: yes
- hosts: all
tags: [monasca-schema-mysql, monasca-schema]
vars_files:
- roles/monasca-schema/defaults/main.yml
tasks:
- name: monasca-schema | mysql | remove temporary files
file:
dest: "{{ item }}"
state: absent
with_items:
- "{{ monasca_script_file }}"
- "{{ monasca_schema_file }}"