From 82f2f4b5faefd8a6e3fe6ad92fb0f35f69a02f5b Mon Sep 17 00:00:00 2001 From: Lnic Date: Thu, 19 Nov 2015 12:13:34 +0100 Subject: [PATCH] Update plugin to solve problem relative to TestVM image when we get multiple controllers Change-Id: I9549b9391ccb1f0d49fced0e881646b732473e57 --- README.md | 5 +- deployment_scripts/puppet/delete.pp | 4 ++ .../modules/glance_nfs/manifests/init.pp | 29 +++----- deployment_scripts/puppet/site.pp | 4 +- deployment_scripts/puppet/upload.pp | 2 + metadata.yaml | 66 +++++++++---------- tasks.yaml | 31 ++++++--- 7 files changed, 77 insertions(+), 64 deletions(-) create mode 100644 deployment_scripts/puppet/delete.pp create mode 100644 deployment_scripts/puppet/upload.pp diff --git a/README.md b/README.md index 36de001..7145b31 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Glance-nfs plugin installation 7. Verify that the plugin is installed correctly: ``fuel plugins --list`` - + 8. Plugin is ready to use and can be enabled on the Settings tab of the Fuel web UI. User Guide @@ -113,4 +113,7 @@ Release Notes * Update plugin to Fuel 7.0 release +**3.0.1** + +* Update to solve problem with TestVM image on multi controller deployment diff --git a/deployment_scripts/puppet/delete.pp b/deployment_scripts/puppet/delete.pp new file mode 100644 index 0000000..1c69d34 --- /dev/null +++ b/deployment_scripts/puppet/delete.pp @@ -0,0 +1,4 @@ + # have to find a better way to do this, if we can execute plugin before upload_cirros task we don't need this anymore + exec{ "image-delete": + command => "/bin/bash -c 'source /root/openrc && /usr/bin/glance image-delete TestVM'", + } \ No newline at end of file diff --git a/deployment_scripts/puppet/modules/glance_nfs/manifests/init.pp b/deployment_scripts/puppet/modules/glance_nfs/manifests/init.pp index 5c8ae12..0301c52 100644 --- a/deployment_scripts/puppet/modules/glance_nfs/manifests/init.pp +++ b/deployment_scripts/puppet/modules/glance_nfs/manifests/init.pp @@ -3,13 +3,7 @@ $nfs_volume_for_glance, $nfs_mount_point_glance, ){ include glance_nfs::params - - # have to find a better way to do this, if we can execute plugin before upload_cirros task we don't need this anymore - exec{ "image-delete": - command => "/bin/bash -c 'source /root/openrc && /usr/bin/glance image-delete TestVM | exit 0'", - before => Package["$glance_nfs::params::package_name"], - } - + # Install package and start services package { $glance_nfs::params::package_name: ensure => present, @@ -17,6 +11,7 @@ $nfs_mount_point_glance, package { $glance_nfs::params::required_packages: ensure => present, + before => Mount["$nfs_mount_point_glance"], } service { $glance_nfs::params::service_name: @@ -32,21 +27,21 @@ $nfs_mount_point_glance, glance_api_config { 'glance_store/default_store': value => 'file'; 'glance_store/filesystem_store_datadir': value => "${nfs_mount_point_glance}/images"; - 'glance_store/stores': value => 'file'; + 'glance_store/stores': value => 'file'; }~> Service["$::glance_nfs::params::service_name"] - + glance_cache_config { 'DEFAULT/filesystem_store_datadir': value => $nfs_mount_point_glance; }~> Service["$::glance_nfs::params::service_name"] # Create Mount Point exec{ "/bin/mkdir -p $nfs_mount_point_glance": - unless => "/usr/bin/test -d $nfs_mount_point_glance", - before => Mount["$nfs_mount_point_glance"], + unless => "/usr/bin/test -d $nfs_mount_point_glance", + before => Mount["$nfs_mount_point_glance"], } - - - # Mount NFS Share + + + # Mount NFS Share mount { "$nfs_mount_point_glance": atboot => true, ensure => mounted, @@ -62,7 +57,7 @@ $nfs_mount_point_glance, exec{ "/bin/chmod 775 $nfs_mount_point_glance": require => Mount["$nfs_mount_point_glance"], } - + exec{ "/bin/mkdir -p ${$nfs_mount_point_glance}/images": unless => "/usr/bin/test -d ${$nfs_mount_point_glance}/images", require => Mount["$nfs_mount_point_glance"], @@ -75,8 +70,4 @@ $nfs_mount_point_glance, notify => Service["$::glance_nfs::params::service_name"], } - exec{ "/usr/bin/ruby /etc/puppet/modules/osnailyfacter/modular/astute/upload_cirros.rb": - require => Exec["/bin/chmod 775 ${$nfs_mount_point_glance}/images"], - } - } diff --git a/deployment_scripts/puppet/site.pp b/deployment_scripts/puppet/site.pp index a280848..cc09167 100644 --- a/deployment_scripts/puppet/site.pp +++ b/deployment_scripts/puppet/site.pp @@ -1,5 +1,5 @@ $fuel_settings = parseyaml(file('/etc/astute.yaml')) class { 'glance_nfs': - nfs_volume_for_glance => $fuel_settings['glance_nfs']['nfs_volume_for_glance'], - nfs_mount_point_glance => $fuel_settings['glance_nfs']['nfs_mount_point_glance'], + nfs_volume_for_glance => $fuel_settings['glance_nfs']['nfs_volume_for_glance'], + nfs_mount_point_glance => $fuel_settings['glance_nfs']['nfs_mount_point_glance'], } \ No newline at end of file diff --git a/deployment_scripts/puppet/upload.pp b/deployment_scripts/puppet/upload.pp new file mode 100644 index 0000000..480fc1f --- /dev/null +++ b/deployment_scripts/puppet/upload.pp @@ -0,0 +1,2 @@ + exec{ "/usr/bin/ruby /etc/puppet/modules/osnailyfacter/modular/astute/upload_cirros.rb": + } \ No newline at end of file diff --git a/metadata.yaml b/metadata.yaml index 5e08857..3a9af58 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,33 +1,33 @@ -# Plugin name -name: glance_nfs -title: Glance NFS plugin -# Plugin version -version: 3.0.0 -# Description -description: Enables Glance to use NFS volume as storage backend for images -# Required fuel version -fuel_version: ['7.0'] -# Specify license of your plugin -licenses: ['Apache License Version 2.0'] -# Specify author or company name -authors: ['Orange'] -# A link to the plugin's page -homepage: 'https://github.com/stackforge/fuel-plugin-glance-nfs' -# Specify a group which your plugin implements, possible options: -# network, storage, storage::cinder, storage::glance, hypervisor -groups: ['storage::glance'] - -# The plugin is compatible with releases in the list -releases: - - os: ubuntu - version: 2015.1.0-7.0 - mode: ['ha', 'multinode'] - deployment_scripts_path: deployment_scripts/ - repository_path: repositories/ubuntu - - os: centos - version: 2015.1.0-7.0 - mode: ['ha', 'multinode'] - deployment_scripts_path: deployment_scripts/ - repository_path: repositories/centos -# Version of plugin package -package_version: '2.0.0' +# Plugin name +name: glance_nfs +title: Glance NFS plugin +# Plugin version +version: 3.0.1 +# Description +description: Enables Glance to use NFS volume as storage backend for images +# Required fuel version +fuel_version: ['7.0'] +# Specify license of your plugin +licenses: ['Apache License Version 2.0'] +# Specify author or company name +authors: ['Orange'] +# A link to the plugin's page +homepage: 'https://github.com/stackforge/fuel-plugin-glance-nfs' +# Specify a group which your plugin implements, possible options: +# network, storage, storage::cinder, storage::glance, hypervisor +groups: ['storage::glance'] + +# The plugin is compatible with releases in the list +releases: + - os: ubuntu + version: 2015.1.0-7.0 + mode: ['ha', 'multinode'] + deployment_scripts_path: deployment_scripts/ + repository_path: repositories/ubuntu + - os: centos + version: 2015.1.0-7.0 + mode: ['ha', 'multinode'] + deployment_scripts_path: deployment_scripts/ + repository_path: repositories/centos +# Version of plugin package +package_version: '2.0.0' diff --git a/tasks.yaml b/tasks.yaml index 14ff9fb..7af47fb 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -1,9 +1,22 @@ -# This task is required for controller nodes -- role: ['primary-controller', 'controller'] - stage: post_deployment/700 - required_for: [upload_cirros] - type: puppet - parameters: - puppet_manifest: puppet/site.pp - puppet_modules: "puppet/modules/:/etc/puppet/modules/" - timeout: 360 +# This task is required for controller nodes +- role: ['primary-controller'] + stage: post_deployment/700 + type: puppet + parameters: + puppet_manifest: puppet/delete.pp + puppet_modules: "puppet/modules/:/etc/puppet/modules/" + timeout: 360 +- role: ['primary-controller', 'controller'] + stage: post_deployment/800 + type: puppet + parameters: + puppet_manifest: puppet/site.pp + puppet_modules: "puppet/modules/:/etc/puppet/modules/" + timeout: 360 +- role: ['primary-controller'] + stage: post_deployment/1000 + type: puppet + parameters: + puppet_manifest: puppet/upload.pp + puppet_modules: "puppet/modules/:/etc/puppet/modules/" + timeout: 360