Introduction

This role configures OBS workers, both on Linux or on Windows on top of WSL. When running this role on Windows configuration to firewall and other components required for successful OBS worker execution is configured. Therefore a playbook for WSL could look like the following:

- hosts: windows-workers
  vars:
    ansible_user: management
  roles:
    - obs-worker

- hosts: obs-workers
  become: True
  vars:
    ansible_user: management
  roles:
    - obs-worker

This would first run the Windows steps, followed by running the worker configuration against both WSL workers and native Linux workers.

The WSL setup is done through basic-host, which can automatically register WSL instances to the inventory:

=+BEGIN_SRC yaml wsl_distributions: openSUSE-Leap-15-1: installer: 'c:\ci\opensuse.appx' installer_type: appx location: 'd:\suse' sshd_port: 8022 sshd_service: True host_prefix: wsl- groups: dynamic-hosts,obs-workers reprovision: False #+END_SRC

This snippet in the variables for a Windows host would deploy a WSL instance from opensuse.appx, prepare SSH access, add it to the inventory and assign it to the obs-workers group.

configuration options

obs_tmpfs_size

If defined, create and persistently mount a tmpfs this size as OBS working directory.

obs_cache_type

Possible values: lvm, directory. Defaults to lvm. When set to lvm a logical volume of obs_cache_size will be created, formatted and mounted at obs_worker_directory.

NFS cache

The role has partial support for using cache directories on NFS. Currently only using a yocto subdirectory on NFS is supported, mounted to obs_cache_dir=/yocto. If the following variables are set a NFS mount will be set up. Setting =obs_skip_nfs to True allows skipping the NFS setup on selected build hosts, making it possible to have a global NFS configuration, but skip it on selected hosts (like WSL workers).

  • obs_nfs_location: the NFS server
  • obs_nfs_cache_dir: the directory on the NFS server, defaulting to =obs_cache_dir=/yocto
  • obs_nfs_mount_opts: mount options for NFS, defaulting to 'defaults'

Buildhost configuration

  • obs_api_server, default 'OBS'
  • obs_cache_dir, default '/var/lib/cache'
  • obs_cache_size, default 61440
  • obs_instance_memory, default ''
  • obs_repo_server
  • obs_repo_server_port, default 5252
  • obs_root_sshd_key_url, default ''
  • obs_setup_worker_partitions, default 'use_obs_vg'
  • obs_src_server
  • obs_src_server_port, default 5352
  • obs_storage_autosetup, default ''
  • obs_use_slp, default 'yes'
  • obs_vm_initrd, default 'none'
  • obs_vm_kernel, default 'none'
  • obs_vm_type, default 'none'
  • obs_vm_use_tmpfs, default ''
  • obs_worker_binaries_proxy, default ''
  • obs_worker_cache_size, default ''
  • obs_worker_directory, default '/data/obs/workers'
  • obs_worker_hostlabels, default 'tmpfs'
  • obs_worker_instance_names, default ''
  • obs_worker_instances, default 10 (2 for WSL)
  • obs_worker_jobs, default 8
  • obs_worker_nice_level, default 18
  • obs_worker_portbase, default 0
  • obs_worker_root_size, default ''
  • obs_worker_script_url, default ''
  • obs_worker_swap_size, default ''

Limits

A number of limits for the abuild user can be configured. See limits.conf(5) for explanation of the fields:

  • abuild_nofile_soft, default 12207
  • abuild_nofile_hard, default 16276
  • abuild_nproc_soft, default 12207
  • abuild_nproc_hard, default 16276