blob: 429adff3273df0ff3128ec7b4294062cdaaf57d0 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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: metrics
become: yes
tasks:
- name: "stop influxdb and grafana"
service: name={{ item }} state=stopped
with_items:
- influxdb
- grafana-server
- name: "wipe influxdb data"
file: path={{ default_data_dirs[0] }}/influxdb state=absent
- name: "wipe grafana db"
file: path=/var/lib/grafana/grafana.db state=absent
- import_playbook: wipe-systemd.yml
when: use_systemd == True
- import_playbook: kill.yml
- hosts: all
tasks:
- name: "wipe software installation dirs"
file: path={{ item }} state=absent
with_items:
- "{{ hadoop_home }}"
- "{{ zookeeper_home }}"
- "{{ accumulo_home }}"
- "{{ fluo_home }}"
- "{{ spark_home }}"
- "{{ maven_home }}"
- "{{ hub_home }}"
- "{{ fluo_yarn_home }}"
- hosts: hadoop
tasks:
- name: "wipe hadoop data"
file: path={{item}}/hadoop state=absent
with_items: "{{ worker_data_dirs }}"
when: cluster_type != 'azure'
- name: "remove hadoop logs"
shell: rm -rf {{ hadoop_home }}/logs/*
when: cluster_type != 'azure'
- hosts: zookeepers
tasks:
- name: "wipe zookeeper data"
file: path={{ default_data_dirs[0] }}/zookeeper state=absent
when: cluster_type != 'azure'
- name: "remove zookeeper logs"
file: path={{ zookeeper_home }}/zookeeper.out state=absent
when: cluster_type != 'azure'
- hosts: accumulo
tasks:
- name: "remove accumulo logs"
shell: rm -rf {{ accumulo_home }}/logs/*
when: cluster_type != 'azure'
# Using rm -rf instead of Ansible file module to remove multiple levels of subfolder
- hosts: all
tasks:
- name: "wipe data and log directories for Azure"
shell: rm -rf {{ item }}/*
loop:
"{{ worker_data_dirs }}"
when: cluster_type == 'azure'