-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathpuppet_packet_agent.pp
50 lines (46 loc) · 1.93 KB
/
puppet_packet_agent.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
case $facts['os']['family'] {
'Suse': {
$lib_pcap = 'libpcap';
$cur_dir = '/tmp/';
$download_link = 'https://github.com/Netis/packet-agent/releases/download/v0.3.6/netis-packet-agent-0.3.6.el6.x86_64.rpm';
$package_provider = 'rpm';
$install_file = '/tmp/netis-packet-agent-0.3.6.el6.x86_64.rpm'
}
'RedHat': {
$lib_pcap = 'libpcap';
$cur_dir = '/tmp/';
$download_link = 'https://github.com/Netis/packet-agent/releases/download/v0.3.6/netis-packet-agent-0.3.6.el6.x86_64.rpm';
$package_provider = 'rpm';
$install_file = '/tmp/netis-packet-agent-0.3.6.el6.x86_64.rpm'
}
'Debian': {
$lib_pcap = 'libpcap-dev';
$cur_dir = '/tmp/';
$download_link = 'https://github.com/Netis/packet-agent/releases/download/v0.3.6/netis-packet-agent-0.3.6_amd64.deb';
$package_provider = 'dpkg';
$install_file = '/tmp/netis-packet-agent-0.3.6_amd64.deb'
}
default: {
$lib_pcap = 'libpcap';
$cur_dir = '/tmp/';
$download_link = 'https://github.com/Netis/packet-agent/releases/download/v0.3.6/netis-packet-agent-0.3.6.el6.x86_64.rpm';
$package_provider = 'rpm';
$install_file = '/tmp/netis-packet-agent-0.3.6.el6.x86_64.rpm'
}
}
package { $lib_pcap :
ensure => installed
}
exec {"download":
cwd => $cur_dir,
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games",
command => "wget $download_link",
user => "root",
group => "root",
logoutput => "true"
}
package { 'netis-packet-agent':
ensure => installed,
provider => $package_provider,
source => $install_file
}