[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/4] Jobs based on custom runners: build environment docs
From: |
Andrea Bolognani |
Subject: |
Re: [PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook |
Date: |
Tue, 20 Oct 2020 19:52:43 +0200 |
User-agent: |
Evolution 3.36.5 (3.36.5-1.fc32) |
On Sun, 2020-10-18 at 21:50 -0400, Cleber Rosa wrote:
> +++ b/scripts/ci/setup/build-environment.yml
> @@ -0,0 +1,233 @@
> +---
> +- name: Installation of basic packages to build QEMU
> + hosts: all
> + tasks:
My Ansible-fu is a bit rusty at the moment, so please double-check my
claims and apologies in advance for the ones that I will get wrong O:-)
> + - name: Install basic packages to build QEMU on Ubuntu 18.04/20.04
> + apt:
> + update_cache: yes
> + # Originally from tests/docker/dockerfiles/ubuntu1804.docker
> + pkg:
> + - ccache
> + - clang
Instead of using the 'apt' module here, and the equivalent module
further down, you could just do
package:
name:
- pkg1
- pkg2
...
state: present
every single time and let Ansible take care of the differences for
you.
> + when: "ansible_facts['distribution'] == 'Ubuntu'"
Quoting the entire condition is not necessary, you can just have
when: ansible_facts['distribution'] == 'Ubuntu'
or, my preference,
when:
- ansible_facts['distribution'] == 'Ubuntu'
which results in a nicer diff when you add/remove conditions.
> + - name: Install packages to build QEMU on Ubuntu 18.04/20.04 on non-s390x
> + apt:
> + update_cache: yes
> + pkg:
> + - libspice-server-dev
> + - libxen-dev
Indentation of list items is inconsistent here.
> + - name: Install basic packages to build QEMU on FreeBSD 12.x
> + pkgng:
> + # Originally from packages on .cirrus.yml under the freebsd_12_task
> + name:
> bash,curl,cyrus-sasl,git,glib,gmake,gnutls,gsed,nettle,ninja,perl5,pixman,pkgconf,png,usbredir
See above for 'pkgng' vs 'package', but at the very least this should
be
pkgng:
name:
- bash
- curl
...
or each time the list is touched the resulting diff is going to be
unmanageable.
> + - name: Enable PowerTools repo on CentOS 8
> + ini_file:
> + path: /etc/yum.repos.d/CentOS-PowerTools.repo
> + section: PowerTools
> + option: enabled
> + value: "1"
> + when:
> + - "ansible_facts['distribution'] == 'CentOS'"
> + - "ansible_facts['distribution_major_version'] == '8'"
Another option would be to use
command: 'dnf config-manager --set-enabled Stream-PowerTools -y'
args:
warn: no
but I have to admit the way you're doing it is very clever ;)
--
Andrea Bolognani / Red Hat / Virtualization
[PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook, Cleber Rosa, 2020/10/18
Re: [PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook,
Andrea Bolognani <=
Re: [PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook, Thomas Huth, 2020/10/21
[PATCH v4 4/4] Jobs based on custom runners: add job definitions for QEMU's machines, Cleber Rosa, 2020/10/18