Move metadata file creation for netapp to puppet-tripelo from THT

Since, openstack-glance package has been removed from overcloud image
during the cleanup, 'filesystem_store_metadata_file' file is failing to
create on host in case of glance netapp.

So, moving metadata file creation part in puppet-tripleo and setting
few more conf parameters which were missing previously. Also
merging the regular NFS and Netapp NFS mounts as the process of
mounting NFS share is independent of whether the share is for Netapp
server or any other nfs server.

Depends-on: I031a8921a74af137927ba83ee2307aafc13263cb
Depends-on: If3a0bc37fe23698b5b5730b4e535f4f56b266a75
Change-Id: I621208c2d41a1942b48d4cf92fc1aa7f4e08e1d4
This commit is contained in:
Pranali Deore 2018-08-02 09:31:05 +05:30
parent f4b4804be7
commit cf23c39254

View File

@ -189,14 +189,17 @@ conditions:
use_tls_proxy: {equals : [{get_param: EnableInternalTLS}, true]} use_tls_proxy: {equals : [{get_param: EnableInternalTLS}, true]}
glance_workers_unset: {equals : [{get_param: GlanceWorkers}, '']} glance_workers_unset: {equals : [{get_param: GlanceWorkers}, '']}
service_debug_unset: {equals : [{get_param: GlanceDebug}, '']} service_debug_unset: {equals : [{get_param: GlanceDebug}, '']}
glance_netapp_nfs_enabled: {equals : [{get_param: GlanceNetappNfsEnabled}, true]}
glance_multiple_locations: glance_multiple_locations:
and: or:
- equals: - glance_netapp_nfs_enabled
- get_param: GlanceBackend - and:
- rbd - equals:
- equals: - get_param: GlanceBackend
- get_param: NovaEnableRbdBackend - rbd
- true - equals:
- get_param: NovaEnableRbdBackend
- true
resources: resources:
@ -316,6 +319,13 @@ outputs:
- glance_workers_unset - glance_workers_unset
- {} - {}
- glance::api::workers: {get_param: GlanceWorkers} - glance::api::workers: {get_param: GlanceWorkers}
-
if:
- glance_netapp_nfs_enabled
- tripleo::profile::base::glance::netapp::netapp_share: {get_param: NetappShareLocation}
glance::api::filesystem_store_metadata_file: '/etc/glance/glance-metadata-file.json'
glance::api::filesystem_store_file_perm: '0644'
- {}
service_config_settings: service_config_settings:
fluentd: fluentd:
tripleo_fluentd_groups_glance_api: tripleo_fluentd_groups_glance_api:
@ -337,43 +347,26 @@ outputs:
glance::db::mysql::allowed_hosts: glance::db::mysql::allowed_hosts:
- '%' - '%'
- "%{hiera('mysql_bind_host')}" - "%{hiera('mysql_bind_host')}"
step_config: | step_config:
include ::tripleo::profile::base::glance::api list_join:
- "\n"
- - include ::tripleo::profile::base::glance::api
- if:
- glance_netapp_nfs_enabled
- include ::tripleo::profile::base::glance::netapp
- ''
host_prep_tasks: host_prep_tasks:
- name: Mount Netapp NFS
vars:
netapp_nfs_backend_enable: {get_param: GlanceNetappNfsEnabled}
block:
- name: Set glance remote_file_path fact
set_fact:
remote_file_path: /etc/glance/glance-metadata-file.conf
- name: Create glance remote_file_path
file:
path: "{{ remote_file_path }}"
state: touch
- stat: path="{{ remote_file_path }}"
register: file_path
- copy:
content: {"share_location" : "{{item.NETAPP_SHARE}}", "mount_point" : "/var/lib/glance/images", "type" : "nfs",}
dest: "{{ remote_file_path }}"
with_items:
- NETAPP_SHARE: {get_param: NetappShareLocation}
when:
- file_path.stat.exists == true
- name: Mount glance Netapp share
mount: name=/var/lib/glance/images src="{{item.NETAPP_SHARE}}" fstype=nfs4 opts="{{item.NFS_OPTIONS}}" state=mounted
with_items:
- NETAPP_SHARE: {get_param: NetappShareLocation}
NFS_OPTIONS: {get_param: GlanceNfsOptions}
when: netapp_nfs_backend_enable
- name: Mount NFS on host - name: Mount NFS on host
vars: vars:
nfs_backend_enabled: {get_param: GlanceNfsEnabled} nfs_backend_enabled: {get_param: GlanceNfsEnabled}
nfs_share: {get_param: GlanceNfsShare} glance_netapp_nfs_enabled: {get_param: GlanceNetappNfsEnabled}
glance_nfs_share: {get_param: GlanceNfsShare}
netapp_share_location: {get_param: NetappShareLocation}
nfs_share: "{{ glance_nfs_share if (glance_nfs_share) else netapp_share_location }}"
nfs_options: {get_param: GlanceNfsOptions} nfs_options: {get_param: GlanceNfsOptions}
mount: name=/var/lib/glance/images src="{{nfs_share}}" fstype=nfs opts="{{nfs_options}}" state=mounted mount: name=/var/lib/glance/images src="{{nfs_share}}" fstype=nfs opts="{{nfs_options}}" state=mounted
when: nfs_backend_enabled when: nfs_backend_enabled or glance_netapp_nfs_enabled
- name: Mount Node Staging Location - name: Mount Node Staging Location
vars: vars:
glance_node_staging_uri: {get_param: GlanceNodeStagingUri} glance_node_staging_uri: {get_param: GlanceNodeStagingUri}