From 72bb97aa16e75b05096e9ecc01cf572750f103d5 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sun, 3 Nov 2024 22:13:02 +0100 Subject: [PATCH] Use host network for grafana container. --- roles/role_deploy_grafana/tasks/main.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/roles/role_deploy_grafana/tasks/main.yml b/roles/role_deploy_grafana/tasks/main.yml index 0a5e16c..032d17f 100644 --- a/roles/role_deploy_grafana/tasks/main.yml +++ b/roles/role_deploy_grafana/tasks/main.yml @@ -8,7 +8,7 @@ failed_when: "result_grafana_systemd_stop is failed and 'Could not find the requested service' not in result_grafana_systemd_stop.msg" - name: Check if grafana container is running - command: 'podman ps -q --filter "name=grafana"' + command: 'podman ps -q --filter "name=^grafana$"' changed_when: false register: podman_ps become: true @@ -87,24 +87,15 @@ changed_when: duplicity_result.rc is defined and duplicity_result.rc == 0 when: not grafana_restored_flag.stat.exists -- name: Create podman networks - containers.podman.podman_network: - name: "{{ item }}" - become: true - with_items: - - reverse-proxy - - name: Create grafana container containers.podman.podman_container: name: grafana image: docker.io/grafana/grafana:10.2.4 state: present network: - - reverse-proxy - - mysqlnet + - host expose: - "3000/tcp" - dns_search: "{{ SHORTNAME }}-sub.{{ DOMAIN }}" volume: - /mnt/volumes/var_lib_grafana/data:/var/lib/grafana:Z - /mnt/volumes/etc_grafana/data:/etc/grafana:Z