Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES-3230) Add flag to Logical_volume to not resize filesystem #151

Merged
merged 1 commit into from
Apr 11, 2016

Conversation

ssgelm
Copy link
Contributor

@ssgelm ssgelm commented Apr 7, 2016

Currently changing the size of a logical volume using the lvm provider on our Xen dom0 causes issues for us because the volume is exposed to a vm and is mounted there but the volume does not appear mounted to the host. Therefore, resize2fs tries to do an offline resize on the volume which causes issues. This adds a "resize_fs" flag to the logical_volume type that, when set to false, will not attempt that resize.

@ssgelm
Copy link
Contributor Author

ssgelm commented Apr 7, 2016

I will fix the failing test and also add new tests for this.

@ssgelm
Copy link
Contributor Author

ssgelm commented Apr 7, 2016

Tests added

xfs_growfs( path) || fail( "Cannot resize filesystem to size #{new_size} because xfs_growfs failed." )
elsif blkid_type =~ /\bTYPE=\"(swap)\"/
swapoff( path) && mkswap( path) && swapon( path) || fail( "Cannot resize swap to size #{new_size} because mkswap failed." )
unless @resource[:resize_fs] == :false or @resource[:resize_fs] == false or @resource[:resize_fs] == 'false'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One ruby shortcut for this is unless [false, :false, 'false'].include?(@resource[:resize_fs])

@hunner hunner merged commit dcf5290 into puppetlabs:master Apr 11, 2016
@hunner
Copy link
Contributor

hunner commented Apr 11, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants