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
|
class onos::service{
$public_eth = $onos::public_eth
Exec{
path => "/usr/bin:/usr/sbin:/bin:/sbin",
timeout => 320,
logoutput => 'true',
}
firewall {'221 onos':
port => [6633, 6640, 6653, 8181, 8101,9876],
proto => 'tcp',
action => 'accept',
}->
service{ 'onos':
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
}->
exec{ 'sleep 100 to stablize onos':
command => 'sleep 100;'
}->
exec{ 'restart onos':
command => 'service onos restart',
}->
exec{ 'sleep 100 again to stablize onos':
command => 'sleep 100;'
}->
exec{ 'restart onos again':
command => 'service onos restart',
}->
exec{ 'sleep 60 to stablize onos':
command => 'sleep 60;'
}->
exec{ 'add onos auto start':
command => 'echo "onos">>/opt/service',
}->
exec{ 'set public port':
command => "/opt/onos/bin/onos \"externalportname-set -n $public_eth\""
}
}
|