Skip to content

Commit 2a7d8fb

Browse files
committed
Update to Debian 9, Ubuntu 16.04 & 18.04 LTS. Add LoRa Geo Server.
1 parent 317e7b8 commit 2a7d8fb

File tree

19 files changed

+83
-54
lines changed

19 files changed

+83
-54
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# LoRa Server setup
22

33
This repository provides an [Ansible](https://www.ansible.com) playbook to
4-
setup the [LoRa Server](https://github.com/brocaar/loraserver)
4+
setup the [LoRa Server](https://www.loraserver.io/).
55
project (including dependencies). With the included
66
[Vagrant](https://www.vagrant.com) file, the LoRa Server can also be setup
77
locally (e.g. on [VirtualBox](https://www.virtualbox.org)).
@@ -12,9 +12,10 @@ It will:
1212
* Setup Mosquitto (MQTT broker) + connection credentials
1313
* Setup Redis
1414
* Setup PostgreSQL + creation of roles and databases
15-
* Setup [LoRa Gateway Bridge](https://github.com/brocaar/lora-gateway-bridge)
16-
* Setup [LoRa Server](https://github.com/brocaar/loraserver)
17-
* Setup [LoRa App Server](https://github.com/brocaar/lora-app-server)
15+
* Setup [LoRa Gateway Bridge](https://www.loraserver.io/lora-gateway-bridge/)
16+
* Setup [LoRa Server](https://www.loraserver.io/loraserver/)
17+
* Setup [LoRa App Server](https://www.loraserver.io/lora-app-server/)
18+
* Setup [LoRa Geo Server](https://www.loraserver.io/lora-geo-server/)
1819
* Request a HTTPS certificate from [Let's Encrypt](https://letsencrypt.org)
1920

2021
## Vagrant (local environment using VirtualBox)
@@ -105,11 +106,11 @@ for more installation instructions.
105106
The Ansible playbook has been tested on the following images:
106107

107108
* Debian
108-
* Jessie (8.7)
109+
* Stretch (9.x)
109110

110111
* Ubuntu
111-
* Trusty (14.04.x LTS)
112112
* Xenial (16.04.x LTS)
113+
* Bionic (18.04.x LTS)
113114

114115
### Configuration
115116

@@ -157,6 +158,13 @@ https://yourdomain.com/ (please note the http*s*).
157158

158159
## Changelog (playbook changes)
159160

161+
### 2018-09-17
162+
163+
* Updated playbook to support Ubuntu 18.04.x, 16.04.x and Debian Stretch (9.x).
164+
* `postgresql` package is always installed from distribution repository.
165+
* `mosquitto` package is always installed from distribution repository.
166+
* Added installation of LoRa Geo Server service.
167+
160168
### 2018-07-30
161169

162170
* Change to LoRa Server v2 apt repository.

Vagrantfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
Vagrant.configure("2") do |config|
55
config.vm.define "vagrant" do |box|
6-
box.vm.box = "ubuntu/xenial64"
7-
# box.vm.box = "ubuntu/trusty64"
8-
# box.vm.box = "debian/contrib-jessie64"
6+
box.vm.box = "debian/contrib-stretch64"
7+
# box.vm.box = "ubuntu/bionic64"
8+
# box.vm.box = "ubuntu/xenial64"
99

1010
box.vm.network "forwarded_port", guest: 443, host: 8080, protocol: "tcp"
1111
box.vm.network "forwarded_port", guest: 1700, host: 1700, protocol: "udp"

ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[ssh_connection]
2+
pipelining = True

full_deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424
- lora-gateway-bridge
2525
- loraserver
2626
- lora-app-server
27+
- lora-geo-server
2728
become: yes

group_vars/single_server.example.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ mosquitto:
6969
- write application/+/device/+/join
7070
- write application/+/device/+/ack
7171
- write application/+/device/+/error
72+
- write application/+/device/+/status
73+
- write application/+/device/+/location
7274
- read application/+/device/+/tx
7375
-
7476
user: loraserver_app
@@ -79,6 +81,8 @@ mosquitto:
7981
- read application/+/device/+/join
8082
- read application/+/device/+/ack
8183
- read application/+/device/+/error
84+
- read application/+/device/+/status
85+
- read application/+/device/+/location
8286

8387
# postgresql configuration
8488
#

host_vars/vagrant.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ mosquitto:
6363
- write application/+/device/+/join
6464
- write application/+/device/+/ack
6565
- write application/+/device/+/error
66+
- write application/+/device/+/status
67+
- write application/+/device/+/location
6668
- read application/+/device/+/tx
6769
-
6870
user: loraserver_app
@@ -73,6 +75,8 @@ mosquitto:
7375
- read application/+/device/+/join
7476
- read application/+/device/+/ack
7577
- read application/+/device/+/error
78+
- read application/+/device/+/status
79+
- read application/+/device/+/location
7680

7781
# postgresql configuration
7882
postgresql:

roles/base/tasks/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- apt-transport-https
1010
- iptables-persistent
1111
- sudo
12+
- libcap2-bin
1213

1314
- name: import LoRa Server gpg key
1415
apt_key:
@@ -22,7 +23,3 @@
2223
- name: import postgresql gpg key
2324
apt_key:
2425
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
25-
26-
- name: add postgresql deb repository
27-
apt_repository:
28-
repo: deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main

roles/letsencrypt/tasks/debian.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- name: add stretch-backports repository
2+
apt_repository:
3+
repo: deb http://ftp.debian.org/debian stretch-backports main
4+
5+
- name: install certbot from backports
6+
apt:
7+
name: certbot
8+
state: latest
9+
default_release: stretch-backports

roles/letsencrypt/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
- name: ubuntu install
2-
include_tasks: ubuntu.yml
2+
include_tasks: ubuntu_ppa.yml
33
when: ansible_distribution == 'Ubuntu'
44

5-
- name: debian install
6-
include_tasks: debian.yml
7-
when: ansible_distribution == 'Debian'
5+
- name: debian stretch install
6+
include_tasks: debian_stretch.yml
7+
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'stretch'
88

99
- name: setup renew cron
1010
cron: name="letsencrypt renew" minute="0" hour="0" job="certbot renew > /dev/null"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: restart lora-geo-server
2+
service:
3+
name: lora-geo-server
4+
state: restarted

roles/lora-geo-server/tasks/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
- name: install lora-geo-server
2+
package:
3+
name: lora-geo-server
4+
state: latest
5+
6+
- name: copy configuration
7+
template:
8+
src: lora-geo-server.toml
9+
dest: /etc/lora-geo-server/lora-geo-server.toml
10+
owner: geoserver
11+
group: geoserver
12+
mode: 0640
13+
notify:
14+
- restart lora-geo-server
15+
16+
- name: start lora-geo-server on boot
17+
service:
18+
name: lora-geo-server
19+
state: started
20+
enabled: yes
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See https://www.loraserver.io/lora-geo-server/install/config/ for a full
2+
# configuration example and documentation.
3+
4+
[geo_server.backend]
5+
name="collos"
6+
7+
[geo_server.backend.collos]
8+
# Collos subscription key.
9+
#
10+
# This key can be retrieved after creating a Collos account at:
11+
# http://preview.collos.org/
12+
subscription_key=""

roles/loraserver/templates/loraserver.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ enabled_uplink_channels=[]
6969
server="tcp://localhost:1883"
7070
username="loraserver_ns"
7171
password="loraserver_ns"
72+
73+
74+
[geolocation_server]
75+
server="localhost:8005"

roles/mosquitto/tasks/debian_jessie.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

roles/mosquitto/tasks/main.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
- name: add mosquitto repo (debian jessie)
2-
include_tasks: debian_jessie.yml
3-
when: ansible_distribution == 'Debian'
4-
5-
- name: add mosquitto ppa (ubuntu trusty)
6-
include_tasks: ubuntu_ppa.yml
7-
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
8-
91
- name: install packages
102
package: name={{ item }} state=latest
113
with_items:

roles/mosquitto/tasks/ubuntu_ppa.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

roles/postgresql/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
package: name={{ item }} state=latest
33
with_items:
44
- python-psycopg2
5-
- postgresql-9.6
5+
- postgresql
66

77
- name: start postgresql on boot
88
service: name=postgresql state=started enabled=yes

0 commit comments

Comments
 (0)