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

Add facts, functions, tasks, plans #215

Merged
merged 6 commits into from
Oct 25, 2018
Merged

Add facts, functions, tasks, plans #215

merged 6 commits into from
Oct 25, 2018

Conversation

dylanratcliffe
Copy link

It's a big one.

New features

  • Structured facts
  • Functions for converting to and from bytes
  • Tasks for common actions that use the types and providers
  • Expand plan for one-touch expanding
  • Modified provider to allow puppet resource to work for logical_volumes

Fixes

  • Fixed issues that were causing compilation to fail in tests
  • Removed some redundant code in facts

Copy link
Contributor

@tphoney tphoney left a comment

Choose a reason for hiding this comment

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

A few minor points. Everything looks solid.

Would it be possible to clean the commits, into a task commit, cleanup commit, readme update ...

The travis tests look to be failing as well.

Kudos for the amount of work, and the quality.

@@ -287,6 +287,40 @@ parameters documented above also apply to AIX systems.
* range (Parameter) - Sets the inter-physical volume allocation policy. AIX only
* type (Parameter) - Configures the logical volume type. AIX only

## Functions

`lvm::bytes_to_size`: Converts a number of bytes to a size format that LVM can understand e.g. `lvm::bytes_to_size(214748364800)` would return `200g`
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally we do not document functions in the readme, this can be removed

Copy link
Author

Choose a reason for hiding this comment

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

Why wouldn't we document them? There aren't documented anywhere else are they?

@@ -13,9 +13,19 @@
raise ArgumentError, "Volume names must be entirely unqualified"
end
end

# This is a bit of a hack, drags the volume_group up from the provider if
# it was specified, allowing `puppet resource` and otrher things that rely
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

end

newparam(:volume_group) do
newproperty(:volume_group) do
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing this, will cause issues. It may be backwards incompatible

Copy link
Author

Choose a reason for hiding this comment

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

The problem with this being a param is that it's not possible to pull a param from puppet resource which will then cause all the tasks to fail. By definition this should have always been a property as it is able to be read back from the system and isn't just something that is provided on creation. Can we run the beaker suite or something to verify what issues it might create as this change is critical to this entire PR (except the facts)

Copy link
Author

Choose a reason for hiding this comment

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

@tphoney Any feedback on this?

@tphoney
Copy link
Contributor

tphoney commented Oct 22, 2018

👍 from me. I am just going to get another review, due to its size

@tphoney
Copy link
Contributor

tphoney commented Oct 22, 2018

@HelenCampbell @pmcmaw Can either of you have a look at this PR. Nice new functionality, great work.

@pmcmaw
Copy link
Contributor

pmcmaw commented Oct 23, 2018

Hey @dylanratcliffe

Something you may want to be aware of is that this module is currently only testing against puppet 4 in travis. I created a PR to enable puppet 5 and puppet6 however I am seeing quite a few failures. Bolt is only supported on ruby 2.3+ (2.3 is shipped with puppet5). Therefore if this PR makes use of bolt in any way the configuration is not supported and will only be supported in puppet5 and puppet6.

This is the PR I have mentioned regarding updating the testing in Travis: #216

@dylanratcliffe
Copy link
Author

@pmcmaw This PR doesn't make use of any of Bolt's libraries at all so we shouldn't (and aren't) seeing any issues with Puppet 4. All changes to the T&Ps, functions and tests are Puppet 4 compatible as we've seen in the tests and should be fine with 5 and 6 also but we'll see once that PR is merged. This PR doesn't been to be blocked by #216 does it?

@pmcmaw
Copy link
Contributor

pmcmaw commented Oct 25, 2018

@dylanratcliffe no doesn't block just something I want to ensure you were aware of.
Going to merge this, what a great PR! 👍

@pmcmaw pmcmaw merged commit 59b4813 into puppetlabs:master Oct 25, 2018
@Tardja
Copy link

Tardja commented Nov 7, 2018

I didn't find how to post comment to code. Maybe I can't do it as PR already merged.
I noticed that changes in aa5bb5c related to lib/facter/lvm_support.rb returned error that was fixed in #193:
Error: Facter: error while resolving custom facts in /var/lib/puppet/lib/facter/lvm_support.rb: execution of command "vgs -o name --noheadings 2>/dev/null" failed: command not found.

@dylanratcliffe
Copy link
Author

@Tardja I looked at that and thought the merge had worked correctly but maybe not, do you mean that the the error has now come back?

@dylanratcliffe dylanratcliffe deleted the add_facts branch November 8, 2018 05:33
@Tardja
Copy link

Tardja commented Nov 8, 2018

@dylanratcliffe, yes. I'm not good in coding. Recently updated this module from very old version and got this error. As was explained to me that vgs string not related to confine and executes even if lvm not present on host

@vchepkov
Copy link

vchepkov commented Nov 8, 2018

@dylanratcliffe , yes, code now fails on systems without LVM binaries installed.
'confine' method only affects 'setcode' method, so any code outside of 'setcode' gets executed
I put comments in an existing ticket https://tickets.puppetlabs.com/browse/MODULES-6449

cegeka-jenkins pushed a commit to cegeka/puppet-lvm that referenced this pull request Jun 4, 2020
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.

9 participants