2020-10-31 07:51:38 +00:00
|
|
|
# -------------------------------------------
|
|
|
|
# Specifying the default settings:
|
|
|
|
# -------------------------------------------
|
|
|
|
case run_command('grep VERSION_ID /etc/os-release | awk -F\" \'{print $2}\'').stdout.chomp
|
|
|
|
when "20.04"
|
|
|
|
cmd = 'LANG=C ip a | grep "inet " | grep -v -E "(127|172)" | cut -d" " -f6 | perl -pe "s/\/.+//g"'
|
|
|
|
|
|
|
|
when "18.04"
|
|
|
|
cmd = 'LANG=C /sbin/ifconfig | grep "inet " | grep -v -E "(127|172)" | cut -d" " -f10'
|
|
|
|
|
|
|
|
else
|
|
|
|
cmd = 'LANG=C /sbin/ifconfig | grep "inet addr" | grep -v -E "(127|172)" | awk "{print $2;}" | cut -d: -f2 | cut -f 1 -d " " | tail -1'
|
|
|
|
end
|
|
|
|
|
|
|
|
ipaddr = run_command(cmd).stdout.chomp
|
|
|
|
|
|
|
|
node.reverse_merge!({
|
|
|
|
'vector' => {
|
2021-09-23 10:15:06 +00:00
|
|
|
'url' => 'https://github.com/vectordotdev/vector/releases/download/',
|
2020-10-31 07:51:38 +00:00
|
|
|
'ipaddr' => ipaddr,
|
2020-12-06 03:03:24 +00:00
|
|
|
'debPrefix' => 'vector-',
|
2023-02-05 05:01:36 +00:00
|
|
|
'debPostfix' => '-amd64.deb',
|
|
|
|
'isSyslog' => false
|
2020-10-31 07:51:38 +00:00
|
|
|
},
|
|
|
|
})
|