1 # Copyright (c) 2021 Red Hat, Inc.
4 # Cleber Rosa <crosa@redhat.com>
6 # This work is licensed under the terms of the GNU GPL, version 2 or
7 # later. See the COPYING file in the top-level directory.
9 # This is an ansible playbook file. Run it to set up systems with the
10 # environment needed to build QEMU.
12 - name: Installation of basic packages to build QEMU
15 - name: Check for suitable ansible version
16 delegate_to: localhost
19 - '((ansible_version.major == 2) and (ansible_version.minor >= 8)) or (ansible_version.major >= 3)'
20 msg: "Unsuitable ansible version, please use version 2.8.0 or later"
22 - name: Add armhf foreign architecture to aarch64 hosts
23 command: dpkg --add-architecture armhf
25 - ansible_facts['distribution'] == 'Ubuntu'
26 - ansible_facts['architecture'] == 'aarch64'
28 - name: Update apt cache / upgrade packages via apt
33 - ansible_facts['distribution'] == 'Ubuntu'
35 # lcitool variables -f json ubuntu-2204 qemu | jq -r '.pkgs[]' | xargs -n 1 echo "-"
36 - name: Install basic packages to build QEMU on Ubuntu 22.04
109 - libspice-protocol-dev
110 - libspice-server-dev
118 - libusbredirhost-dev
120 - libvirglrenderer-dev
141 - python3-sphinx-rtd-theme
156 - ansible_facts['distribution'] == 'Ubuntu'
157 - ansible_facts['distribution_version'] == '22.04'
159 - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 22.04
162 - binutils-arm-linux-gnueabihf
163 - gcc-arm-linux-gnueabihf
167 - libglib2.0-dev:armhf
170 - libpixman-1-dev:armhf
173 - ansible_facts['distribution'] == 'Ubuntu'
174 - ansible_facts['distribution_version'] == '22.04'
175 - ansible_facts['architecture'] == 'aarch64'
177 - name: Enable EPEL repo on EL8
183 - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
184 - ansible_facts['distribution_major_version'] == '8'
186 - name: Enable PowerTools repo on CentOS 8
188 path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
193 - ansible_facts['distribution_file_variety'] == 'CentOS'
194 - ansible_facts['distribution_major_version'] == '8'
196 - name: Install basic packages to build QEMU on EL8
198 # This list of packages start with tests/docker/dockerfiles/centos8.docker
199 # but only include files that are common to all distro variants and present
200 # in the standard repos (no add-ons)
206 - device-mapper-multipath-devel
214 - glusterfs-api-devel
244 - systemtap-sdt-devel
249 - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
250 - ansible_facts['distribution_version'] == '8'
252 - name: Install packages only available on x86 and aarch64
254 # Spice server not available in ppc64le
260 - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
261 - ansible_facts['distribution_version'] == '8'
262 - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64'
264 - name: Check whether the Python runtime version is managed by alternatives
266 path: /etc/alternatives/python3
269 - name: Set default Python runtime to 3.8 on EL8
270 command: alternatives --set python3 /usr/bin/python3.8
272 - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
273 - ansible_facts['distribution_version'] == '8'
274 - python3.stat.islnk and python3.stat.lnk_target != '/usr/bin/python3.8'