trombik.buildbot_worker

trombik.buildbot_worker

Install buildbot-worker.

Requirements

None

Role Variables

Variable Description Default
buildbot_worker_user User name for buildbot-worker {{ __buildbot_worker_user }}
buildbot_worker_group Group name for buildbot-worker {{ __buildbot_worker_group }}
buildbot_worker_package Package name for buildbot-worker {{ __buildbot_worker_package }}
buildbot_worker_extra_packages List of additional packages to install []
buildbot_worker_service Service name for buildbot-worker {{ __buildbot_worker_service }}
buildbot_worker_root_dir Root directory (and $HOME directory) for buildbot-worker {{ __buildbot_worker_root_dir }}
buildbot_worker_conf_dir Configuration directory, usually the same as buildbot_worker_root_dir {{ __buildbot_worker_conf_dir }}
buildbot_worker_conf_file Path to the configuration file, buildbot.tac {{ buildbot_worker_conf_dir }}/buildbot.tac
buildbot_worker_config Contents of buildbot_worker_conf_file ""
buildbot_worker_flags Contents of startup script for buildbot-worker ""

Debian

Variable Default
__buildbot_worker_user buildbot
__buildbot_worker_group buildbot
__buildbot_worker_service buildbot-worker@default
__buildbot_worker_package python3-buildbot-worker
__buildbot_worker_extra_packages []
__buildbot_worker_root_dir /var/lib/buildbot
__buildbot_worker_conf_dir {{ __buildbot_worker_root_dir }}/workers/default

FreeBSD

Variable Default
__buildbot_worker_user buildbot
__buildbot_worker_group buildbot
__buildbot_worker_service buildbot-worker
__buildbot_worker_package devel/py-buildbot-worker
__buildbot_worker_extra_packages []
__buildbot_worker_root_dir /usr/local/buildbot_worker
__buildbot_worker_conf_dir {{ __buildbot_worker_root_dir }}

OpenBSD

Variable Default
__buildbot_worker_user _buildslave
__buildbot_worker_group _buildslave
__buildbot_worker_service buildbot_worker
__buildbot_worker_package buildbot-worker
__buildbot_worker_extra_packages []
__buildbot_worker_root_dir /var/buildslave
__buildbot_worker_conf_dir {{ __buildbot_worker_root_dir }}

Dependencies

None

Example Playbook

---
- hosts: localhost
  roles:
    - name: trombik.freebsd_pkg_repo
      when: ansible_os_family == 'FreeBSD'
    - ansible-role-buildbot_worker
  vars:
    os_buildbot_worker_flags:
      FreeBSD: |
        buildbot_worker_basedir="{{ buildbot_worker_conf_dir }}"
      # "
      Debian: |
        #WORKER_RUNNER=/usr/bin/buildbot-worker

        # Use 'true|yes|1' to enable and 'false|no|0' to disable. Other values will cause an error.

        WORKER_ENABLED[1]=1                    # 1 for enabled, 0 for disabled
        WORKER_NAME[1]="default"               # name displayed on start/stop
        WORKER_USER[1]="buildbot"              # user to run the worker
        WORKER_BASEDIR[1]="{{ buildbot_worker_conf_dir }}"  # absolute path for worker basedir
        WORKER_OPTIONS[1]=""                   # buildbot options
        WORKER_PREFIXCMD[1]=""                 # command prefix, e.g. nice, linux32, dchroot
    # "

    buildbot_worker_flags: "{{ os_buildbot_worker_flags[ansible_os_family] | default('') }}"
    buildbot_worker_config: |
      import os
      from buildbot_worker.bot import Worker
      from twisted.application import service
      basedir = '{{ buildbot_worker_conf_dir }}'
      rotateLength = 10000000
      maxRotatedFiles = 10
      
      if basedir == '.':
          import os.path
          basedir = os.path.abspath(os.path.dirname(__file__))
      
      application = service.Application('buildbot-worker')
      from twisted.python.logfile import LogFile
      from twisted.python.log import ILogObserver, FileLogObserver
      logfile = LogFile.fromFullPath(
          os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
          maxRotatedFiles=maxRotatedFiles)
      application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
      
      buildmaster_host = 'localhost'
      port = 9989
      workername = 'test-worker'
      passwd = 'pass'
      keepalive = 600
      umask = None
      maxdelay = 300
      numcpus = None
      allow_shutdown = None
      maxretries = None
      
      s = Worker(buildmaster_host, port, workername, passwd, basedir,
                 keepalive, umask=umask, maxdelay=maxdelay,
                 numcpus=numcpus, allow_shutdown=allow_shutdown,
                 maxRetries=maxretries)
      s.setServiceParent(application)

    freebsd_pkg_repo:
      FreeBSD:
        enabled: "false"
        state: present
      FreeBSD_devel:
        enabled: "true"
        state: present
        url: "http://pkg.i.trombik.org/{{ ansible_distribution_version | regex_replace('\\.', '') }}{{ansible_architecture}}-default-default/"
        mirror_type: http
        signature_type: none
        priority: 100

License

Copyright (c) 2019 Tomoyuki Sakurai <[email protected]>

You can use, copy, modify, and share this software for any purpose for free, as long as you keep this copyright notice in all copies.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES OR LIABILITY. The author is not responsible for any damages caused by using this software.

Author Information

Tomoyuki Sakurai y@trombik.org

This README was created by qansible

Informazioni sul progetto

Configure buildbot worker

Installa
ansible-galaxy install trombik.buildbot_worker
Licenza
isc
Download
195
Proprietario
PGP finger print: 03EB 3D97 5E04 9B0C AB21 93A2 D693 42A9 EFBC 3577 Makerspace and Coliving in Siem Reap, Cambodia: http://info.mkrsgh.org/