-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
WIP: Simpify traditional access control parameters #183
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
# | ||
# # Only configure and run the snmptrap daemon: | ||
# class { 'snmp': | ||
# ro_community => 'SeCrEt', | ||
# ro_community => ['SeCrEt'], | ||
# service_ensure => 'stopped', | ||
# trap_service_ensure => 'running', | ||
# trap_handlers => [ | ||
|
@@ -27,28 +27,28 @@ | |
# SNMP notifications. | ||
# | ||
# @param ro_community | ||
# Read-only (RO) community string or array for agent and snmptrap daemon. | ||
# Read-only (RO) array of community strings for agent and snmptrap daemon. | ||
# | ||
# @param ro_community6 | ||
# Read-only (RO) community string or array for IPv6 agent. | ||
# Read-only (RO) array of community strings for IPv6 agent. | ||
# | ||
# @param rw_community | ||
# Read-write (RW) community string or array agent. | ||
# Read-write (RW) array of community strings for agent. | ||
# | ||
# @param rw_community6 | ||
# Read-write (RW) community string or array for IPv6 agent. | ||
# Read-write (RW) array of community strings for IPv6 agent. | ||
# | ||
# @param ro_network | ||
# Network that is allowed to RO query the daemon. Can be string or array. | ||
# Networks that are allowed to RO query the daemon. | ||
# | ||
# @param ro_network6 | ||
# Network that is allowed to RO query the daemon via IPv6. Can be string or array. | ||
# Networks that are allowed to RO query the daemon via IPv6. | ||
# | ||
# @param rw_network | ||
# Network that is allowed to RW query the daemon. Can be string or array. | ||
# Networks that are allowed to RW query the daemon. | ||
# | ||
# @param rw_network6 | ||
# Network that is allowed to RW query the daemon via IPv6. Can be string or array. | ||
# Networks that are allowed to RW query the daemon via IPv6. | ||
# | ||
# @param contact | ||
# Responsible person for the SNMP system. | ||
|
@@ -245,23 +245,23 @@ | |
# Group of `var_net_snmp` directory. | ||
# | ||
class snmp ( | ||
Enum['present','absent'] $ensure = 'present', | ||
Array[String[1]] $agentaddress = [ 'udp:127.0.0.1:161', 'udp6:[::1]:161' ], | ||
Array[String[1]] $snmptrapdaddr = [ 'udp:127.0.0.1:162', 'udp6:[::1]:162' ], | ||
Variant[Undef, String[1], Array[String[1]]] $ro_community = 'public', | ||
Variant[Undef, String[1], Array[String[1]]] $ro_community6 = 'public', | ||
Variant[Undef, String[1], Array[String[1]]] $rw_community = undef, | ||
Variant[Undef, String[1], Array[String[1]]] $rw_community6 = undef, | ||
Variant[Array, Stdlib::IP::Address::V4, Stdlib::IP::Address::V4::CIDR] $ro_network = '127.0.0.1', | ||
Variant[Array, Stdlib::IP::Address::V6, Stdlib::IP::Address::V6::CIDR] $ro_network6 = '::1', | ||
Variant[Array, Stdlib::IP::Address::V4, Stdlib::IP::Address::V4::CIDR] $rw_network = '127.0.0.1', | ||
Variant[Array, Stdlib::IP::Address::V6, Stdlib::IP::Address::V6::CIDR] $rw_network6 = '::1', | ||
String[1] $contact = 'Unknown', | ||
String[1] $location = 'Unknown', | ||
String[1] $sysname = $facts['networking']['fqdn'], | ||
Integer $services = 72, | ||
Array[String[1]] $com2sec = [ 'notConfigUser default public' ], | ||
Array[String[1]] $com2sec6 = [ 'notConfigUser default public' ], | ||
Enum['present','absent'] $ensure = 'present', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In most modules we align the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's become pretty hard to do this and not have it look ridiculous. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With regards to styling of class parameters, I'm no longer doing any special alignment between the data type, parameter and value and am only doing a single space between each. Data types break down the ability to have a style that makes the code readable. With the advent of REFERENCE.md, you can always look there to see all the parameters and their default values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align the I am in favor of no longer aligning the |
||
Array[String[1]] $agentaddress = [ 'udp:127.0.0.1:161', 'udp6:[::1]:161' ], | ||
Array[String[1]] $snmptrapdaddr = [ 'udp:127.0.0.1:162', 'udp6:[::1]:162' ], | ||
Array[String[1]] $ro_community = ['public'], | ||
Array[String[1]] $ro_community6 = ['public'], | ||
Array[String[1]] $rw_community = [], | ||
Array[String[1]] $rw_community6 = [], | ||
Array[Stdlib::IP::Address::V4] $ro_network = ['127.0.0.1'], | ||
Array[Stdlib::IP::Address::V6] $ro_network6 = ['::1'], | ||
Array[Stdlib::IP::Address::V4] $rw_network = ['127.0.0.1'], | ||
Array[Stdlib::IP::Address::V6] $rw_network6 = ['::1'], | ||
String[1] $contact = 'Unknown', | ||
String[1] $location = 'Unknown', | ||
String[1] $sysname = $facts['networking']['fqdn'], | ||
Integer $services = 72, | ||
Array[String[1]] $com2sec = [ 'notConfigUser default public' ], | ||
Array[String[1]] $com2sec6 = [ 'notConfigUser default public' ], | ||
Array[String[1]] $groups = [ | ||
'notConfigGroup v1 notConfigUser', | ||
'notConfigGroup v2c notConfigUser', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point in this as it breaks backward compatibility though in the next release you want to deprecate the option anyhow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this was a step too far. I'll have another think.