From 0efddd15f0baf7a466dfe5eff03cb450421d3faa Mon Sep 17 00:00:00 2001
From: poulpe <poulpe@localhost.localdomain>
Date: Sat, 8 Apr 2023 15:45:03 +0200
Subject: [PATCH] [Update] Fix test connectivity

---
 Config_Wireguard.yml | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/Config_Wireguard.yml b/Config_Wireguard.yml
index 9ace910..3cbe7d6 100644
--- a/Config_Wireguard.yml
+++ b/Config_Wireguard.yml
@@ -136,22 +136,16 @@
         ansible.builtin.shell:
           cmd: "wg-quick up wg0 2>/dev/null"
 
-- name: Start wireguard for all hosts
-  hosts: hotes
-  become: true
-  tasks:
-    # - name: Start wg-quick
-    #   ansible.builtin.shell:
-    #     cmd: "wg-quick up wg0 2>/dev/null"
-    - name: Make curl to web server
-      ansible.builtin.shell:
-        cmd: "curl http://10.0.0.1:80/index.html > index.html"
-
 - name: Test connectivity from H1 to H2
   hosts: H1
   tasks:
     - name: Ping form H1 to H2
       ansible.builtin.shell: "ping 10.0.0.1 -c 1"
+      register: result
+      
+    - name: Print result
+      debug:
+        msg: "{{ result.stdout_lines }}"
 
     - name: Check connectivity using curl
       shell: "curl 10.0.0.1"
@@ -160,7 +154,7 @@
 
     - name: Print result
       debug:
-        msg: "Connectivity test {{ 'succeeded' if result.rc == 0 else 'failed' }}."
+        msg: "{{ result.stdout_lines }}"
       
 
 ...
\ No newline at end of file
-- 
GitLab