aboutsummaryrefslogtreecommitdiffstats
path: root/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/install.pp
blob: 7ccb76991c5c36daab4dfc2ba5b25addcf23dedf (plain)
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
51
52
53
54
55
56
class onos::install{
$onos_home = $onos::onos_home
$onos_pkg_url = $onos::onos_pkg_url
$karaf_dist = $onos::karaf_dist
$onos_pkg_name = $onos::onos_pkg_name
$jdk8_pkg_name = $onos::jdk8_pkg_name


Exec{
        path => "/usr/bin:/usr/sbin:/bin:/sbin",
	logoutput => "true",
        timeout => 180,
}
group { 'onos':
      ensure => present,
      before => [File['/opt/onos/'], User['onos']],
    }


user { 'onos':
      ensure     => present,
      home       => '/opt/onos/',
      membership => 'minimum',
      groups     => 'onos',
      before     => File['/opt/onos/'],
    }


file { '/opt/onos/':
        ensure  => 'directory',
        recurse => true,
        owner   => 'onos',
        group   => 'onos',
}->


file{ "/opt/$onos_pkg_name":
        source => "puppet:///modules/onos/$onos_pkg_name",
} ->
file{ "/opt/$jdk8_pkg_name":
        source => "puppet:///modules/onos/$jdk8_pkg_name",
} ->

file{ '/root/.m2/':
        ensure => 'directory',
        recurse => true,
} ->
file{ '/root/.m2/repository.tar':
        source => "puppet:///modules/onos/repository.tar",
} ->
exec{ "unzip packages":
        command => "tar -zvxf /opt/$onos_pkg_name -C $onos_home  --strip-components 1 --no-overwrite-dir -k;
        tar xf /root/.m2/repository.tar -C /root/.m2/",
}
}