ansible/utils/version_check.yml

20 lines
557 B
YAML
Raw Normal View History

2021-02-10 11:01:42 +01:00
#!/usr/bin/env ansible-playbook
---
# Check for the distribution
- hosts: localhost
tasks:
- name: Delete local tmp file
file:
path: /tmp/ansible_dump_dist_version.txt
state: absent
- hosts: all,!unifi
tasks:
# Add info line by line
- name: Dump all info into the local file
delegate_to: localhost
lineinfile:
path: /tmp/ansible_dump_dist_version.txt
line: "[{{ ansible_facts['nodename'] }}] {{ansible_fqdn}} : {{
ansible_distribution }} {{ ansible_distribution_version }}"