Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ansible/group_vars/lindeberg/mobile-network-secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$ANSIBLE_VAULT;1.1;AES256
31646233396336366133343534626638643135373838666237393535653239343731616431623966
3438663866316165623961326562303439363639373936660a666639353165656361333862356338
32616233343139376335313666663066363338366165346538666133373837383163333231633261
3330376230333538380a626566393433656239636664393030323231396233353431373031663732
66666165376564643532663762653266306138363433353831313639643761313861
4 changes: 3 additions & 1 deletion ansible/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ dlock-13 ansible_host=door13.dlock.trygvis.io
[gateways]
dlock

[lindeberg]
dlock-7

[doors]
dlock-dev
dlock-0
Expand All @@ -29,7 +32,6 @@ dlock-3
dlock-4
dlock-5
dlock-6
dlock-7
dlock-8
dlock-9
dlock-10
Expand Down
18 changes: 18 additions & 0 deletions ansible/roles/mobile-network/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Mobile network connection
tags: mobile-network
block:
- name: Install system dependencies
apt:
name:
- network-manager
- modemmanager
- python-dbus
- gir1.2-networkmanager-1.0
- name: Add NetworkManager connection
shell: "nmcli connection show mobile || nmcli connection add con-name mobile type gsm ifname '*' apn {{mobile_network_apn}}"
- name: Configure connection
command: "nmcli connection modify mobile connection.autoconnect yes connection.autoconnect-retries 1000 gsm.pin {{mobile_network_pin}} gsm.number {{mobile_network_number}}"
- name: Set connection as up
command: "nmcli connection up mobile"
ignore_errors: yes # will happen if GSM modem not plugged in