From b3fe6052874d69975c33fd4e6d352eb4e53d7da4 Mon Sep 17 00:00:00 2001 From: Steven Webster Date: Mon, 15 Oct 2018 13:35:37 -0400 Subject: [PATCH] Modify default lldp system description This commit modifies the default system description configuration for the lldpd daemon to remove a product specific name and version. Instead, the OS name and version (default used by lldpd) will be used. For example, for a CentOS host, the system description would look something like: CentOS Linux 7 (Core) For security reasons, we also pass the -k option to the lldpd process in order to prevent the specific kernel version to be broadcast. Change-Id: I2a15481b95d1e37bc2f4ae053a10c3289dd2f400 Closes-Bug: #1796112 Signed-off-by: Steven Webster --- puppet-manifests/src/modules/platform/manifests/lldp.pp | 8 ++++++++ .../src/modules/platform/templates/lldp.conf.erb | 1 - .../src/modules/platform/templates/lldpd.default.erb | 6 ++++++ sysinv/sysinv/sysinv/sysinv/puppet/ovs.py | 9 ++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 puppet-manifests/src/modules/platform/templates/lldpd.default.erb diff --git a/puppet-manifests/src/modules/platform/manifests/lldp.pp b/puppet-manifests/src/modules/platform/manifests/lldp.pp index 4011f342a0..ff2a90a7f0 100644 --- a/puppet-manifests/src/modules/platform/manifests/lldp.pp +++ b/puppet-manifests/src/modules/platform/manifests/lldp.pp @@ -1,6 +1,7 @@ class platform::lldp::params( $tx_interval = 30, $tx_hold = 4, + $options = [] ) {} @@ -19,6 +20,13 @@ class platform::lldp notify => Service['lldpd'], } + file { "/etc/default/lldpd": + ensure => 'present', + replace => true, + content => template('platform/lldpd.default.erb'), + notify => Service['lldpd'], + } + service { 'lldpd': ensure => 'running', enable => true, diff --git a/puppet-manifests/src/modules/platform/templates/lldp.conf.erb b/puppet-manifests/src/modules/platform/templates/lldp.conf.erb index 6e6ceae1a1..4d2031da60 100644 --- a/puppet-manifests/src/modules/platform/templates/lldp.conf.erb +++ b/puppet-manifests/src/modules/platform/templates/lldp.conf.erb @@ -1,5 +1,4 @@ configure system hostname '<%= @hostname %>:<%= @system %>' -configure system description 'Titanium Cloud version <%= @version %>' configure lldp tx-interval <%= @tx_interval %> configure lldp tx-hold <%= @tx_hold %> configure system interface pattern *,!br*,!ovs*,!tap* diff --git a/puppet-manifests/src/modules/platform/templates/lldpd.default.erb b/puppet-manifests/src/modules/platform/templates/lldpd.default.erb new file mode 100644 index 0000000000..c74c9b8436 --- /dev/null +++ b/puppet-manifests/src/modules/platform/templates/lldpd.default.erb @@ -0,0 +1,6 @@ +DAEMON_ARGS=<%- @options.each do |option| -%> + <%= option['option'] -%> +<%- if option.has_key? 'arguments' -%> + <%= option['arguments'] -%> +<%- end -%> +<%- end -%> \ No newline at end of file diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/ovs.py b/sysinv/sysinv/sysinv/sysinv/puppet/ovs.py index f94166d578..683cdfc06f 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/ovs.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/ovs.py @@ -395,6 +395,13 @@ class OVSPuppet(base.BasePuppet): driver_list = self.context['_lldp_drivers'] driver_list.append('ovs') + lldpd_options = [] + + # Disable broadcasting the kernel version + lldpd_kernel_option = {"option": "-k"} + lldpd_options.append(lldpd_kernel_option) + return { - 'sysinv::agent::lldp_drivers': driver_list + 'sysinv::agent::lldp_drivers': driver_list, + 'platform::lldp::params::options': lldpd_options }