Skip to content
Snippets Groups Projects
Commit 31e4c5d1 authored by void's avatar void
Browse files

neue Implementierung warpapi mit http Updates

parent 180e70f7
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
- include: ../functions/get_secret.yml - include: ../functions/get_secret.yml
with_items: with_items:
- { path: "{{ basedir }}/openweathermap_apikey", length: -1 } - { path: "{{ basedir }}/openweathermap_apikey", length: -1 }
- { path: "{{ basedir }}/influxdb_password", length: 12 } - { path: "{{ basedir }}/warpai_status_update_key", length: -1 }
- { path: "{{ basedir }}/influxdb_token", length: 32 } - { path: "{{ basedir }}/influxdb_password", length: 12 }
- { path: "{{ basedir }}/influxdb_token", length: 32 }
- name: pakete installieren - name: pakete installieren
......
...@@ -11,5 +11,8 @@ then ...@@ -11,5 +11,8 @@ then
val mqttActions = getActions("mqtt", "mqtt:broker:mosquitto") val mqttActions = getActions("mqtt", "mqtt:broker:mosquitto")
mqttActions.publishMQTT(topic, message) mqttActions.publishMQTT(topic, message)
val headers = newHashMap()
val output = sendHttpGetRequest("https://api.warpzone.ms/setstatus?newstatus=OPEN&update_key={{ warpai_status_update_key }}", headers, 1000)
end end
--- ---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: /srv/warpapi/update_key, length: 32 }
- name: create folder struct for warpapi - name: create folder struct for warpapi
file: file:
path: "/srv/warpapi" path: "/srv/warpapi"
...@@ -8,7 +12,7 @@ ...@@ -8,7 +12,7 @@
- name: clone repo - name: clone repo
git: git:
repo: "https://gitlab.warpzone.ms/infrastruktur/warpapi.git" repo: "https://gitlab.warpzone.ms/infrastruktur/warpapi.git"
version: "232c44ed365998acf70f5c28510bcc663adc5686" version: "fc3eea53b5bda24e0a46e7f88fdb296bdb871b10"
dest: "/srv/warpapi" dest: "/srv/warpapi"
force: "yes" force: "yes"
register: gitclone register: gitclone
......
...@@ -11,6 +11,8 @@ services: ...@@ -11,6 +11,8 @@ services:
- 127.0.0.1:42010:5000 - 127.0.0.1:42010:5000
volumes: volumes:
- /srv/warpapi/warpapi/:/opt/warpapi - /srv/warpapi/warpapi/:/opt/warpapi
environment:
UPDATE_KEY: "{{ update_key }}"
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`) - traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
......
#!/bin/sh #!/bin/sh
docker run --rm -it ruimarinho/mosquitto mosquitto_pub -h 192.168.0.201 -t warpzone/door/status -m "CLOSED" --retain curl "https://{{ domain }}/setstatus?newstatus=CLOSED&update_key={{ update_key }}"
#!/bin/sh #!/bin/sh
docker run --rm -it ruimarinho/mosquitto mosquitto_pub -h 192.168.0.201 -t warpzone/door/status -m "OPEN" --retain curl "https://{{ domain }}/setstatus?newstatus=OPEN&update_key={{ update_key }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment