diff --git a/etc/rpc_deploy/rpc_user_config.yml.example b/etc/rpc_deploy/rpc_user_config.yml.example index 0293b4c0fc..43e5ceec3f 100644 --- a/etc/rpc_deploy/rpc_user_config.yml.example +++ b/etc/rpc_deploy/rpc_user_config.yml.example @@ -190,6 +190,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: diff --git a/rpc_deployment/playbooks/openstack/cinder-volume.yml b/rpc_deployment/playbooks/openstack/cinder-volume.yml index f01b0078a4..12118c1cba 100644 --- a/rpc_deployment/playbooks/openstack/cinder-volume.yml +++ b/rpc_deployment/playbooks/openstack/cinder-volume.yml @@ -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 diff --git a/rpc_deployment/roles/cinder_common/templates/cinder.conf b/rpc_deployment/roles/cinder_common/templates/cinder.conf index b66620b652..7f4f769158 100644 --- a/rpc_deployment/roles/cinder_common/templates/cinder.conf +++ b/rpc_deployment/roles/cinder_common/templates/cinder.conf @@ -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 %} diff --git a/rpc_deployment/roles/nfs_client/tasks/main.yml b/rpc_deployment/roles/nfs_client/tasks/main.yml new file mode 100644 index 0000000000..dba486c077 --- /dev/null +++ b/rpc_deployment/roles/nfs_client/tasks/main.yml @@ -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 diff --git a/rpc_deployment/roles/nfs_client/templates/nfs_shares.j2 b/rpc_deployment/roles/nfs_client/templates/nfs_shares.j2 new file mode 100644 index 0000000000..766e1ed63e --- /dev/null +++ b/rpc_deployment/roles/nfs_client/templates/nfs_shares.j2 @@ -0,0 +1,3 @@ +{% for share in nfs_client.shares %} +{{ share.ip }}: {{ share.share }} +{% endfor %} diff --git a/rpc_deployment/vars/repo_packages/cinder.yml b/rpc_deployment/vars/repo_packages/cinder.yml index 2f28365c2a..0f8024427d 100644 --- a/rpc_deployment/vars/repo_packages/cinder.yml +++ b/rpc_deployment/vars/repo_packages/cinder.yml @@ -44,3 +44,4 @@ container_packages: - tgt - parted - qemu-utils + - nfs-common