base: Add custom fact to detect /export directory

This commit is contained in:
Timo Makinen 2021-09-19 19:13:04 +00:00
parent 27496d1820
commit 06f173cba2

View file

@ -10,6 +10,24 @@
- /etc/ansible
- /etc/ansible/facts.d
- name: add ansible_export fact
copy:
dest: /etc/ansible/facts.d/export.fact
content: |
#!/bin/sh
if [ -d /export ]; then
echo "true"
else
echo "false"
fi
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
- name: reload facts
setup:
filter: ansible_local
- name: set correct hostname
hostname:
name: "{{ inventory_hostname }}"