Updated feedstack to include weatherdb and weatherapi containers
This commit is contained in:
@@ -17,7 +17,19 @@ feedstack_weatherfeeder_container_tag: "latest"
|
|||||||
feedstack_weatherprocessor_container_image: "harbor.maximumdirect.net/library/weatherprocessor"
|
feedstack_weatherprocessor_container_image: "harbor.maximumdirect.net/library/weatherprocessor"
|
||||||
feedstack_weatherprocessor_container_tag: "latest"
|
feedstack_weatherprocessor_container_tag: "latest"
|
||||||
|
|
||||||
|
# Define the default weatherapi container image and tag.
|
||||||
|
feedstack_weatherapi_container_image: "harbor.maximumdirect.net/library/weatherapi"
|
||||||
|
feedstack_weatherapi_container_tag: "latest"
|
||||||
|
|
||||||
# Define the default NATS container image and tag.
|
# Define the default NATS container image and tag.
|
||||||
feedstack_nats_container_image: "nats"
|
feedstack_nats_container_image: "nats"
|
||||||
feedstack_nats_container_tag: "linux"
|
feedstack_nats_container_tag: "linux"
|
||||||
|
|
||||||
|
# Define the default weatherdb container image and tag.
|
||||||
|
feedstack_weatherdb_container_image: "postgres"
|
||||||
|
feedstack_weatherdb_container_tag: "16"
|
||||||
|
|
||||||
|
# Define the default weatherdb database user and password.
|
||||||
|
feedstack_weatherdb_user: "weatherdb"
|
||||||
|
feedstack_weatherdb_password: "weatherdb"
|
||||||
|
feedstack_weatherdb_database: "weatherdb"
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
loop:
|
loop:
|
||||||
- weatherfeeder
|
- weatherfeeder
|
||||||
- weatherprocessor
|
- weatherprocessor
|
||||||
|
- weatherapi
|
||||||
- nats/config
|
- nats/config
|
||||||
- nats/data
|
- nats/data
|
||||||
loop_control:
|
loop_control:
|
||||||
@@ -19,6 +20,12 @@
|
|||||||
dest: "{{ docker_appdata_directory }}/weatherfeeder/config.yml"
|
dest: "{{ docker_appdata_directory }}/weatherfeeder/config.yml"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: Create the weatherapi configuration file from the provided template.
|
||||||
|
template:
|
||||||
|
src: "weatherapi/config.yml.j2"
|
||||||
|
dest: "{{ docker_appdata_directory }}/weatherapi/config.yml"
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Create the weatherprocessor configuration file from the provided template.
|
- name: Create the weatherprocessor configuration file from the provided template.
|
||||||
template:
|
template:
|
||||||
src: "weatherprocessor/config.yml.j2"
|
src: "weatherprocessor/config.yml.j2"
|
||||||
|
|||||||
9
templates/weatherapi/config.yml.j2
Normal file
9
templates/weatherapi/config.yml.j2
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: weatherdb
|
||||||
|
driver: postgres
|
||||||
|
params:
|
||||||
|
uri: postgres://weatherdb:5432/{{ feedstack_weatherdb_database }}?sslmode=disable
|
||||||
|
username: {{ feedstack_weatherdb_user }}
|
||||||
|
password: {{ feedstack_weatherdb_password }}
|
||||||
|
|
||||||
|
...
|
||||||
@@ -73,12 +73,22 @@ sinks:
|
|||||||
params:
|
params:
|
||||||
url: nats://nats:4222
|
url: nats://nats:4222
|
||||||
exchange: weatherfeeder
|
exchange: weatherfeeder
|
||||||
|
|
||||||
|
- name: weatherdb
|
||||||
|
driver: postgres
|
||||||
|
params:
|
||||||
|
uri: postgres://weatherdb:5432/{{ feedstack_weatherdb_database }}?sslmode=disable
|
||||||
|
username: {{ feedstack_weatherdb_user }}
|
||||||
|
password: {{ feedstack_weatherdb_password }}
|
||||||
|
|
||||||
# optional: route events to this sink
|
# optional: route events to this sink
|
||||||
routes:
|
routes:
|
||||||
- sink: nats_weatherfeeder
|
- sink: nats_weatherfeeder
|
||||||
kinds: ["observation", "forecast", "alert"]
|
kinds: ["observation", "forecast", "alert"]
|
||||||
|
|
||||||
|
- sink: weatherdb
|
||||||
|
kinds: ["observation", "forecast", "alert"]
|
||||||
|
|
||||||
- sink: stdout
|
- sink: stdout
|
||||||
kinds: ["observation", "forecast", "alert"]
|
kinds: ["observation", "forecast", "alert"]
|
||||||
...
|
...
|
||||||
22
vars/containers/weatherapi.yml
Normal file
22
vars/containers/weatherapi.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
weatherapi:
|
||||||
|
|
||||||
|
# Define the name of this container.
|
||||||
|
name: "weatherapi"
|
||||||
|
|
||||||
|
# Define the docker image to be used for this container.
|
||||||
|
image: "{{ feedstack_weatherapi_container_image }}:{{ feedstack_weatherapi_container_tag }}"
|
||||||
|
|
||||||
|
# Define ports that should be opened to the outside world.
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
|
||||||
|
# Define the volumes that should be mounted into the container.
|
||||||
|
volumes:
|
||||||
|
- "{{ docker_appdata_directory }}/weatherapi/config.yml:/weatherapi/config.yml:ro"
|
||||||
|
|
||||||
|
# Define the dependencies for this container.
|
||||||
|
dependencies:
|
||||||
|
- weatherdb
|
||||||
|
|
||||||
|
...
|
||||||
19
vars/containers/weatherdb.yml
Normal file
19
vars/containers/weatherdb.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
weatherdb:
|
||||||
|
|
||||||
|
# Define the name of this container.
|
||||||
|
name: "weatherdb"
|
||||||
|
|
||||||
|
# Define the docker image to be used for this container.
|
||||||
|
image: "{{ feedstack_weatherdb_container_image }}:{{ feedstack_weatherdb_container_tag }}"
|
||||||
|
|
||||||
|
# Define the volumes that should be mounted into the container.
|
||||||
|
volumes:
|
||||||
|
- "{{ docker_appdata_directory }}/weatherdb/db:/var/lib/postgresql/data"
|
||||||
|
|
||||||
|
# Define environment variables to be passed to the container.
|
||||||
|
environment_variables:
|
||||||
|
- "POSTGRES_USER={{ feedstack_weatherdb_user }}"
|
||||||
|
- "POSTGRES_PASSWORD={{ feedstack_weatherdb_password }}"
|
||||||
|
- "POSTGRES_DB={{ feedstack_weatherdb_database }}"
|
||||||
|
...
|
||||||
@@ -23,6 +23,7 @@ weatherfeeder:
|
|||||||
# Define the dependencies for this container.
|
# Define the dependencies for this container.
|
||||||
dependencies:
|
dependencies:
|
||||||
- nats
|
- nats
|
||||||
|
- weatherdb
|
||||||
|
|
||||||
# Define environment variables to be passed to the container.
|
# Define environment variables to be passed to the container.
|
||||||
#environment_variables: []
|
#environment_variables: []
|
||||||
|
|||||||
Reference in New Issue
Block a user