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:
|
file:
|
||||||
path: "{{ docker_appdata_directory}}/{{ feedstack_directory_item }}"
|
path: "{{ docker_appdata_directory}}/{{ feedstack_directory_item }}"
|
||||||
state: directory
|
state: directory
|
||||||
loop:
|
loop:
|
||||||
- weatherfeeder
|
- weatherfeeder
|
||||||
|
- weatherprocessor
|
||||||
- nats/config
|
- nats/config
|
||||||
- nats/data
|
- nats/data
|
||||||
loop_control:
|
loop_control:
|
||||||
@@ -18,6 +19,12 @@
|
|||||||
dest: "{{ docker_appdata_directory }}/weatherfeeder/config.yml"
|
dest: "{{ docker_appdata_directory }}/weatherfeeder/config.yml"
|
||||||
become: true
|
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.
|
- name: Create the nats configuration file from the provided template.
|
||||||
template:
|
template:
|
||||||
src: "nats/nats.conf.j2"
|
src: "nats/nats.conf.j2"
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Single-node NATS configuration for local app-to-app messaging.
|
# Single-node NATS configuration for local app-to-app messaging.
|
||||||
# WeatherFeeder can publish to this server without authentication.
|
# WeatherFeeder can publish to this server without authentication.
|
||||||
|
|
||||||
|
# Listen on all IPv4 and IPv6 interfaces
|
||||||
|
listen: "[::]:4222"
|
||||||
|
|
||||||
# Client connections (WeatherFeeder + consumers).
|
# Client connections (WeatherFeeder + consumers).
|
||||||
port: 4222
|
port: 4222
|
||||||
|
|
||||||
@@ -8,6 +11,6 @@ port: 4222
|
|||||||
monitor_port: 8222
|
monitor_port: 8222
|
||||||
|
|
||||||
# Optional persistence for future stream use.
|
# Optional persistence for future stream use.
|
||||||
jetstream {
|
#jetstream {
|
||||||
store_dir: "/data"
|
# 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.
|
# Define the path where application data for this container will be stored.
|
||||||
appdata_directory: "{{ docker_appdata_directory }}/nats"
|
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.
|
# Define the volumes that should be mounted into the container.
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ docker_appdata_directory }}/nats/data:/data"
|
- "{{ 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.
|
# Define the ports that should be opened to the outside world.
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ weatherfeeder:
|
|||||||
# Define the ports that should be opened to the outside world.
|
# Define the ports that should be opened to the outside world.
|
||||||
#ports: []
|
#ports: []
|
||||||
|
|
||||||
|
# Define the dependencies for this container.
|
||||||
|
dependencies:
|
||||||
|
- nats
|
||||||
|
|
||||||
# Define environment variables to be passed to the container.
|
# Define environment variables to be passed to the container.
|
||||||
#environment_variables: []
|
#environment_variables: []
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,13 @@ weatherprocessor:
|
|||||||
# Define the ports that should be opened to the outside world.
|
# Define the ports that should be opened to the outside world.
|
||||||
#ports: []
|
#ports: []
|
||||||
|
|
||||||
|
# Define the dependencies for this container.
|
||||||
|
dependencies:
|
||||||
|
- nats
|
||||||
|
- weatherfeeder
|
||||||
|
|
||||||
# Define environment variables to be passed to the container.
|
# Define environment variables to be passed to the container.
|
||||||
environment_variables:
|
environment_variables:
|
||||||
- "WEATHERPROCESSOR_NATS_URL=nats://nats:4222"
|
|
||||||
- "WEATHERPROCESSOR_SUBJECT=weatherfeeder"
|
|
||||||
- "WEATHERPROCESSOR_OUTPUT_FORMAT=yaml"
|
- "WEATHERPROCESSOR_OUTPUT_FORMAT=yaml"
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|||||||
Reference in New Issue
Block a user