Depends-On: I8ec359f5c65c957064a39b75b9c3ea3d3a9d9e89 Depends-On: I2d49b6802d8cf99f6d7ac74ae4ce0ab8f6d1c7a5 Depends-On: I0e77423a1f28d9a53215ae68c1f9f3e2af00f340 Depends-On: I621660f39c4e51db4b8063feee782aae5cd16840 Change-Id: I01df855d8b9255d24efe16ab053ffa491fda351f
47 lines
1.3 KiB
YAML
47 lines
1.3 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: nova_compute
|
|
user: root
|
|
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"
|