licenses: Add license headers
[ovsnfv.git] / fuel-plugin-ovsnfv / deployment_scripts / puppet / modules / ovsdpdk / manifests / clone.pp
1 # Copyright (c) 2016 Open Platform for NFV Project, Inc. and its contributors
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14
15 # == Class: ovsdpdk::clone
16 #
17 # Responsible for downloading all relevant git repos for setting up of OVS+DPDK
18 #
19 class ovsdpdk::clone(
20   $dest                    = $::ovsdpdk::params::dest,
21   $ovs_dir                 = $::ovsdpdk::params::ovs_dir,
22   $ovs_dpdk_dir            = $::ovsdpdk::params::ovs_dpdk_dir,
23   $networking_ovs_dpdk_dir = $::ovsdpdk::params::networking_ovs_dpdk_dir,
24   $ovs_git_tag             = $::ovsdpdk::params::ovs_git_tag,
25   $ovs_dpdk_git_tag        = $::ovsdpdk::params::ovs_dpdk_git_tag,
26   $ovs_plugin_git_tag      = $::ovsdpdk::params::ovs_plugin_git_tag,
27   $master_ip               = $::ovsdpdk::params::master_ip,
28 ) inherits ovsdpdk {
29
30   file { $dest:
31     ensure => directory,
32     mode   => '0755',
33   }
34
35   package { 'git':
36     ensure   => installed,
37   }
38
39   package { 'python-pip':
40     ensure   => installed,
41   }
42
43   exec { "wget dpdk":
44     command => "rm -rf dpdk.tgz $ovs_dpdk_dir && wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/dpdk.tgz && tar xf dpdk.tgz && mv dpdk $ovs_dpdk_dir",
45     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
46     require => File[$dest],
47   }
48
49   exec { "wget ovs":
50     command => "rm -rf ovs.tgz $ovs_dir && wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/ovs.tgz && tar xf ovs.tgz && mv ovs $ovs_dir",
51     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
52     require => File[$dest],
53   }
54
55   exec { "wget networking_ovs_dpdk":
56     command => "rm -rf networking-ovs-dpdk.tgz $networking_ovs_dpdk_dir && wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/networking-ovs-dpdk.tgz && tar xf networking-ovs-dpdk.tgz && mv networking-ovs-dpdk $networking_ovs_dpdk_dir",
57     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
58     require => File[$dest],
59   }
60
61   exec { "wget qemu":
62     command => "rm -rf qemu-2.2.1.tar.bz2 /opt/code/qemu && wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/qemu-2.2.1.tar.bz2 && tar xf qemu-2.2.1.tar.bz2 && mv qemu-2.2.1 /opt/code/qemu",
63     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
64     require => File[$dest],
65   }
66
67   exec { "wget libvirt":
68     command => "rm -rf libvirt-1.2.12.tar.gz /opt/code/libvirt && wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/libvirt-1.2.12.tar.gz && tar xf libvirt-1.2.12.tar.gz && mv libvirt-1.2.12 /opt/code/libvirt",
69     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
70     require => File[$dest],
71   }
72
73   exec { "wget libvirt-python":
74     command => "rm -rf libvirt-python-1.2.12.tar.gz /opt/code/libvirt-python && wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/libvirt-python-1.2.12.tar.gz && tar xf libvirt-python-1.2.12.tar.gz && mv libvirt-python-1.2.12 /opt/code/libvirt-python",
75     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
76     require => File[$dest],
77   }
78
79   exec { "install pbr":
80     command => "wget http://$master_ip:8080/plugins/fuel-plugin-ovsnfv-0.0/repositories/ubuntu/pbr-1.8.1-py2.py3-none-any.whl && pip install pbr-1.8.1-py2.py3-none-any.whl",
81     path    => "/usr/bin:/usr/sbin:/bin:/sbin",
82     require => Package['python-pip'],
83   }
84 }