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

Hiera5 #194

Merged
merged 9 commits into from
May 25, 2017
Merged

Hiera5 #194

merged 9 commits into from
May 25, 2017

Conversation

naeem98
Copy link
Contributor

@naeem98 naeem98 commented May 10, 2017

  • Added epp for hiera 5
  • Added hiera_version, hiera5_defaults and hierarchy (Array[Hash]) for hiera5
  • hiera_version defaults to version 3
  • Added custom types for hiera5_defaults and hierarchy for hiera 5

README.md Outdated
],
}
```
# Note: For Hiera version 5 when calling the class, please remember to pass '5' to 'hiera_version' as in the example above.
Copy link
Member

Choose a reason for hiding this comment

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

this is a bit huge. Maybe we should only make it bold?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to bold

$ruby_gpg_name = 'ruby_gpg',
$ruby_gpg_version = undef,
$ruby_gpg_source = undef,
Variant[Array, Array[Hash]] $hierarchy = $::hiera::params::hierarchy,
Copy link
Member

Choose a reason for hiding this comment

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

Datatypes \o/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:)


# Determine hiera version
case $hiera_version {
'5': { if $hierarchy !~ Hiera::Hiera5_hierarchy {
Copy link
Member

Choose a reason for hiding this comment

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

there is a but much whitespace beforethe initla {, can you reformat this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed extra white spaces

@@ -0,0 +1,73 @@
<%- |
Copy link
Member

Choose a reason for hiding this comment

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

this is a huge template. Can you add some sort of tests for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrote some tests. Please take a look and let me know if you think that we should more tests.

@bastelfreak
Copy link
Member

Hi @naeem98, thanks for the great PR!

Can you please take a look at commit 650f144? It uses an email address that isn't associated with your github account.

@oranenj oranenj added enhancement New feature or request needs-tests labels May 20, 2017
context 'hiera version 5' do
let (:facts) do
{
puppetversion: Puppet.version,
Copy link
Member

Choose a reason for hiding this comment

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

can you migrate this to rspec-puppet-facts? An example is available at: https://github.com/voxpupuli/puppet-zabbix/blob/master/spec/classes/database_mysql_spec.rb#L8-L12

Feel free to join our IRC channel #voxpupuli on freenode if you've any questions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with rspec-puppet-facts. It looks good now.

@bastelfreak
Copy link
Member

You can fix probably most of the rubocop errors with:

bundle exec rubocop -c .rubocop.yml -D -S -a

@bastelfreak bastelfreak merged commit 950acd2 into voxpupuli:master May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants