There is a role in the roles/
directory called photon
. We will use that role form photon-playbook.yml
.
python3 -m virtualenv venv
. venv/bin/activate
pip3 install -r requirements.txt
ansible --help
ansible-galaxy install geerlingguy.docker
ssh-copy-id $photon-vm-host
su # enter root password here
/sbin/usermod -aG sudo $username
This is needed for ansible to be able to install docker and other stuff.
https://phpraxis.wordpress.com/2016/09/27/enable-sudo-without-password-in-ubuntudebian/
After executing sudo visudo
, add the following line at the end of the file.
ride2go ALL=(ALL) NOPASSWD:ALL
Before running anyplaybooks, make sure the corresponding inventory file (inventory-local.yml or inventory-remote.yml) cites the correct host, e.g.
$ cat inventory-remote.yml
all:
hosts:
photon-vm:
ansible_host: services1-photon # set ~/.ssh/config with ProxyJump
If you have a local VM, you can run the following make
command:
make photon-local
or for a remote VM use:
make photon-remote
After the ansible playbook has run successfully for the first time add the VM user to docker group
sudo usermod -aG docker $username
After nominatim data has been read and you see this line when typing docker logs nominatim
:
database system is ready to accept connections
, you must also start the photon service with:
sudo service photon start
After photon has read the nominatim data and you see this line:
de.komoot.photon.App - ES cluster is now ready.
You can call the API with:
curl "http://localhost:2322/api/?q=munchen&lang=de"
Some tasks are commented out for now (might change later):
- nginx
- pelias adapter
All needed languages is now set in the roles/photon/templates/photon.service
file as an environment variable called PHOTN_LANGUAGES.
There is a not so perfect solution for this, see: ./roles/photon/templates/remove-nominatim-and-photon
.