diff --git a/Config_Wireguard.yml b/Config_Wireguard.yml index 9ace91007285a6e578856c2448f9ad086b28d39f..3cbe7d697373ca52d8c97bbbb104796c52fc1de4 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