mirror of https://gerrit.osmocom.org/osmo-ci
add ansible playbooks
Introduce playbooks to do: - setup-jenkins-slave - setup a usualy or special jenkins-slave - setup-gsm-tester - setup the gsm-tester Change-Id: I7007a4e6c38f73843390ec2b3b91133aff21e36a
This commit is contained in:
parent
0765327601
commit
196402ac65
|
@ -0,0 +1,5 @@
|
||||||
|
poky-*
|
||||||
|
cov-analysis-*.tar.gz
|
||||||
|
*.retry
|
||||||
|
*.swo
|
||||||
|
*.swp
|
|
@ -0,0 +1,23 @@
|
||||||
|
Place 3rd party firmware/sdk files here.
|
||||||
|
|
||||||
|
# role: gsm-tester-modems
|
||||||
|
|
||||||
|
```
|
||||||
|
./gobi
|
||||||
|
./gobi/UQCN.mbn
|
||||||
|
./gobi/amss.mbn
|
||||||
|
./gobi/apps.mbn
|
||||||
|
```
|
||||||
|
|
||||||
|
# role: install-coverity
|
||||||
|
|
||||||
|
The filename depends on the variable `coverity_version`.
|
||||||
|
`coverity_version: 2017.07`
|
||||||
|
|
||||||
|
E.g: `./cov-analysis-linux64-2017.07.tar.gz`
|
||||||
|
|
||||||
|
# role: install-poky-sdk
|
||||||
|
|
||||||
|
The filename depends on the variable `poky_installer_file`.
|
||||||
|
|
||||||
|
`./poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.2.sh`
|
|
@ -0,0 +1,11 @@
|
||||||
|
[gsm-tester]
|
||||||
|
# rnd
|
||||||
|
10.9.25.101
|
||||||
|
# production
|
||||||
|
10.9.25.107
|
||||||
|
|
||||||
|
[jenkins-slaves]
|
||||||
|
# admin2-deb9build
|
||||||
|
2a01:4f8:13b:828::1:300
|
||||||
|
# admin2-deb8build
|
||||||
|
2a01:4f8:13b:828::1:400
|
|
@ -0,0 +1 @@
|
||||||
|
# Install docker for debian
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# Adds this user to the group docker which is allowed to access docker
|
||||||
|
jenkins_user: jenkins
|
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: add https support
|
||||||
|
apt:
|
||||||
|
name: apt-transport-https
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: add docker gpg key to apt keyring
|
||||||
|
apt_key:
|
||||||
|
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||||||
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
|
|
||||||
|
- apt_repository:
|
||||||
|
repo: "deb https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
when: ansible_distribution == "Debian"
|
||||||
|
|
||||||
|
- name: install docker
|
||||||
|
apt:
|
||||||
|
name: docker-ce
|
||||||
|
|
||||||
|
- name: add jenkins to the docker group
|
||||||
|
user:
|
||||||
|
name: "{{ jenkins_user }}"
|
||||||
|
groups: docker
|
||||||
|
append: yes
|
|
@ -0,0 +1 @@
|
||||||
|
# Install drivers for multiple modems or BTS's
|
|
@ -0,0 +1,45 @@
|
||||||
|
---
|
||||||
|
# modems
|
||||||
|
- name: install dependecies for usrp
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- libuhd-dev
|
||||||
|
- uhd-host
|
||||||
|
register: uhd_installed
|
||||||
|
|
||||||
|
- name: download firmware for uhd/usrp
|
||||||
|
command: uhd_images_downloader
|
||||||
|
args:
|
||||||
|
creates: /usr/share/uhd/images
|
||||||
|
when: uhd_installed | changed
|
||||||
|
|
||||||
|
- name: allow jenkins to access USRP
|
||||||
|
user:
|
||||||
|
name: jenkins
|
||||||
|
groups: usrp
|
||||||
|
append: yes
|
||||||
|
|
||||||
|
- name: install gobi2000 packages
|
||||||
|
apt:
|
||||||
|
name: gobi-loader
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: gobi firmwares
|
||||||
|
file: path=/lib/firmware/gobi state=directory
|
||||||
|
|
||||||
|
- name: copy gobi firmwares
|
||||||
|
copy:
|
||||||
|
src: "{{ item.file }}"
|
||||||
|
dest: "/lib/firmware/{{ item.file }}"
|
||||||
|
with_items:
|
||||||
|
- file: gobi/amss.mbn
|
||||||
|
checksum: sha256:18d161dc5e9db5e795b1f1026e47d0590b6cc0ed9bef824ac0c4b771b529c364
|
||||||
|
- file: gobi/apps.mbn
|
||||||
|
checksum: sha256:cd7d9adaccf59f02b3bc8261334ed83c7644fbdbf697055189533467d6c882b2
|
||||||
|
- file: gobi/UQCN.mbn
|
||||||
|
checksum: sha256:37dfc789f899d0ec4c8ba2c403a1a4bc266c9017c94f2b90912e1b7e978c42e7
|
||||||
|
ignore_errors: yes
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Setup setup specific configurations
|
||||||
|
|
||||||
|
The network configuration is not set by default.
|
||||||
|
|
||||||
|
# variables
|
||||||
|
|
||||||
|
- `bts_interface` (eth1): on which network interface the bts is configured.
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
bts_interface: eth1
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: setup the network configuration
|
||||||
|
template:
|
||||||
|
src: interface.j2
|
||||||
|
dest: /etc/network/interfaces.d/gsm-tester
|
|
@ -0,0 +1,56 @@
|
||||||
|
|
||||||
|
auto {{ bts_interface }}
|
||||||
|
iface {{ bts_interface }} inet static
|
||||||
|
address 10.42.42.1
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:0
|
||||||
|
iface {{ bts_interface }}:0 inet static
|
||||||
|
address 10.42.42.2
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:1
|
||||||
|
iface {{ bts_interface }}:1 inet static
|
||||||
|
address 10.42.42.3
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:2
|
||||||
|
iface {{ bts_interface }}:2 inet static
|
||||||
|
address 10.42.42.4
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:3
|
||||||
|
iface {{ bts_interface }}:3 inet static
|
||||||
|
address 10.42.42.5
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:4
|
||||||
|
iface {{ bts_interface }}:4 inet static
|
||||||
|
address 10.42.42.6
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:5
|
||||||
|
iface {{ bts_interface }}:5 inet static
|
||||||
|
address 10.42.42.7
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:6
|
||||||
|
iface {{ bts_interface }}:6 inet static
|
||||||
|
address 10.42.42.8
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:7
|
||||||
|
iface {{ bts_interface }}:7 inet static
|
||||||
|
address 10.42.42.9
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:8
|
||||||
|
iface {{ bts_interface }}:8 inet static
|
||||||
|
address 10.42.42.50
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
||||||
|
auto {{ bts_interface }}:9
|
||||||
|
iface {{ bts_interface }}:9 inet static
|
||||||
|
address 10.42.42.51
|
||||||
|
netmask 255.255.255.0
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# how many modem are connected?
|
||||||
|
# This is used when reseting the modems via quad_modem_power_cycle.sh,
|
||||||
|
# because some modems take longer and the script waits until all
|
||||||
|
# modems connected
|
||||||
|
gsm_modems: 4
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!-- Additional rules for the osmo-gsm-tester to access org.ofono from user
|
||||||
|
land -->
|
||||||
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
<policy group="osmo-gsm-tester">
|
||||||
|
<allow send_destination="org.ofono"/>
|
||||||
|
</policy>
|
||||||
|
</busconfig>
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
/sbin/setcap cap_net_admin+ep "$1"
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/sbin/setcap cap_net_raw+ep "$1"
|
|
@ -0,0 +1,244 @@
|
||||||
|
---
|
||||||
|
# gsm tester would only need the libraries, not the dev packages.
|
||||||
|
# But the name of the -dev packages are more stable over multiple release.
|
||||||
|
- name: install osmocom runtime dependencies
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- build-essential
|
||||||
|
- git
|
||||||
|
- automake
|
||||||
|
- libdbi-dev
|
||||||
|
- libdbd-sqlite3
|
||||||
|
- sqlite3
|
||||||
|
- libsctp-dev
|
||||||
|
- libortp-dev
|
||||||
|
- libpcap-dev
|
||||||
|
- libc-ares-dev
|
||||||
|
- libtool
|
||||||
|
- shtool
|
||||||
|
- pkg-config
|
||||||
|
- libtalloc-dev
|
||||||
|
- libpcsclite-dev
|
||||||
|
- libgnutls28-dev
|
||||||
|
- libmnl-dev
|
||||||
|
- libssl-dev
|
||||||
|
- libczmq-dev
|
||||||
|
- libsofia-sip-ua-glib-dev
|
||||||
|
- libsqlite3-dev
|
||||||
|
- libasound2-dev
|
||||||
|
- mdbus2
|
||||||
|
|
||||||
|
- name: install ofono build dependencies
|
||||||
|
apt:
|
||||||
|
name: ofono
|
||||||
|
state: build-dep
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: install libqmi-glib a dependency of sysmocom ofono
|
||||||
|
apt:
|
||||||
|
name: libqmi-glib-dev
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: install uhub dependencies
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- libusb-1.0-0-dev
|
||||||
|
|
||||||
|
- name: setup uhubctl repository
|
||||||
|
git:
|
||||||
|
repo: "https://github.com/mvp/uhubctl.git"
|
||||||
|
dest: /root/uhubctl
|
||||||
|
version: master
|
||||||
|
clone: yes
|
||||||
|
update: no
|
||||||
|
|
||||||
|
- name: build uhubctl
|
||||||
|
shell: |
|
||||||
|
make && \
|
||||||
|
make install
|
||||||
|
args:
|
||||||
|
chdir: /root/uhubctl
|
||||||
|
creates: /usr/sbin/uhubctl
|
||||||
|
|
||||||
|
# TODO: move this into restart-modems.d directory
|
||||||
|
- name: copy quad_modem_power_cycle.sh
|
||||||
|
template:
|
||||||
|
src: quad_modem_power_cycle.sh
|
||||||
|
dest: /usr/local/bin/quad_modem_power_cycle.sh
|
||||||
|
mode: 0755
|
||||||
|
tags:
|
||||||
|
- ofono
|
||||||
|
|
||||||
|
- name: setup ofono repository
|
||||||
|
git:
|
||||||
|
repo: 'git://git.sysmocom.de/ofono'
|
||||||
|
dest: /root/ofono
|
||||||
|
version: osmo-gsm-tester
|
||||||
|
clone: yes
|
||||||
|
update: no
|
||||||
|
tags:
|
||||||
|
- ofono
|
||||||
|
|
||||||
|
- name: build ofono
|
||||||
|
shell: |
|
||||||
|
./bootstrap && \
|
||||||
|
CFLAGS="-g" ./configure --disable-bluez4 && \
|
||||||
|
CFLAGS="-g" make -j3 && \
|
||||||
|
make install && \
|
||||||
|
systemctl daemon-reload
|
||||||
|
args:
|
||||||
|
chdir: /root/ofono
|
||||||
|
creates: /usr/local/sbin/ofonod
|
||||||
|
tags:
|
||||||
|
- ofono
|
||||||
|
|
||||||
|
- name: ensure ofono is started
|
||||||
|
service:
|
||||||
|
name: ofono
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
tags:
|
||||||
|
- ofono
|
||||||
|
|
||||||
|
- name: install gsm tester dependencies
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- dbus
|
||||||
|
- tcpdump
|
||||||
|
- sqlite3
|
||||||
|
- python3
|
||||||
|
- python3-yaml
|
||||||
|
- python3-mako
|
||||||
|
- python3-gi
|
||||||
|
- ofono
|
||||||
|
- patchelf
|
||||||
|
- sudo
|
||||||
|
- libcap2-bin
|
||||||
|
- python3-pip
|
||||||
|
|
||||||
|
- name: install gsm tester pip dependencies
|
||||||
|
pip:
|
||||||
|
name: "{{ item }}"
|
||||||
|
executable: pip3
|
||||||
|
editable: no
|
||||||
|
with_items:
|
||||||
|
- "git+https://github.com/podshumok/python-smpplib.git@master#egg=smpplib"
|
||||||
|
- pydbus
|
||||||
|
tags: [pip]
|
||||||
|
|
||||||
|
- name: create group osmo-gsm-tester
|
||||||
|
group:
|
||||||
|
name: osmo-gsm-tester
|
||||||
|
|
||||||
|
- name: add jenkins to osmo-gsm-tester and systemd-journal
|
||||||
|
user:
|
||||||
|
name: jenkins
|
||||||
|
groups: "{{ item }}"
|
||||||
|
append: yes
|
||||||
|
shell: /bin/bash
|
||||||
|
with_items:
|
||||||
|
- systemd-journal
|
||||||
|
- osmo-gsm-tester
|
||||||
|
|
||||||
|
- name: setup state directory
|
||||||
|
file:
|
||||||
|
path: /var/tmp/osmo-gsm-tester/state
|
||||||
|
state: directory
|
||||||
|
group: osmo-gsm-tester
|
||||||
|
mode: g+rwxs
|
||||||
|
|
||||||
|
- name: install acl
|
||||||
|
apt:
|
||||||
|
name: acl
|
||||||
|
|
||||||
|
# Ensure the group always has access to all files
|
||||||
|
- name: add acl to state directory
|
||||||
|
acl:
|
||||||
|
path: /var/tmp/osmo-gsm-tester/state
|
||||||
|
state: present
|
||||||
|
etype: group
|
||||||
|
entity: osmo-gsm-tester
|
||||||
|
default: yes
|
||||||
|
permissions: rwx
|
||||||
|
|
||||||
|
- name: create trials directory
|
||||||
|
file:
|
||||||
|
path: /var/tmp/osmo-gsm-tester/trials
|
||||||
|
state: directory
|
||||||
|
group: osmo-gsm-tester
|
||||||
|
mode: g+rwxs
|
||||||
|
|
||||||
|
- name: allow osmo-gsm-tester to access ofono
|
||||||
|
copy:
|
||||||
|
src: dbus_osmo-gsm-tester.conf
|
||||||
|
dest: /etc/dbus-1/system.d/osmo-gsm-tester.conf
|
||||||
|
|
||||||
|
- name: ensure tcpdump can be called by osmo-gsm-tester
|
||||||
|
file:
|
||||||
|
path: /usr/sbin/tcpdump
|
||||||
|
group: osmo-gsm-tester
|
||||||
|
mode: 750
|
||||||
|
|
||||||
|
- name: create a symlink for tcpdump
|
||||||
|
file:
|
||||||
|
src: /usr/sbin/tcpdump
|
||||||
|
dest: /usr/local/bin/tcpdump
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: add correct capabilities to tcpdump
|
||||||
|
capabilities:
|
||||||
|
path: /usr/sbin/tcpdump
|
||||||
|
capability: cap_net_raw,cap_net_admin=eip
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: allow core files for the group osmo-gsm-tester
|
||||||
|
copy:
|
||||||
|
content: "@osmo-gsm-tester - core unlimited"
|
||||||
|
dest: /etc/security/limits.d/osmo-gsm-tester_allowcore.conf
|
||||||
|
|
||||||
|
- name: allow rt priority for the group osmo-gsm-tester
|
||||||
|
copy:
|
||||||
|
content: "@osmo-gsm-tester - rtprio 99"
|
||||||
|
dest: /etc/security/limits.d/osmo-gsm-tester_rtprio.conf
|
||||||
|
|
||||||
|
- name: create a wrapper script to add CAP_NET_RAW
|
||||||
|
copy:
|
||||||
|
src: osmo-gsm-tester_setcap_net_raw.sh
|
||||||
|
dest: /usr/local/bin/osmo-gsm-tester_setcap_net_raw.sh
|
||||||
|
mode: 755
|
||||||
|
|
||||||
|
- name: allow osmo-gsm-tester sudo osmo-gsm-tester_setcap_net_raw.sh
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
%osmo-gsm-tester ALL=(root) NOPASSWD: /usr/local/bin/osmo-gsm-tester_setcap_net_raw.sh
|
||||||
|
dest: /etc/sudoers.d/osmo-gsm-tester_setcap_net_raw
|
||||||
|
mode: 0440
|
||||||
|
|
||||||
|
- name: create a wrapper script to add CAP_NET_ADMIN
|
||||||
|
copy:
|
||||||
|
src: osmo-gsm-tester_setcap_net_admin.sh
|
||||||
|
dest: /usr/local/bin/osmo-gsm-tester_setcap_net_admin.sh
|
||||||
|
mode: 755
|
||||||
|
|
||||||
|
- name: allow osmo-gsm-tester sudo osmo-gsm-tester_setcap_net_admin.sh
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
%osmo-gsm-tester ALL=(root) NOPASSWD: /usr/local/bin/osmo-gsm-tester_setcap_net_admin.sh
|
||||||
|
dest: /etc/sudoers.d/osmo-gsm-tester_setcap_net_admin
|
||||||
|
mode: 0440
|
||||||
|
|
||||||
|
- name: logrotate limit filesizes to 10M
|
||||||
|
copy:
|
||||||
|
content: "maxsize 10M"
|
||||||
|
dest: /etc/logrotate.d/maxsize
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -ex
|
||||||
|
uhubctl -p 123456 -a 0
|
||||||
|
# give a lot of time to discharge capacitors on the board
|
||||||
|
sleep 20
|
||||||
|
uhubctl -p 123456 -a 1
|
||||||
|
attempts=30
|
||||||
|
while [ "x$(uhubctl | grep -e 05c6 -e 1199 -c)" != "x{{ gsm_modems }}" ]; do
|
||||||
|
attempts=$(($attempts - 1))
|
||||||
|
if [ "$attempts" -le 0 ]; then
|
||||||
|
echo "Timeout"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
uhubctl
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Install coverity compiler
|
||||||
|
|
||||||
|
Install the coverity compiler to /opt/coverity/cover..-$version/ and
|
||||||
|
create a link to /opt/coverity/current
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
coverity_version: 2017.07
|
||||||
|
coverity_installer_file: "cov-analysis-linux64-{{ coverity_version }}.tar.gz"
|
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
- name: copy coverity installer
|
||||||
|
copy:
|
||||||
|
src: "{{ coverity_installer_file }}"
|
||||||
|
dest: "/tmp/{{ coverity_installer_file }}"
|
||||||
|
mode: 750
|
||||||
|
register: coverity_copy
|
||||||
|
ignore_errors: yes
|
||||||
|
tags: [coverity]
|
||||||
|
|
||||||
|
- name: create /opt/coverity
|
||||||
|
file:
|
||||||
|
path: /opt/coverity/
|
||||||
|
state: directory
|
||||||
|
when: coverity_copy.failed == False
|
||||||
|
tags: [coverity]
|
||||||
|
|
||||||
|
- name: unpack coverity
|
||||||
|
unarchive:
|
||||||
|
src: "/tmp/{{ coverity_installer_file }}"
|
||||||
|
dest: /opt/coverity/
|
||||||
|
remote_src: yes
|
||||||
|
when: coverity_copy.failed == False
|
||||||
|
tags: [coverity]
|
||||||
|
|
||||||
|
- name: create link /opt/coverity/last
|
||||||
|
file:
|
||||||
|
src: /opt/coverity/cov-analysis-linux64-{{ coverity_version }}
|
||||||
|
dest: /opt/coverity/current
|
||||||
|
state: link
|
||||||
|
when: coverity_copy.failed == False
|
||||||
|
tags: [coverity]
|
||||||
|
|
||||||
|
- name: "Please download {{ coverity_installer_file }} to your ansible directory to allow ansible to install coverity"
|
||||||
|
debug:
|
||||||
|
msg: "Ansible can not find {{ coverity_installer_file }}"
|
||||||
|
when: coverity_copy.failed
|
||||||
|
tags: [coverity]
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Install the poky sdk used to build sysmobts binaries
|
||||||
|
|
||||||
|
# Poky Installation
|
||||||
|
|
||||||
|
The poky installation requires you to have the installer available.
|
||||||
|
Put the `poky_installer_file` to the root directory of this repo.
|
||||||
|
Also the exact filename must match the variable `poky_installer_file` and the
|
||||||
|
`poky_version`.
|
||||||
|
For the defaults of those variable have a look into `defaults/main.yml`.
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
# OS user
|
||||||
|
jenkins_user: jenkins
|
||||||
|
|
||||||
|
poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.2.sh
|
||||||
|
poky_version: 2.3.2
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: install bzip2 and tar
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- tar
|
||||||
|
- bzip2
|
||||||
|
|
||||||
|
- name: copy poky installer
|
||||||
|
copy:
|
||||||
|
src: "{{ poky_installer_file }}"
|
||||||
|
dest: "/tmp/{{ poky_installer_file }}"
|
||||||
|
mode: 750
|
||||||
|
register: poky_copy
|
||||||
|
ignore_errors: yes
|
||||||
|
tags: [poky]
|
||||||
|
|
||||||
|
- name: execute poky installer
|
||||||
|
command: "/tmp/{{ poky_installer_file }}"
|
||||||
|
args:
|
||||||
|
creates: "/opt/poky/{{ poky_version }}"
|
||||||
|
when: poky_copy.failed == false
|
||||||
|
tags: [poky]
|
||||||
|
|
||||||
|
- name: change owner/group to jenkins user
|
||||||
|
file:
|
||||||
|
path: /opt/poky
|
||||||
|
owner: "{{ jenkins_user }}"
|
||||||
|
group: "{{ jenkins_user }}"
|
||||||
|
recurse: yes
|
||||||
|
when: poky_copy.failed == false
|
||||||
|
tags: [poky]
|
||||||
|
|
||||||
|
- name: "Please download {{ poky_installer_file }} to your ansible directory to allow ansible to install poky"
|
||||||
|
debug:
|
||||||
|
msg: "Ansible can not find or copy {{ poky_installer_file }}"
|
||||||
|
when: poky_copy.failed
|
||||||
|
tags: [poky]
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Setup a usual jenkins slave
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# OS user
|
||||||
|
jenkins_user: jenkins
|
||||||
|
|
||||||
|
# E.g. a generic_slave requires different tasks as a
|
||||||
|
# special slave including the gsm-tester
|
||||||
|
generic_slave: true
|
|
@ -0,0 +1,3 @@
|
||||||
|
[user]
|
||||||
|
email = jenkins@osmocom.org
|
||||||
|
name = Jenkins Builder
|
|
@ -0,0 +1,2 @@
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzO4QUn9kFMqNz40HAhVZR/7juHGTeqjkpZ3km+9zngJNkh4Oxds0rCSrvxIxdM2ZQpcKHbBt0X30o+Dk7428IlmG3VYZ5XBskl2XsjOJG8uXjAMzEOejnOr6poZtor7qgxLwcZT0R2RoGED49DSmPpEPcKZmcIGQVJXB/ifPJOpjTiyjMxXccc5tlKS5jqHSLhUBX0EpPxcuLc0v0QG14fNJ75KygF+xXCKJ8h2/f1JPQRupPD7ZhjMJo3KFzvRttQDoM9PdXdND70zWY7Ntdu9vsqRoO3IeyqtgNSly3wYlsZNcTBW0T2TFtnkvWjbdrV3Hl6h9c8WDzbwI4Lvt9 root@jenkins.osmocom.org
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6pjj0xKkxAN9e76T3h8+4GYfHMQ9XojCc4PQ42uQbnlX3zn+KtAXeeGN4QTDOWGdxz1kyQ/FpM08AqmWW1QZ4wPJBEgDVSfpEX/motagxxTKlIsoeCYDEqEdT5qiY/W7gVaKj+WGEpiIrLHU18m0fouuHdclBy/MXwhMvIowEpOjVoEYvnyuMoagrCkzaFMdZbljmYJN/eyuJvx0Bus7Vy6p8m+xcRSgA4Fy+yVyrpPlZU7pksd+YLUDaYE2E5Y68ZdMwnOxToLV4RwOZB4sWozCeQ38pKKXFNSpLpNh/uDKEN5T8M+Ft8vfAj5OW5VnqsFW0TxnNE8qEZs8mBK/5ij9KF5p5kgJ8dmww0srZie1YdBg3wmJ6FBv+ti/wfWrpo2kp5iRxd52xuOBJQnFONoi2w9VuHDtG/ZxC12owTLXGUJVoQyLVfyYBG8zLj1Or28MWBLUyWt3YsB99jRt/i612AZ5eyW2SZVnRBF7KlGqf0thCnq/tQPtZKvQqenRaXDRm+/Sh7bm8fxBR1vA7LiUyQz84qzrmiECO15FrorKRR+3enuI+xHb1HFn2ZE19LrK/tXzz3DYcUlhPRVzRpxncf8frX9QnA5d2Ytij3bcoMK6RqXFsRg5JMNBcbk4Uvdf479nfb6QLe3AUEtuSN2LaGS//eMmCfBCIpjvPWQ== osmocom-build
|
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: install jenkins utilities
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- htop
|
||||||
|
- virt-manager
|
||||||
|
- qemu
|
||||||
|
- qemu-user-static
|
||||||
|
- qemu-system-arm
|
||||||
|
- proot
|
||||||
|
- debootstrap
|
||||||
|
- fakeroot
|
||||||
|
|
||||||
|
- name: enable backports for jessie
|
||||||
|
apt_repository:
|
||||||
|
repo: 'deb http://ftp.debian.org/debian jessie-backports main'
|
||||||
|
filename: 'backports'
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: install java for jessie
|
||||||
|
apt:
|
||||||
|
name: openjdk-8-jre-headless
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
default_release: jessie-backports
|
||||||
|
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'
|
||||||
|
|
||||||
|
- name: install java for stretch
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- openjdk-8-jre-headless
|
||||||
|
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'stretch'
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: chown /usr/local/ to the jenkins user
|
||||||
|
file:
|
||||||
|
path: /usr/local/
|
||||||
|
recurse: yes
|
||||||
|
group: "{{ jenkins_user }}"
|
||||||
|
mode: "2775"
|
||||||
|
|
||||||
|
- name: set jenkins user bin to osmo-ci
|
||||||
|
file:
|
||||||
|
src: "/home/{{ jenkins_user }}/osmo-ci/scripts"
|
||||||
|
dest: "/home/{{ jenkins_user }}/bin"
|
||||||
|
state: link
|
||||||
|
force: yes
|
|
@ -0,0 +1,102 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: install jenkins packages
|
||||||
|
include: debian.yml
|
||||||
|
when: ansible_distribution == 'Debian'
|
||||||
|
|
||||||
|
- name: install build utilities
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- asciidoc
|
||||||
|
- autoconf
|
||||||
|
- automake
|
||||||
|
- bc
|
||||||
|
- bison
|
||||||
|
- coccinelle
|
||||||
|
- cppcheck
|
||||||
|
- debhelper
|
||||||
|
- devscripts
|
||||||
|
- dh-autoreconf
|
||||||
|
- dh-systemd
|
||||||
|
- doxygen
|
||||||
|
- flex
|
||||||
|
- g++
|
||||||
|
- gawk
|
||||||
|
- gcc
|
||||||
|
- gcc-arm-none-eabi
|
||||||
|
- git
|
||||||
|
- git-buildpackage
|
||||||
|
- libtool
|
||||||
|
- libboost-all-dev
|
||||||
|
- make
|
||||||
|
- mscgen
|
||||||
|
- osc
|
||||||
|
- pkgconf
|
||||||
|
- python-minimal
|
||||||
|
- python-setuptools
|
||||||
|
- python3
|
||||||
|
- python3-setuptools
|
||||||
|
- stow
|
||||||
|
- texinfo
|
||||||
|
|
||||||
|
- name: install build dependencies and libraries
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- libc-ares-dev
|
||||||
|
- libdbd-sqlite3
|
||||||
|
- libdbi-dev
|
||||||
|
- libffi-dev
|
||||||
|
- libffi-dev
|
||||||
|
- libfftw3-dev
|
||||||
|
- libgmp-dev
|
||||||
|
- libgnutls28-dev
|
||||||
|
- libgps-dev
|
||||||
|
- libgsm1-dev
|
||||||
|
- libmnl-dev
|
||||||
|
- libncurses5-dev
|
||||||
|
- libortp-dev
|
||||||
|
- libpcap-dev
|
||||||
|
- libpcsclite-dev
|
||||||
|
- libreadline-dev
|
||||||
|
- libsctp-dev
|
||||||
|
- libsigsegv-dev
|
||||||
|
- libsnmp-dev
|
||||||
|
- libsofia-sip-ua-glib-dev
|
||||||
|
- libsqlite3-dev
|
||||||
|
- libssl-dev
|
||||||
|
- libsystemd-dev
|
||||||
|
- libtalloc-dev
|
||||||
|
- libusb-1.0-0-dev
|
||||||
|
- libusb-dev
|
||||||
|
- libzmq3-dev
|
||||||
|
- sqlite3
|
||||||
|
- libboost-dev
|
||||||
|
- libuhd-dev
|
||||||
|
|
||||||
|
- name: add user jenkins
|
||||||
|
user:
|
||||||
|
name: "{{ jenkins_user }}"
|
||||||
|
generate_ssh_key: yes
|
||||||
|
ssh_key_bits: 4096
|
||||||
|
ssh_key_type: rsa
|
||||||
|
shell: /bin/bash
|
||||||
|
|
||||||
|
- name: setup jenkins ssh key
|
||||||
|
authorized_key:
|
||||||
|
user: "{{ jenkins_user }}"
|
||||||
|
key: "{{ lookup('file', 'jenkins.osmocom.org.pub') }}"
|
||||||
|
|
||||||
|
- name: include generic slave
|
||||||
|
include: generic-slave.yml
|
||||||
|
when: generic_slave
|
||||||
|
|
||||||
|
- name: copy .gitconfig
|
||||||
|
copy:
|
||||||
|
src: gitconfig
|
||||||
|
dest: "/home/{{ jenkins_user }}/.gitconfig"
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Setup the osmo-gsm-tester
|
||||||
|
|
||||||
|
The playbook `setup-gsm-tester.yml` setup a full working osmo-gsm-tester.
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
|
||||||
|
The remote host needs to be added to the `hosts` file under the section `osmo-gsm-tester`.
|
||||||
|
It also needs to install python and have the **contrib non-free** repositories enabled in `/etc/apt/sources.list`.
|
||||||
|
|
||||||
|
## 3rd party firmware
|
||||||
|
|
||||||
|
To have the non-free gobi firmware installed, those files must be placed
|
||||||
|
files/gobi/UQCN.mbn
|
||||||
|
files/gobi/amss.mbn
|
||||||
|
files/gobi/apps.mbn
|
||||||
|
|
||||||
|
|
||||||
|
# Steps after the playbook ran
|
||||||
|
|
||||||
|
The jenkins user needs to know the ssh-keys of all BTS which get accessed via ssh.
|
||||||
|
E.g. the gsm-tester is connecting to a sysmobts via ssh.
|
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
- name: setup osmo-gsm-tester apu
|
||||||
|
hosts: gsm-tester
|
||||||
|
user: root
|
||||||
|
tasks:
|
||||||
|
- name: install common utilities
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- vim
|
||||||
|
- tmux
|
||||||
|
- screen
|
||||||
|
- ca-certificates
|
||||||
|
- wget
|
||||||
|
- curl
|
||||||
|
roles:
|
||||||
|
- name: gsm-tester
|
||||||
|
# how many modems are connected via a quadmodem?
|
||||||
|
gsm_modems: 4
|
||||||
|
tags:
|
||||||
|
- gsm-tester
|
||||||
|
|
||||||
|
- name: gsm-tester-modems
|
||||||
|
tags:
|
||||||
|
- gsm-tester
|
||||||
|
- gsm-tester-modems
|
||||||
|
|
||||||
|
- name: gsm-tester-network
|
||||||
|
bts_interface: enp2s0
|
||||||
|
tags:
|
||||||
|
- gsm-tester
|
||||||
|
|
||||||
|
- name: osmocom-jenkins-slave
|
||||||
|
jenkins_user: jenkins
|
||||||
|
generic_slave: false
|
||||||
|
tags:
|
||||||
|
- jenkins-slave
|
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
- name: setup jenkins slaves
|
||||||
|
hosts: jenkins-slaves
|
||||||
|
user: root
|
||||||
|
tasks:
|
||||||
|
- name: install common utilities
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
cache_valid_time: 3600
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- vim
|
||||||
|
- tmux
|
||||||
|
- screen
|
||||||
|
- ca-certificates
|
||||||
|
roles:
|
||||||
|
- name: docker
|
||||||
|
jenkins_user: osmocom-build
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
- name: install-poky-sdk
|
||||||
|
jenkins_user: osmocom-build
|
||||||
|
tags:
|
||||||
|
- poky
|
||||||
|
|
||||||
|
- name: osmocom-jenkins-slave
|
||||||
|
jenkins_user: osmocom-build
|
||||||
|
generic_slave: true
|
||||||
|
tags:
|
||||||
|
- jenkins-slave
|
||||||
|
|
||||||
|
- name: install-coverity
|
||||||
|
tags:
|
||||||
|
- coverity
|
Loading…
Reference in New Issue