From fe29c97c5315818edaee73af0dab73bad7beb2ba Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Fri, 11 Oct 2024 21:03:59 +0200 Subject: [PATCH] chore(vmagent): allow setting container network mode --- roles/vmagent/defaults/main/config.yml | 2 +- roles/vmagent/defaults/main/container.yml | 1 + roles/vmagent/tasks/deploy-docker.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/vmagent/defaults/main/config.yml b/roles/vmagent/defaults/main/config.yml index 9d6b8e5..97232ed 100644 --- a/roles/vmagent/defaults/main/config.yml +++ b/roles/vmagent/defaults/main/config.yml @@ -1,7 +1,7 @@ --- vmagent_config_global_scrape_interval: "30s" vmagent_config_global_scrape_timeout: "10s" -vmagent_config_global_external_labels: [] +vmagent_config_global_external_labels: {} vmagent_config_scrape_configs: [] vmagent_config: ~ diff --git a/roles/vmagent/defaults/main/container.yml b/roles/vmagent/defaults/main/container.yml index af58284..7cbf4e5 100644 --- a/roles/vmagent/defaults/main/container.yml +++ b/roles/vmagent/defaults/main/container.yml @@ -29,6 +29,7 @@ vmagent_container_command: >-2 -{{ flag }} {% endfor -%} vmagent_container_networks: ~ +vmagent_container_network_mode: ~ vmagent_container_etc_hosts: ~ vmagent_container_dns_servers: ~ vmagent_container_restart_policy: >-2 diff --git a/roles/vmagent/tasks/deploy-docker.yml b/roles/vmagent/tasks/deploy-docker.yml index 7bbc300..386a694 100644 --- a/roles/vmagent/tasks/deploy-docker.yml +++ b/roles/vmagent/tasks/deploy-docker.yml @@ -23,5 +23,6 @@ networks: "{{ vmagent_container_networks | default(omit, true) }}" etc_hosts: "{{ vmagent_container_etc_hosts | default(omit, true) }}" dns_servers: "{{ vmagent_container_dns_servers | default(omit, true) }}" + network_mode: "{{ vmagent_container_network_mode | default(omit, true) }}" restart_policy: "{{ vmagent_container_restart_policy | default(omit, true) }}" state: "{{ vmagent_container_state }}"