-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathsite-upgrade.yml
88 lines (88 loc) · 3.11 KB
/
site-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
#
# goto group_vars/all file and following properties:
# New repositories:
# mapr_release_url: http://package.mapr.com/releases/v5.2.1
# mapr_ecosystem_url: http://package.mapr.com/releases/MEP/MEP-3.0.0/
#
#
# Force restarts and reconfigure:
# force_zookeeper_restart: true
# force_warden_restart: true
# force_reconfigure_sh: true
# spyglass_elasticsearch_secure: false # does not work with true during upgrade.
#
---
- name: Preparation for node for rolling upgrade
hosts: mapr-core
tasks:
- name: Backup MapR configuration files
archive: path=/opt/mapr/conf dest="/opt/maprconf-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
# - name: Failover master containers to other nodes
# shell: "maprcli node failover -nodes {{ ansible_fqdn }}"
# when: rolling_upgrade is defined and rolling_upgrade
# environment:
# MAPR_TICKETFILE_LOCATION: /opt/mapr/conf/mapruserticket
- name: Stop CLDB
hosts: mapr-cldb
tasks:
- name: Stop CLDB
shell: "maprcli node services -cldb stop -nodes {{ ansible_fqdn }}"
when: rolling_upgrade is defined and rolling_upgrade
environment:
MAPR_TICKETFILE_LOCATION: /opt/mapr/conf/mapruserticket
- pause: seconds=10
when: rolling_upgrade is defined and rolling_upgrade
#- name: Set node to maintenance mode
# hosts: mapr-core
# tasks:
# - name: Set node to maintenance mode
# shell: "maprcli node maintenance -nodes {{ ansible_fqdn }} -timeoutminutes 60"
# when: rolling_upgrade is defined and rolling_upgrade
# environment:
# MAPR_TICKETFILE_LOCATION: /opt/mapr/conf/mapruserticket
- name: Stop Warden
hosts: mapr-core
tasks:
- name: Stop MapR Warden
service: name=mapr-warden state=stopped
- name: Stop Zookeeper
hosts: mapr-zookeeper
tasks:
- name: Stop Zookeeper
service: name=mapr-zookeeper state=stopped
- name: Setup MapR repositories
hosts: mapr-core
roles:
- mapr-configure-repository
- name: Setup MapR repositories
hosts: mapr-core
tasks:
- name: Retrieve installed packages
shell: 'rpm -qa --qf "%{NAME}\n" | grep mapr | grep -v mapr-mapreduce1'
register: rpm_mapr_packages
- name: Split list
set_fact: installed_packages="{{ rpm_mapr_packages.stdout.split('\n') }}"
- name: Upgrade MapR packages
hosts: mapr-core
tasks:
- name: Upgrade MapR packages
package: name="{{ item | trim }}" state=latest
with_items: "{{ installed_packages }}"
# - package: name=mapr-mapreduce1 state=absent
- import_playbook: site-cluster.yml
- name: Update version in MapR config
hosts: mapr-cldb[0]
tasks:
- name: Upgrade version in configs
shell: 'maprcli config save -values {"mapr.targetversion":"`cat /opt/mapr/MapRBuildVersion`"}'
environment:
MAPR_TICKETFILE_LOCATION: /opt/mapr/conf/mapruserticket
when: rolling_upgrade is undefined or not rolling_upgrade
# - name: Disable maintenance mode
# hosts: mapr-core
# tasks:
# - name: Disable maintenance mode
# shell: "maprcli node maintenance -nodes {{ ansible_fqdn }} -timeoutminutes 0"
# when: rolling_upgrade is defined and rolling_upgrade
# environment:
# MAPR_TICKETFILE_LOCATION: /opt/mapr/conf/mapruserticket