openstack-ansible-os_nova/tests/test-create-zfs-dev.yml

49 lines
1.4 KiB
YAML

---
# Copyright 2018, BBC R&D
#
# 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.
- name: Configure ZFS backing storage
hosts: localhost
user: root
become: true
connection: local
tasks:
- block:
- name: Install ZFS packages
package:
name: "{{ zfs_package[ansible_distribution | lower] }}"
state: present
- name: Create base directories
file:
path: "{{ item }}"
state: "directory"
with_items:
- /openstack
- name: Create sparse ZFS backing file
command: "truncate -s 1024G /openstack/nova-lxd-zfs.img"
args:
creates: /openstack/nova-lxd-zfs.img
register: lxc_zfs_create
- name: Create the ZFS pool
command: zpool create default /openstack/nova-lxd-zfs.img
args:
creates: /default
vars:
zfs_package:
ubuntu: "zfsutils-linux"