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

Fix manage_service_file variable #309

Merged
merged 2 commits into from
May 10, 2019

Conversation

CallumBanbery
Copy link
Contributor

@CallumBanbery CallumBanbery commented Apr 24, 2019

Pull Request (PR) description

The manage_service_file is configured incorrectly and doesn't
allow for overriding the value with hieradata. Updaing the init.pp
class params allows the file to be passed in.

This Pull Request (PR) fixes the following issues

Fixes #308
Fixes #310

@alexjfisher
Copy link
Member

I think this is fixing a bug, but also changing the default behaviour?

Currently $::redis::manage_service_file doesn't exist (that's gotta be a bug).

manage_service_file => $::redis::manage_service_file,

ie we end up with

redis::instance {'default':
  manage_service_file => undef,
  ...
}

This should result in the default value of true being used?

$manage_service_file = true,

With this change, we will now correctly use the value from params.pp, but unfortunately that's a different default. Does this need to be updated too?

Are you able to add some spec tests to prove/disprove what's actually happening?

@alexjfisher
Copy link
Member

Correction, your change is correct. I didn't notice that init.pp inherits::params. This means that $::redis::manage_service_file does exist (and is false not undef).

All the same, do you think you'd be able to add a spec test for the manage_service_file parameter?

The manage_service_file is configured incorrectly and doesn't
allow for overriding the value with hieradata.  Updaing the init.pp
class params allows the file to be passed in.
@CallumBanbery CallumBanbery force-pushed the bug_manage_service_file branch 13 times, most recently from 5858ca1 to 30f9b8c Compare May 9, 2019 15:30
@CallumBanbery
Copy link
Contributor Author

CallumBanbery commented May 9, 2019

@alexjfisher I've added tests for having the manage_service_file set to false and true.
The only thing that's strange is passing in the service_provider value. I tried passing it in the params but it didn't work.
e.g. (Didn't work)

let(:params) do
  {
    manage_service_file: true,
    service_provider: 'systemd'
  }
end

But passing the value in as a fact and it's fine.

let(:facts) do
merged_facts = facts.merge(redis_server_version: '3.2.3')
if facts[:operatingsystem].casecmp('archlinux') == 0
merged_facts = merged_facts.merge(service_provider: 'systemd')
end
merged_facts
end

I just don't know why that's required as it should really work from params because it's a class parameter.

Fixes voxpupuli#308
Fixes voxpupuli#310

The manage_service_file is configured incorrectly and doesn't
allow for overriding the value with hieradata.  Updaing the init.pp
class params allows the file to be passed in.

The filename for the systemd default service was incorrectly set
as the variable is undefined.
@dhoppe
Copy link
Member

dhoppe commented May 10, 2019

@CallumBanbery Thank you very much for your contribution.

@dhoppe dhoppe merged commit d0ee587 into voxpupuli:master May 10, 2019
@CallumBanbery CallumBanbery deleted the bug_manage_service_file branch May 14, 2019 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix systemd service filename Fix manage_service_file variable
3 participants