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