blob: 4f3c3157ba950f9059f07c523874c1fe0c76cf5c [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.
#
- name: "unmount default drive at /mnt"
mount: name=/mnt src=/dev/xvdb fstype=auto state=unmounted
when: cluster_type == 'ec2'
- name: "unmount all ephemeral"
mount: name={{ item.0 }} src={{ item.1 }} fstype=auto state=unmounted
when: cluster_type == 'ec2' and force_format == 'yes'
with_together:
- "{{ node_type_map[node_type].mounts }}"
- "{{ node_type_map[node_type].devices }}"
- name: "format drives"
filesystem: fstype={{ fstype }} dev={{ item }} force={{ force_format }}
when: cluster_type == 'ec2'
with_items: "{{ node_type_map[node_type].devices }}"
- name: "mount drives"
mount: name={{ item.0 }} src={{ item.1 }} fstype=auto state=mounted
opts=defaults,nofail,noatime,nodiratime,comment=cloudconfig passno=2
when: cluster_type == 'ec2'
with_together:
- "{{ node_type_map[node_type].mounts }}"
- "{{ node_type_map[node_type].devices }}"
- name: "ensure drives are owned by cluster user"
file: path={{ item }} state=directory owner={{ cluster_user }} group={{ cluster_user }}
with_items: "{{ node_type_map[node_type].mounts }}"