14 lines
356 B
YAML
14 lines
356 B
YAML
- hosts: localhost
|
|
tasks:
|
|
- name: Get IP addresses and interfaces
|
|
ansible.builtin.command: ip -json a
|
|
register: ip_output
|
|
|
|
- name: Parse JSON output
|
|
ansible.builtin.set_fact:
|
|
network_info: "{{ ip_output.stdout | from_json }}"
|
|
|
|
- name: Print network information
|
|
ansible.builtin.debug:
|
|
var: network_info
|