NFS client configuration for cinder

This change adds the NFS client configuration in the cinder_volume hosts,
necessary when using a netapp backend over NFS.
This commit is contained in:
Miguel Grinberg 2014-11-17 16:23:09 -08:00
parent b7e1483aea
commit ed15550a14
6 changed files with 34 additions and 0 deletions

View File

@ -188,6 +188,10 @@ storage_hosts:
netapp_password: "{{ cinder_netapp_password }}"
volume_driver: cinder.volume.drivers.netapp.common.NetAppDriver
volume_backend_name: NETAPP_iSCSI
nfs_client:
nfs_shares_config: /etc/cinder/nfs_shares
shares:
- { ip: "{{ cinder_netapp_hostname }}", share: "/vol/cinder" }
# User defined Logging Hosts, this should be a required group
log_hosts:

View File

@ -16,14 +16,17 @@
- hosts: cinder_volume
user: root
roles:
- container_common
- container_extra_setup
- cinder_common
- cinder_volume
- cinder_device_add
- cinder_backend_types
- nfs_client
- init_script
vars_files:
- vars/config_vars/container_config_cinder_volume.yml
- vars/openstack_service_vars/cinder_volume.yml
- vars/repo_packages/cinder.yml
handlers:
- include: handlers/services.yml

View File

@ -52,6 +52,9 @@ enabled_backends={% for backend in cinder_backends|dictsort %}{{ backend.0 }}{%
{% for key, value in backend_section.1.items() %}
{{ key }}={{ value }}
{% endfor %}
{% if nfs_client is defined %}
nfs_shares_config={{ nfs_client.nfs_shares_config }}
{% endif %}
{% endfor %}
{% endif %}

View File

@ -0,0 +1,20 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# 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: Create nfs_shares file
template:
src=nfs_shares.j2
dest="{{ nfs_client.nfs_shares_config }}"
when: nfs_client is defined

View File

@ -0,0 +1,3 @@
{% for share in nfs_client.shares %}
{{ share.ip }}: {{ share.share }}
{% endfor %}

View File

@ -44,3 +44,4 @@ container_packages:
- tgt
- parted
- qemu-utils
- nfs-common