From 1bdcb795e8deee1ebcf47d8916210c2ed281d89d Mon Sep 17 00:00:00 2001 From: Sergey Besedin Date: Sat, 8 Sep 2018 19:56:46 +0300 Subject: [PATCH] Add docker networks --- defaults/main.yml | 4 ++++ tasks/filebeat.yml | 1 + tasks/heartbeat.yml | 1 + tasks/metricbeat.yml | 1 + 4 files changed, 7 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 3db5b13..cfd99ea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,12 +9,14 @@ elastic_beats_kibana_host: localhost elastic_beats_kibana_port: 5601 elastic_beats_kibana_basic_auth_username: elastic_beats_kibana_basic_auth_password: +elastic_beats_networks: [] elastic_filebeat_version: '{{ elastic_beats_version }}' elastic_filebeat_dir: /opt/docker/services/elastic-filebeat elastic_filebeat_image: docker.elastic.co/beats/filebeat:{{ elastic_filebeat_version }} elastic_filebeat_container_name: elastic-filebeat elastic_filebeat_links: [] +elastic_filebeat_networks: '{{ elastic_beats_networks }}' elastic_filebeat_volumes: - '{{ elastic_filebeat_dir }}/filebeat.yml:/usr/share/filebeat/filebeat.yml' - /:/hostfs:ro @@ -35,6 +37,7 @@ elastic_heartbeat_dir: /opt/docker/services/elastic-heartbeat elastic_heartbeat_image: docker.elastic.co/beats/heartbeat:{{ elastic_heartbeat_version }} elastic_heartbeat_container_name: elastic-heartbeat elastic_heartbeat_links: [] +elastic_heartbeat_networks: '{{ elastic_beats_networks }}' elastic_heartbeat_elasticsearch_hosts: '{{ elastic_beats_elasticsearch_hosts }}' elastic_heartbeat_kibana_setup_dashboards: '{{ elastic_beats_kibana_setup_dashboards }}' elastic_heartbeat_kibana_enabled: '{{ elastic_beats_kibana_enabled }}' @@ -51,6 +54,7 @@ elastic_metricbeat_dir: /opt/docker/services/elastic-metricbeat elastic_metricbeat_image: docker.elastic.co/beats/metricbeat:{{ elastic_metricbeat_version }} elastic_metricbeat_container_name: elastic-metricbeat elastic_metricbeat_links: [] +elastic_metricbeat_networks: '{{ elastic_beats_networks }}' elastic_metricbeat_volumes: - '{{ elastic_metricbeat_dir }}/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml' - /:/hostfs:ro diff --git a/tasks/filebeat.yml b/tasks/filebeat.yml index c3282c0..845b858 100644 --- a/tasks/filebeat.yml +++ b/tasks/filebeat.yml @@ -21,4 +21,5 @@ restart_policy: always user: root links: '{{ elastic_filebeat_links }}' + networks: '{{ elastic_filebeat_networks }}' volumes: '{{ elastic_filebeat_volumes }}' diff --git a/tasks/heartbeat.yml b/tasks/heartbeat.yml index 516c3e2..769cc0f 100644 --- a/tasks/heartbeat.yml +++ b/tasks/heartbeat.yml @@ -21,5 +21,6 @@ restart_policy: always user: root links: '{{ elastic_heartbeat_links }}' + networks: '{{ elastic_heartbeat_networks }}' volumes: - '{{ elastic_heartbeat_dir }}/heartbeat.yml:/usr/share/heartbeat/heartbeat.yml' diff --git a/tasks/metricbeat.yml b/tasks/metricbeat.yml index 4995cd4..7835208 100644 --- a/tasks/metricbeat.yml +++ b/tasks/metricbeat.yml @@ -22,5 +22,6 @@ user: root network_mode: host links: '{{ elastic_metricbeat_links }}' + networks: '{{ elastic_metricbeat_networks }}' volumes: '{{ elastic_metricbeat_volumes }}' command: -system.hostfs=/hostfs