tileserver: new role to serve map tile
This commit is contained in:
parent
88e2c60888
commit
e7b55ce809
@ -14,4 +14,4 @@
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-compose
|
||||
- python-docker
|
||||
|
31
roles/tileserver/files/config.json
Normal file
31
roles/tileserver/files/config.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"options": {
|
||||
"paths": {
|
||||
"root": "/usr/src/app/node_modules/tileserver-gl-styles",
|
||||
"fonts": "fonts",
|
||||
"styles": "/data/styles",
|
||||
"mbtiles": "/data"
|
||||
},
|
||||
"formatQuality": {
|
||||
"jpeg": 80,
|
||||
"webp": 90
|
||||
}
|
||||
},
|
||||
"styles": {
|
||||
"day": {
|
||||
"style": "day.json",
|
||||
"tilejson": {
|
||||
}
|
||||
},
|
||||
"night": {
|
||||
"style": "night.json",
|
||||
"tilejson": {
|
||||
}
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"v3": {
|
||||
"mbtiles": "tiles.mbtiles"
|
||||
}
|
||||
}
|
||||
}
|
1750
roles/tileserver/files/styles/day.json
Normal file
1750
roles/tileserver/files/styles/day.json
Normal file
File diff suppressed because it is too large
Load Diff
1722
roles/tileserver/files/styles/night.json
Normal file
1722
roles/tileserver/files/styles/night.json
Normal file
File diff suppressed because it is too large
Load Diff
16
roles/tileserver/handlers/main.yml
Normal file
16
roles/tileserver/handlers/main.yml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
|
||||
- name: Restart tileserver
|
||||
docker_container:
|
||||
name: tileserver
|
||||
image: maptiler/tileserver-gl
|
||||
interactive: yes
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:8080"
|
||||
restart: yes
|
||||
restart_policy: unless-stopped
|
||||
state: started
|
||||
tty: yes
|
||||
volumes:
|
||||
- "/opt/tileserver:/data"
|
33
roles/tileserver/tasks/main.yml
Normal file
33
roles/tileserver/tasks/main.yml
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
|
||||
- name: Create data directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- /opt/tileserver
|
||||
- /opt/tileserver/styles
|
||||
|
||||
- name: Configre tileserver
|
||||
copy:
|
||||
src: "{{ item }}"
|
||||
dest: /opt/tileserver/{{ item }}
|
||||
with_items:
|
||||
- config.json
|
||||
- styles/day.json
|
||||
- styles/night.json
|
||||
notify: Restart tileserver
|
||||
|
||||
- name: Run tileserver container
|
||||
docker_container:
|
||||
name: tileserver
|
||||
image: maptiler/tileserver-gl
|
||||
interactive: yes
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:8080"
|
||||
restart_policy: unless-stopped
|
||||
state: started
|
||||
tty: yes
|
||||
volumes:
|
||||
- "/opt/tileserver:/data"
|
Loading…
Reference in New Issue
Block a user