Merge "Job for testing the ODL user configuration"
[releng/builder.git] / packer / provision / mininet-ovs-2.8.yaml
1 ---
2 - import_playbook: ../common-packer/provision/baseline.yaml
3
4 - hosts: all
5   become_user: root
6   become_method: sudo
7   vars:
8     ovs_checksum: sha256:8d1c439e26d7044f0ec823c7fef1b00b7c6465da0b83a7d0cf3191ed1dc43893
9     ovs_version: 2.8.1
10
11   pre_tasks:
12     - include_role: name=lfit.system-update
13
14   tasks:
15     - name: 'Install OpenVSwitch {{ovs_version}}'
16       block:
17         - name: Install OpenVSwitch dependencies
18           apt: 'name={{item}} state=present'
19           with_items:
20             - autoconf
21             - automake
22             - bzip2
23             - debhelper
24             - dh-autoreconf
25             - libssl-dev
26             - openssl
27             - pkg-config
28             - procps
29             - python-all
30             - python-qt4
31             - python-twisted-conch
32             - python-zopeinterface
33           become: true
34         - name: 'Fetch OpenVSwitch {{ovs_version}}'
35           get_url:
36             url: 'http://openvswitch.org/releases/openvswitch-{{ovs_version}}.tar.gz'
37             dest: '/tmp/openvswitch-{{ovs_version}}.tar.gz'
38             checksum: '{{ovs_checksum}}'
39         - name: Create /tmp/ovs directory
40           file:
41             path: /tmp/ovs
42             state: directory
43             mode: 0755
44         - name: 'Unarchive OpenVSwitch {{ovs_version}}'
45           unarchive:
46             src: '/tmp/openvswitch-{{ovs_version}}.tar.gz'
47             dest: /tmp/ovs
48             remote_src: true
49         - name: 'Build OpenVSwitch {{ovs_version}}'
50           shell: DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
51           args:
52             chdir: '/tmp/ovs/openvswitch-{{ovs_version}}'
53         - name: 'Install OpenVSwitch {{ovs_version}}'
54           apt: 'deb={{item}}'
55           with_items:
56             - /tmp/ovs/libopenvswitch_2.8.1-1_amd64.deb
57             - /tmp/ovs/openvswitch-common_2.8.1-1_amd64.deb
58             - /tmp/ovs/openvswitch-switch_2.8.1-1_amd64.deb
59             - /tmp/ovs/python-openvswitch_2.8.1-1_all.deb
60             - /tmp/ovs/openvswitch-vtep_2.8.1-1_amd64.deb
61           become: true
62         - name: Enable openvswitch-switch service
63           systemd:
64             name: openvswitch-switch
65             enabled: true
66             masked: false
67           become: true
68         - name: Enable openvswitch-vtep service
69           systemd:
70             name: openvswitch-vtep
71             enabled: true
72             masked: false
73           become: true
74
75     - name: Install Mininet
76       apt: name=mininet state=present
77       become: true
78
79     - name: Install mtcbench
80       block:
81         - name: Install mtcbench dependencies
82           apt: 'name={{item}} state=present'
83           with_items:
84             - autoconf
85             - automake
86             - build-essential
87             - libconfig-dev
88             - libffi-dev
89             - libpcap-dev
90             - libsnmp-dev
91             - libtool
92             - libssl-doc
93             - make
94             - pkg-config
95             - snmp
96             - snmpd
97           become: true
98         - name: Fetch mtcbench git repo
99           git:
100             repo: https://github.com/intracom-telecom-sdn/mtcbench.git
101             dest: /tmp/mtcbench
102         - name: Run mtcbench/deploy/docker/provision.sh
103           command: /tmp/mtcbench/deploy/docker/provision.sh
104           become: true
105         - name: Build mtcbench
106           # TODO: remove workaround for build issue with mtcbench
107           # when mtcbench dependency build correctly
108           # https://github.com/intracom-telecom-sdn/mtcbench/issues/10
109           shell: /tmp/mtcbench/build_mtcbench.sh || true
110         - name: Run make for cbench
111           command: make
112           args:
113             chdir: /tmp/mtcbench/oflops/cbench
114         - name: Install cbench to /usr/local/bin/cbench
115           copy:
116             src: /tmp/mtcbench/oflops/cbench/cbench
117             dest: /usr/local/bin/cbench
118             mode: 0755
119             owner: root
120             remote_src: yes
121           become: true
122
123     - name: Install exabgp
124       apt: name=exabgp state=present
125       become: true
126
127     - name: Install python-netaddr for custom mininet topologies
128       apt: name=python-netaddr state=present
129       become: true
130
131     - name: Install vlan for vlan based tests in VTN suites
132       apt: name=vlan state=present
133       become: true
134
135   post_tasks:
136     - name: System Reseal
137       script: ../common-packer/provision/system-reseal.sh
138       become: true