From ab927fcd31dc5300cf663529565b6deead9d7bb0 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 29 Jun 2018 22:21:06 +0000 Subject: [PATCH] let us try this to add vmhost to cached facts --- roles/base/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 2706c7e3e7..5fd3e98402 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -5,6 +5,18 @@ # Things in here are things we want to do to every machine no matter what. # +- name: setup a /etc/ansible/fact.d dir if needed. + file: path="/etc/ansible/facts.d/" state=directory mode=0700 + when: vmhost is defined + tags: + - vmhost_fact + +- name: set a vmhost fact on vmguests + copy: content="{{vmhost}}" dest=/etc/ansible/facts.d/vmhost.fact + when: vmhost is defined + tags: + - vmhost_fact + - name: ensure packages required for semanage are installed (yum) package: name={{ item }} state=present when: ansible_distribution_major_version|int < 22