Updated docker compose syntax with respect to dependencies to maintain consistency with the upstream docker-compose role.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
---
|
||||
- name: Create the directory for the weatherfeeder configuration file if it doesn't already exist.
|
||||
- name: Create directories for the container data and configuration files.
|
||||
file:
|
||||
path: "{{ docker_appdata_directory}}/{{ feedstack_directory_item }}"
|
||||
state: directory
|
||||
loop:
|
||||
- weatherfeeder
|
||||
- weatherprocessor
|
||||
- nats/config
|
||||
- nats/data
|
||||
loop_control:
|
||||
@@ -17,7 +18,13 @@
|
||||
src: "weatherfeeder/config.yml.j2"
|
||||
dest: "{{ docker_appdata_directory }}/weatherfeeder/config.yml"
|
||||
become: true
|
||||
|
||||
|
||||
- name: Create the weatherprocessor configuration file from the provided template.
|
||||
template:
|
||||
src: "weatherprocessor/config.yml.j2"
|
||||
dest: "{{ docker_appdata_directory }}/weatherprocessor/config.yml"
|
||||
become: true
|
||||
|
||||
- name: Create the nats configuration file from the provided template.
|
||||
template:
|
||||
src: "nats/nats.conf.j2"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# Single-node NATS configuration for local app-to-app messaging.
|
||||
# WeatherFeeder can publish to this server without authentication.
|
||||
|
||||
# Listen on all IPv4 and IPv6 interfaces
|
||||
listen: "[::]:4222"
|
||||
|
||||
# Client connections (WeatherFeeder + consumers).
|
||||
port: 4222
|
||||
|
||||
@@ -8,6 +11,6 @@ port: 4222
|
||||
monitor_port: 8222
|
||||
|
||||
# Optional persistence for future stream use.
|
||||
jetstream {
|
||||
store_dir: "/data"
|
||||
}
|
||||
#jetstream {
|
||||
# store_dir: "/data"
|
||||
#}
|
||||
|
||||
20
templates/weatherprocessor/config.yml.j2
Normal file
20
templates/weatherprocessor/config.yml.j2
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
sources:
|
||||
- name: WeatherfeederNATS
|
||||
driver: nats
|
||||
params:
|
||||
url: nats://nats:4222
|
||||
subject: weatherfeeder
|
||||
# Optional source tuning:
|
||||
# max_batch: 256
|
||||
# receive_wait: 25ms
|
||||
|
||||
sinks:
|
||||
- name: stdout
|
||||
driver: stdout
|
||||
params: {}
|
||||
|
||||
routes:
|
||||
- sink: stdout
|
||||
kinds: []
|
||||
...
|
||||
@@ -10,10 +10,13 @@ nats:
|
||||
# Define the path where application data for this container will be stored.
|
||||
appdata_directory: "{{ docker_appdata_directory }}/nats"
|
||||
|
||||
# Needed to set the config file.
|
||||
command: "-c /nats.conf"
|
||||
|
||||
# Define the volumes that should be mounted into the container.
|
||||
volumes:
|
||||
- "{{ docker_appdata_directory }}/nats/data:/data"
|
||||
- "{{ docker_appdata_directory }}/nats/config/nats.conf:/etc/nats/nats.conf:ro"
|
||||
- "{{ docker_appdata_directory }}/nats/config/nats.conf:/nats.conf:ro"
|
||||
|
||||
# Define the ports that should be opened to the outside world.
|
||||
ports:
|
||||
|
||||
@@ -17,6 +17,10 @@ weatherfeeder:
|
||||
# Define the ports that should be opened to the outside world.
|
||||
#ports: []
|
||||
|
||||
# Define the dependencies for this container.
|
||||
dependencies:
|
||||
- nats
|
||||
|
||||
# Define environment variables to be passed to the container.
|
||||
#environment_variables: []
|
||||
|
||||
|
||||
@@ -17,10 +17,13 @@ weatherprocessor:
|
||||
# Define the ports that should be opened to the outside world.
|
||||
#ports: []
|
||||
|
||||
# Define the dependencies for this container.
|
||||
dependencies:
|
||||
- nats
|
||||
- weatherfeeder
|
||||
|
||||
# Define environment variables to be passed to the container.
|
||||
environment_variables:
|
||||
- "WEATHERPROCESSOR_NATS_URL=nats://nats:4222"
|
||||
- "WEATHERPROCESSOR_SUBJECT=weatherfeeder"
|
||||
- "WEATHERPROCESSOR_OUTPUT_FORMAT=yaml"
|
||||
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user