Files
pragmatic-deployer/playbooks/discover.yml
T

33 lines
1.1 KiB
YAML

---
- name: Read-only host discovery
hosts: debian_servers
gather_facts: true
tasks:
- name: Show platform facts
ansible.builtin.debug:
msg:
- "Host: {{ inventory_hostname }} ({{ ansible_host | default(inventory_hostname) }})"
- "Distribution: {{ ansible_distribution }} {{ ansible_distribution_version }}"
- "Kernel: {{ ansible_kernel }}"
- "Architecture: {{ ansible_architecture }}"
- "Memory: {{ ansible_memtotal_mb }} MiB"
- "Default interface: {{ ansible_default_ipv4.interface | default('unknown') }}"
- name: Read filesystem capacity
ansible.builtin.command: df -h /
register: root_fs
changed_when: false
- name: Read listening TCP and UDP sockets
ansible.builtin.command: ss -H -tulpn
register: listeners
changed_when: false
become: true
- name: Report non-secret discovery results
ansible.builtin.debug:
msg:
filesystem: "{{ root_fs.stdout_lines }}"
listeners: "{{ listeners.stdout_lines }}"