From f023a3ca18690ded203dee9c53364a5af59a536d Mon Sep 17 00:00:00 2001 From: Thorsten Bruhns Date: Sat, 25 Nov 2023 17:46:25 +0000 Subject: [PATCH] oradb_facts: Skip oracledb_facts when db not reachable --- changelogs/fragments/dbfacts.yml | 3 +++ roles/oradb_facts/tasks/db_facts.yml | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/dbfacts.yml diff --git a/changelogs/fragments/dbfacts.yml b/changelogs/fragments/dbfacts.yml new file mode 100644 index 000000000..5dc194d7a --- /dev/null +++ b/changelogs/fragments/dbfacts.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - "oradb_facts: Skip oracledb_facts when db not reachable (oravirt#387)" diff --git a/roles/oradb_facts/tasks/db_facts.yml b/roles/oradb_facts/tasks/db_facts.yml index c6f5f9103..52721aeef 100644 --- a/roles/oradb_facts/tasks/db_facts.yml +++ b/roles/oradb_facts/tasks/db_facts.yml @@ -21,6 +21,8 @@ ansible.builtin.set_fact: cacheable: true oracledb_facts: "{{ oracledb_facts | default({}) | combine(_db_facts | items2dict) }}" + when: + - ansible_facts['version'] is defined vars: _db_facts: - key: "{{ odb[0]['oracle_db_unique_name'] | default(odb[0]['oracle_db_name']) }}"