-
Notifications
You must be signed in to change notification settings - Fork 0
/
weather.yml
67 lines (59 loc) · 2.12 KB
/
weather.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
- name: Install Weather Server
become: true
hosts: docker_nas
vars_files:
- vault.yml
tasks:
- name: Deploy Weewx container
tags:
- weather
- docker
import_role:
name: ansible-role-docker-weewx
vars:
docker_persistent_store_root: /volume2/docker/weewx
weewx_version: 3.9.2
weewx_location: Bungendore, NSW
weewx_latitude: "{{ latitude }}"
weewx_longitude: "{{ longitude }}"
weewx_altitude: 2300
weewx_vantage_iss_id: 4
weewx_vantage_url: weatherlink.core.home.gatwards.org
weewx_vantage_tcp_port: 22222
weewx_cwop_enable: 'true'
weewx_cwop_station: VK2XJG
weewx_cwop_passcode: "{{ vault_weewx_cwop_passcode }}"
weewx_wunderground_enable: 'true'
weewx_wunderground_station: INEWSOUT867
weewx_wunderground_password: "{{ vault_weewx_wunderground_password }}"
weewx_wunderground_rapidfire: 'True'
weewx_use_mqtt: true
weewx_mqtt_url: "mqtt://{{ mqtt_broker_fqdn }}:1883/"
weewx_web_mount: /volume1/web/weewx
- name: Wait for container
wait_for:
timeout: 10
- name: Check if MQTT plugin is installed
command: /usr/local/bin/docker exec weewx bash -c '/home/weewx/bin/wee_extension --list'
register: extensions
changed_when: false
- block:
- name: Install pip pre-reqs for MQTT plugin
command: /usr/local/bin/docker exec weewx bash -c 'pip install paho-mqtt python-cjson'
- name: Download MQTT plugin
command: /usr/local/bin/docker exec weewx bash -c 'curl -o weewx-mqtt-0.19.tgz http://lancet.mit.edu/mwall/projects/weather/releases/weewx-mqtt-0.19.tgz'
- name: Install MQTT plugin
command: /usr/local/bin/docker exec weewx bash -c '/home/weewx/bin/wee_extension --install weewx-mqtt-0.19.tgz'
ignore_errors: true
register: ext_installed
when: '"mqtt" not in extensions.stdout'
- name: Restart container
docker_container:
name: weewx
state: started
restart: true
when: ext_installed.changed
# # TODO:
# # /var/www/html/stormvue for TS tracking (TAR bundle from Boltek)
# # Requires also vsftpd with stormvue user