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

rw and ro community strings wrong and default breaks rhel7 if ipv6 off #218

Open
azidblazer opened this issue Mar 30, 2020 · 0 comments
Open

Comments

@azidblazer
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.4.2
    pe-puppet-enterprise-release-2019.1.0.2-1.pe.el7.noarch
    pe-puppetdb-termini-6.3.2-1.el7.noarch
    puppet6-release-6.0.0-5.el7.noarch
    puppet-agent-6.4.2-1.el7.x86_64
    pe-puppetdb-6.3.2-1.el7.noarch
    pe-puppetserver-2019.1.0.67-1.el7.noarch

  • Ruby:

  • Distribution: Redhat

  • Module version: Latest

How to reproduce (e.g Puppet code you use)

See below

What are you seeing

Incorrect statement in code at
templates/snmpd.conf.erb

rwcommunity6 and rocommunity6 values are swapped.

<%- [@ro_community].compact.each do |c| -%>
<%- [
@ro_network].compact.each do |n| -%>
rocommunity <%= c %> <%= n %>
<%- end -%>
<%- end -%>
<%- [@ro_community6].compact.each do |c| -%>
<%- [
@ro_network6].compact.each do |n| -%>
rwcommunity6 <%= c %> <%= n %>
<%- end -%>
<%- end -%>
<%- [@rw_community6].compact.each do |c| -%>
<%- [
@rw_network6].compact.each do |n| -%>
rocommunity6 <%= c %> <%= n %>
<%- end -%>
<%- end -%>

SHOULD BE

<%- [@ro_community].compact.each do |c| -%>
<%- [
@ro_network].compact.each do |n| -%>
rocommunity <%= c %> <%= n %>
<%- end -%>
<%- end -%>
<%- [@ro_community6].compact.each do |c| -%>
<%- [
@ro_network6].compact.each do |n| -%>
rocommunity6 <%= c %> <%= n %>
<%- end -%>
<%- end -%>
<%- [@rw_community6].compact.each do |c| -%>
<%- [
@rw_network6].compact.each do |n| -%>
rwcommunity6 <%= c %> <%= n %>
<%- end -%>
<%- end -%>

Also, if you do not specify a rw/rocommunity6, it places it as ::1 public.
If you have IPv6 disabled on RHEL7, it will fail to load the snmp service.

What behaviour did you expect instead

It should not automatically add the ipv6 value if it has not been requested.
The rw/ro community strings are swapped in code and need to be fixed as shown above.

Output log

Any additional information you'd like to impart

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

No branches or pull requests

1 participant