blob: 4c80723b87ec291ba5bf454a31b82f0295e44da8 [file] [log] [blame]
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01001[[ansible]]
2== Ansible Setup
3
Pau Espin Pedrol94622f12020-03-11 19:21:30 +01004Since the set of steps to set up a full {app-name} environment can be quite long
5and tedious, nowadays the Osmocom RnD and Production {app-name} setups are
6installed and maintained using Ansible scripts. The set of ansible scripts is
7available in Osmocom's git repository
8link:https://git.osmocom.org/osmo-ci/[osmo-ci.git] under 'ansible' subdirectory,
9with the rest of ansible scripts to set jenkins slaves, etc.
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010010
Pau Espin Pedrol94622f12020-03-11 19:21:30 +010011Since these set of scripts is mainly aimed at Osmocom's own setup, and debian is
12used there, so far only debian hosts are supported officially, though patches to
13support other distributions are welcome.
14
15In there, the 'setup-gsm-tester.yml' file is responsible of doing all required
16steps to set up a host to become either a <<install_main_unit,Main Unit>> or a a
17<<install_slave_unit,Slave Unit>>. The ansible file can be run as follows:
18----
19$ ansible-playbook -i hosts setup-gsm-tester.yml
20----
21
22You will need root-alike access in the remote host in order to let ansible
23install everything {app-name}, however, no root-specific user is required as
24long as your remote user has sudo access on that host. If that's your case, add
25the following parameters to 'ansible-playbook':
26----
27$ ansible-playbook -i hosts -b -K -u your_remote_user setup-gsm-tester.yml
28----
29
30The 'setup-gsm-tester.yml' file is mostly an aggregator of tasks. Most
31{app-name} related tasks can be found under subdirectory 'roles/gsm-tester-*'.
32
33Since different (for instance Production vs RnD) can have different
34characteristics, some per-host variables can be found under directory
35host_vars/, specifying for instance the number of expected modems attached to
36the Main Unit, the DHCP server static leasing for devices, etc.
37
38The different tasks usually have tags to differentiate which kind of {app-name}
39host they are required by. They are also set to differentiate sets of tasks
40required if a specific feature is being used in the host (for instance, willing
41to manage modems with ofono). This allows playing with the '-t' and
42'--skip-tags' when running 'ansible-playbooks' in order to run specific set of
43tasks on each host.
44
45For instance, to run tasks required to set up a Slave Unit, one can run:
46----
47$ ansible-playbook -i hosts setup-gsm-tester.yml -t osmo-gsm-tester-proc
48----
49
50To run all modem-related tasks:
51----
52$ ansible-playbook -i hosts setup-gsm-tester.yml -t modem
53----
54
55Don't forget to read all README.md files available in different subdirectories
56to find out more detailed information on how to run the scripts.