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 ubuntu 18.04 support #130

Merged

Conversation

cliff-wakefield
Copy link

Under Ubuntu 18.04 it appears the SNMP user and group have changed.

Error: Could not find user snmp
Error: /Stage[main]/Snmp/File[var-net-snmp]/owner: change from 'Debian-snmp' to 'snmp' failed: Could not find user snmp
Error: Could not find group snmp
Error: /Stage[main]/Snmp/File[var-net-snmp]/group: change from 'Debian-snmp' to 'snmp' failed: Could not find group snmp
Notice: /Stage[main]/Snmp/Service[snmpd]: Dependency File[var-net-snmp] has failures: true
Warning: /Stage[main]/Snmp/Service[snmpd]: Skipping because of failed dependencies

This request simply adds a condition to set the user and group correctly in params.pp

@cliff-wakefield
Copy link
Author

I have no idea why the individual test is failing.

I can't be because of the 4 lines I've added, or at least I can't see how it could be??

Any ideas?

@elfrinjo
Copy link

elfrinjo commented Sep 3, 2018

Hi, there is a missing space between 'Ubuntu' and and

@cliff-wakefield
Copy link
Author

Ok fixed the space, but the tests still fail.

I also created another fork with a change to just the README it still fails the same test, with no actual code change.

@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet labels Sep 14, 2018
@bastelfreak
Copy link
Member

Hi @cliff-wakefield, thanks for the PR! Can you please rebase against our latest master? That will pull in #134. Please add Ubuntu 18.04 to our metadata.json.

@@ -473,6 +473,9 @@
if $::operatingsystem == 'Debian' and $::operatingsystemmajrelease >= '9' {
$varnetsnmp_owner = 'Debian-snmp'
$varnetsnmp_group = 'Debian-snmp'
} elsif $::operatingsystem == 'Ubuntu' and $::operatingsystemmajrelease >= '18.04' {
Copy link
Member

Choose a reason for hiding this comment

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

Those facts are legacy and we try to get rid of them in new code + migrate the existing codebase in parallel. Can you please use $facts['os']['name'] and $facts['os']['release']['major']?


The tests will fail with that, can you please add a rspec-puppet-facts based test for this?

Copy link
Author

Choose a reason for hiding this comment

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

I have rebased to master, I have updated the metadata.

Copy link
Author

Choose a reason for hiding this comment

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

Switching params.pp to use the facts hash is much larger change, that may well need doing but is larger in scope than just adding Ubuntu 18.04 support.

@bastelfreak
Copy link
Member

I did some inline comments. Let us know if you've got any questions. You can reply here or reach out to us on our IRC channel #voxpupuli on freenode or https://puppetcommunity.slack.com

@bastelfreak bastelfreak changed the title Fix/support ubuntu 18 04 Add ubuntu 18.04 support Sep 14, 2018
@cliff-wakefield
Copy link
Author

Looking at the code again the fix done under PR #134 fixes the issue I believe anyway as it now numerically compares the versions of Ubuntu so I don't think this PR is needed?

@bastelfreak
Copy link
Member

It only compares the Debian version at the moment, right?

@rogermartensson
Copy link

rogermartensson commented Oct 3, 2018

I just did a test on the changed line in params.pp in PR #134.

if $::operatingsystem == 'Debian' and versioncmp($::operatingsystemmajrelease, '9') >= 0 {

It didn't work for me.
If it was to work then it probably would trigger for Ubuntu older than 18.04. Would that make installation these older versions fail?

So I guess there is a need to test for Ubuntu 18.04. Maybe converts the number test to use versioncmp and in the PR. Then Travis might be more happy?

@ekohl
Copy link
Member

ekohl commented Oct 3, 2018

Could you rebase this? There are a lot of irrelevant changes from master in this PR that make it hard to see your changes.

@cliff-wakefield
Copy link
Author

cliff-wakefield commented Oct 22, 2018

@ekohl rebased and standardised the Operating systems version test using versioncmp.

@alexjfisher
Copy link
Member

Can this also be squashed before merge?

@alexjfisher alexjfisher force-pushed the fix/support_ubuntu_18_04 branch from fb7e12a to 34828b6 Compare October 23, 2018 07:44
@alexjfisher alexjfisher removed needs-rebase needs-work not ready to merge just yet labels Oct 23, 2018
@alexjfisher alexjfisher force-pushed the fix/support_ubuntu_18_04 branch from 34828b6 to 7ab970b Compare October 23, 2018 07:46
@alexjfisher alexjfisher merged commit 4345049 into voxpupuli:master Oct 23, 2018
@amateo
Copy link
Contributor

amateo commented Nov 23, 2018

I think this issue is related in #168

@cliff-wakefield cliff-wakefield deleted the fix/support_ubuntu_18_04 branch November 23, 2018 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants