Execution
Date 13 May 2024 10:03:11 +0100
Duration 00:04:16.89
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.4
ara 1.7.1 / 1.7.2.dev2
Python 3.10.10
Summary
478 Hosts
3 Tasks
1422 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/ipv6-check.yaml

---
- name: Playbook to check the server for ipv6
  hosts: all
  gather_facts: true
  vars:
    folder: /home/ssh-gateway/ansible/playbook_output
  tasks:
    - name: Check if host has IPv6
      ansible.builtin.command: ip -6 addr show
      register: ipv6_check
      ignore_errors: true
      changed_when: false
    - name: Write hostname to file
      ansible.builtin.lineinfile:
        dest: "{{ folder }}/ipv6-servers.txt"
        line: "{{ ansible_hostname }}"
      when: ipv6_check.rc == 0