b0e7922ee1f26de07edf6f6b56654c0c050e693f
[ovsdb.git] / resources / puppet / manifests / mininet.pp
1 $deps = [ 'build-essential',
2           'debhelper',
3           'dkms',
4           'fakeroot',
5           'graphviz',
6           'linux-headers-generic',
7           'python-all',
8           'python-qt4',
9           'python-zopeinterface',
10           'python-twisted-conch',
11           'python-twisted-web'
12 ]
13
14 package { $deps:
15     ensure   => installed,
16 }
17
18 vcsrepo { '/home/vagrant/mininet':
19     ensure   => present,
20     provider => git,
21     user     => 'vagrant',
22     source   => 'git://github.com/mininet/mininet',
23     revision => '2.1.0p2',
24     before   => Exec['Install Mininet']
25 }
26
27 exec { 'Install Mininet':
28     command => 'bash mininet/util/install.sh -nf > /dev/null',
29     cwd     => '/home/vagrant',
30     user    => 'vagrant',
31     path    => $::path,
32     timeout => 0
33 }
34
35 exec {'openvswitch-2.1.2.tar.gz':
36     command => 'wget http://openvswitch.org/releases/openvswitch-2.1.2.tar.gz',
37     cwd     => '/home/vagrant',
38     path    => $::path,
39     user    => 'vagrant'
40 }
41
42 exec { 'Extract Open vSwitch':
43     command => 'tar -xvf openvswitch-2.1.2.tar.gz',
44     cwd     => '/home/vagrant',
45     user    => 'vagrant',
46     path    => $::path,
47     timeout => 0,
48     require => Exec['openvswitch-2.1.2.tar.gz']
49 }
50
51 exec { 'Compile Open vSwitch':
52     command => 'fakeroot debian/rules binary',
53     cwd     => '/home/vagrant/openvswitch-2.1.2',
54     user    => 'root',
55     path    => $::path,
56     timeout => 0,
57     require => [Exec['Extract Open vSwitch'], Package[$deps]]
58 }
59
60 package { 'openvswitch-common':
61     ensure   => installed,
62     provider => dpkg,
63     source   => '/home/vagrant/openvswitch-common_2.1.2-1_amd64.deb',
64     require  => Exec['Compile Open vSwitch']
65 }
66
67 package { 'openvswitch-switch':
68     ensure   => installed,
69     provider => dpkg,
70     source   => '/home/vagrant/openvswitch-switch_2.1.2-1_amd64.deb',
71     require  => Package['openvswitch-common']
72 }
73
74 package { 'openvswitch-datapath-dkms':
75     ensure   => installed,
76     provider => dpkg,
77     source   => '/home/vagrant/openvswitch-datapath-dkms_2.1.2-1_all.deb',
78     require  => Package['openvswitch-switch']
79 }
80
81 package { 'openvswitch-pki':
82     ensure   => installed,
83     provider => dpkg,
84     source   => '/home/vagrant/openvswitch-pki_2.1.2-1_all.deb',
85     require  => Package['openvswitch-datapath-dkms']
86 }
87
88 exec { 'Compile Test Controller':
89     command  => 'sh boot.sh && sh configure && make',
90     cwd      => '/home/vagrant/openvswitch-2.1.2',
91     path     => $::path,
92     user     => 'root',
93     require  => [Exec['Compile Open vSwitch'], Package[$deps]]
94 }
95
96 exec { 'Link Test Controller':
97     command  => 'ln -s /home/vagrant/openvswitch-2.1.2/tests/test-controller /usr/bin/ovs-controller',
98     cwd      => '/home/vagrant/openvswitch-2.1.2',
99     path     => $::path,
100     user     => 'root',
101     require  => Exec['Compile Test Controller']
102 }