From d589c984ad8cd8e8c78caff57e9a98359abcfa47 Mon Sep 17 00:00:00 2001 From: manegron Date: Thu, 24 Oct 2024 21:27:06 +0100 Subject: [PATCH] Add sfacctd_ip --- resources/providers/config.rb | 4 +++- resources/resources/config.rb | 1 + resources/templates/default/sfacctd.conf.erb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/providers/config.rb b/resources/providers/config.rb index 541cc44..b840efe 100644 --- a/resources/providers/config.rb +++ b/resources/providers/config.rb @@ -10,6 +10,7 @@ kafka_topic = new_resource.kafka_topic kafka_broker_port = new_resource.kafka_broker_port geo_country = new_resource.geo_country + sfacctd_ip = new_resource.sfacctd_ip dnf_package 'pmacct' do action :upgrade @@ -41,7 +42,8 @@ kafka_hosts: kafka_hosts, kafka_topic: kafka_topic, kafka_broker_port: kafka_broker_port, - geo_country: geo_country) + geo_country: geo_country, + sfacctd_ip: sfacctd_ip) notifies :restart, 'service[sfacctd]', :delayed unless node['redborder']['leader_configuring'] end diff --git a/resources/resources/config.rb b/resources/resources/config.rb index 48272a4..ebc776b 100644 --- a/resources/resources/config.rb +++ b/resources/resources/config.rb @@ -11,3 +11,4 @@ attribute :kafka_topic, kind_of: String, default: 'sflow' attribute :kafka_broker_port, kind_of: Integer, default: 9092 attribute :geo_country, kind_of: String, default: '/usr/share/GeoIP/GeoLiteCountry.dat' +attribute :sfacctd_ip, kind_of: String \ No newline at end of file diff --git a/resources/templates/default/sfacctd.conf.erb b/resources/templates/default/sfacctd.conf.erb index f67df2a..4c18852 100644 --- a/resources/templates/default/sfacctd.conf.erb +++ b/resources/templates/default/sfacctd.conf.erb @@ -41,7 +41,7 @@ geoipv2_file: <%=@geo_country %> sfacctd_time_new: true sfacctd_account_options: true sfacctd_port: 6343 -sfacctd_ip: <%= "#{node["ipaddress"]}" %> +sfacctd_ip: <%= "#{@sfacctd_ip}" %> sfprobe_direction: tag