Jenkins Node Setup ansible

This pages describe the automatic part of the setup of jenkins slaves with ansible. There are still some manual steps required which are documented at Jenkins_Node_Setup.


For poky you need to download "" to osmo-ci/files/.
For coverity you need to download "cov-analysis-linux64-2017.07.tar.gz" to osmo-ci/files/.
The filename could be different and changed in the playbook.

How to setup a new node?

First prepare the host (vm, lxc, ..) to have a ssh daemon and python.
Also add your key to /root/.ssh/authorized_keys.

apt-get update; apt-get install openssh-server python

It must be reachable from the host you're executing the ansible executable.

cd osmo-ci/ansible

Edit the hosts file. Depending on the feature you want to have. We will add a generic slave.


my_new_host ansible_host=2a01:4f8:13b:828::99:abcd

If the new host, has a valid dns entry, you can just add `my_new_host` without the ansbible_host address.
Now you can run ansible.

$ ansible-playbook -i hosts -l my_new_host setup-jenkins-slave.yml

When everything worked out you should see:

PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
my_new_host    : ok=23   changed=22   unreachable=0    failed=0   

The important stuff here is the failed=0.

How to update existing node?

The process is rather similar to setting up new node. When some task is updated and the changes should be propagated to existing nodes, it's done via running some playbook which contains given task (directly or via role which uses the task).
For example, after adding new dependency to build slaves via ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml task, it can be propagated by running:

ansible-playbook -i hosts setup-jenkins-slave.yml

Jenkins Configuration

After ansible has finished. The host must be configured in jenkins.

  1. Login and go to
  2. Add Node
  3. Name: Should match your hostname.
  4. Remote root directory: /home/osmocom-build/jenkins
  5. Launch Slave via SSH
  6. Prefix Start Slave Command (in "Advanced"): export PATH="$PATH:$HOME/bin" ;
  7. Username: osmocom-build
  8. Credentials: osmocom-build
  9. Node Properties: Environment Variables
    • PARALLEL_MAKE e.g "-j 8". This should match nproc / "# executors"
    • MAKE should be "make"

The labels are explained on

Add the new host to jenkins-jobs

There are jenkins jobs which run regular on the nodes to update certain osmocom components.

> ls osmo-ci/jobs/update-osmo-*
update-osmo-ci-on-slaves.yml  update-osmo-python-on-slaves.yml

You have to add your new hosts to both jobs.

Run afterwards

jenkins-jobs --conf jenkins-jobs.ini update update-osmo-ci-on-slaves.yml
jenkins-jobs --conf jenkins-jobs.ini update update-osmo-python-on-slaves.yml

And execute the jobs on jenkins.


To setup the osmo-gsm-tester which runs the osmo-gsm-tester.

ansible-playbook -i hosts setup-gsm-tester.yml

This will run ansible on all hosts in hosts section [gsm-tester].
However you can limit the hosts to be setup with

-l host

ansible-playbook -i hosts setup-gsm-tester.yml -l new-gmstester

Updated by osmith 9 months ago · 13 revisions

Add picture from clipboard (Maximum size: 48.8 MB)