diff --git a/tasks/python_venv_set_facts.yml b/tasks/python_venv_set_facts.yml index df9b761..1a52c15 100644 --- a/tasks/python_venv_set_facts.yml +++ b/tasks/python_venv_set_facts.yml @@ -14,11 +14,15 @@ # limitations under the License. - name: Ensure local facts folder exists + become: true file: path: /etc/ansible/facts.d state: directory + when: + - venv_facts_when_changed != [] - name: Record the necessary facts + become: true ini_file: dest: "/etc/ansible/facts.d/{{ venv_facts_dest }}.fact" section: "{{ item.section }}"