# Ansible: Conflicting "hosts" and "facts" Settings in Two Playbooks for Oracle

**URL:** <https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479>\
**Category:** Get Help\
**Created:** [May 6, 2025, 4:02pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479 "2025-05-06T16:02:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Symian](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/symian/32/8301_2.png) [@Symian](https://forum.ansible.com/u/Symian)\
**Post date:** [May 6, 2025, 4:02pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/1 "2025-05-06T16:02:58Z")

</div>

Hi. New to Ansible.  
I have two playbooks in this Gihub repo [https://github.com/symianarmy/oracle\_database\_refresh\_itsm](https://github.com/symianarmy/oracle_database_refresh_itsm)

1. itsm\_oracle\_refresh\_wrapper.yml - this is the wrapper playbook that uses the Ansible Control Node to connect to a ServiceNow ticketing system, opens an Oracle database refresh task. The wrapper then calls an included second playbook:

2. itsm\_oracle\_refresh\_actual.yml - this is the actual playbook that refreshes any or many lower environment databases (a UAT database in this demo) at the same time.  
Both playbooks have to work in tandem, entirely unattended. The DBAs only are notified when something breaks. That is the intent.

My problem is this. The playbooks work just fine by themselves. But since I am an Ansible beginner (not an Oracle one!), I cannot make them work together.  
The reason is this. The “wrapper” playbook only operates as localhost (it doesnt need to connect to the multiple oracle servers to open a ticket).

* * *

```
- name: RFRSH2025Q2 Omni-Client PROD_2_UAT | announce oracle_schema_refresh
  hosts: localhost
  gather_facts: true
  vars_files:
    - vars/main.yml

```

But the “actual” playbook, the one that is doing the multiple refreshes, has a different setup . It uses a “hosts” group and gathers facts on multiple servers to refresh ones content to many.

* * *

- hosts: db\_servers  
become: yes  
gather\_facts: True

SO, when the wrapper calls the actual playbook:

```
    - name: Execute Included Oracle Refresh Playbook | execute oracle_schema_refresh
      include: itsm_oracle_refresh_actual.yml

```

I get this error of the incompatibility:

```auto
[ansible_admin@ctrl ansible]$ ansible-playbook ./playbooks/itsm_oracle_refresh_wrapper.yml -v
Using /etc/ansible/ansible.cfg as config file
[WARNING]: Collection servicenow.itsm does not support Ansible version 2.14.17
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks instead. See https://docs.ansible.com/ansible-core/2.14/user_guide/playbooks_reuse_includes.html for details. This feature will be removed in 
version 2.16. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ERROR! conflicting action statements: hosts, gather_facts
The error appears to be in '/etc/ansible/playbooks/itsm_oracle_refresh_actual.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- hosts: db_servers
  ^ here
[ansible_admin@ctrl ansible]$ 

```

The only way to make this work is to either run them separately (work fine by themselves) or commenting out the include, which is the same thing.

SO, how do I make this work with the include, together? I need to have the ticketing playbook, the “wrapper”, and the “actual” refresh playbooks separate. We will use the wrapper for closed-loop (without a DBA) automation of not only the refreshes, but most of the other provisioning and maintenance Oracle database tasks. The “actual” tasks will be different - a Dataguard build, an Oracle GOldenGAte refresh or Oracle opatch . All of those I have already as the actual playbooks, but I need to make them work together. That is the challenge I am facing. Please help. Thanks and god bless.

Here is a demo of the wrapper: [https://www.youtube.com/watch?v=NJt84IN6bl0](https://www.youtube.com/watch?v=NJt84IN6bl0)

Here is a demo of the wrapper: [https://www.youtube.com/watch?v=2KOs\_\_snm7k](https://www.youtube.com/watch?v=2KOs__snm7k)

Let me know if you need the actual playbooks seen in the demos, but all you need is already here.  
Thanks.

A run log:

[ansible\_admin@ctrl ansible]$ ansible-playbook ./playbooks/itsm\_oracle\_refresh\_wrapper.yml

PLAY [RFRSH2025Q2 Omni-Client PROD\_2\_UAT | announce oracle\_schema\_refresh] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost]

TASK [Auto-Create “RFRSH2025Q2 Omni-Client PROD\_2\_UAT” Task in ServiceNow | prepare oracle\_schema\_refresh] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* [WARNING]: Encountered unknown value open while mapping field state. [WARNING]: Encountered unknown value 3 while mapping field close\_code. [WARNING]: Encountered unknown value while mapping field close\_code. changed: [localhost]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost] =\> { “msg”: “Ansible Starting the Quarterly RFRSH2025Q2 Omni-Client PROD\_2\_UAT | prepare oracle\_schema\_refresh” }

TASK [Change ServiceNow Refresh Task State to In-Progress | prepare oracle\_schema\_refresh] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* changed: [localhost]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost] =\> { “msg”: “Ansible Verified & Opened an Oracle RFRSH2025Q2 Omni-Client PROD\_2\_UAT Task INC0010116 in ServiceNow | execute oracle\_schema\_refresh” }

TASK [Prepare Oracle Refresh Process | execute oracle\_schema\_refresh] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost] =\> { “msg”: “Ansible Executing RFRSH2025Q2 Omni-Client PROD\_2\_UAT Task INC0010116” }

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost] =\> { “msg”: “Ansible Closing the RFRSH2025Q2 Omni-Client PROD\_2\_UAT Task INC0010116” }

TASK [Close ServiceNow Refresh Task as Completed | cleanup oracle\_schema\_refresh] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* [WARNING]: Encountered unknown value 2025Q5 Refreshed (Omni-CLient UAT) while mapping field close\_code. changed: [localhost]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [localhost] =\> { “msg”: "Ansible Has Now Completed the Quarterly RFRSH2025Q2 Omni-Client PROD\_2\_UAT Task by Executing INC0010116, Refresh ServiceNow SYS\_ID “6cbcc12a83512250a6565929feaad313"” }

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* localhost : ok=10 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

[ansible\_admin@ctrl ansible]$

+++++++++++++++++++

[ansible\_admin@ctrl ansible]$ ansible-playbook ./playbooks/itsm\_oracle\_refresh\_actual.yml

PLAY [db\_servers] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* [WARNING]: Platform linux on host 192.168.1.64 is using the discovered Python interpreter at /usr/libexec/platform-python, but future installation of another Python interpreter could change the meaning of that path. See [Interpreter Discovery — Ansible Core Documentation](https://docs.ansible.com/ansible-core/2.14/reference_appendices/interpreter_discovery.html) for more information. ok: [192.168.1.64] [WARNING]: Platform linux on host 192.168.1.108 is using the discovered Python interpreter at /usr/libexec/platform-python, but future installation of another Python interpreter could change the meaning of that path. See [Interpreter Discovery — Ansible Core Documentation](https://docs.ansible.com/ansible-core/2.14/reference_appendices/interpreter_discovery.html) for more information. ok: [192.168.1.108]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [192.168.1.64] =\> { “ansible\_distribution”: “OracleLinux” } ok: [192.168.1.108] =\> { “ansible\_distribution”: “OracleLinux” }

TASK [Confirm Local Facts for Each RDS Oracle Instance being Refreshed from a PROD Schema | prepare oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [192.168.1.64] =\> { “ansible\_local”: { “export”: { “localfacts”: { “export\_fact\_ansible\_env\_path”: “/home/ansible/admin”, “export\_fact\_container\_database\_type”: “legacy”, “export\_fact\_export\_flag”: “on”, “export\_fact\_oracle\_database\_environment\_purpose”: “PROD”, “export\_fact\_oracle\_database\_environment\_readonly”: “true”, “export\_fact\_oracle\_export\_datapump\_dir”: “DATA\_PUMP\_DIR”, “export\_fact\_oracle\_export\_user\_name”: “source”, “export\_fact\_oracle\_export\_user\_password”: , “export\_fact\_oracle\_listener\_port\_number”: “1521”, “export\_fact\_oracle\_local\_hostname”: “lnx072”, “export\_fact\_oracle\_rdbms\_version”: “19.0.0”, “export\_fact\_oracle\_sid\_name”: “SRCPROD”, “export\_fact\_oracle\_tns\_admin”: “/u01/app/oracle/product/19c/dbhome\_1/network/admin”, “export\_fact\_rdbms\_home”: “/u01/app/oracle/product/19c/dbhome\_1”, “export\_fact\_schema”: “source”, “export\_fact\_shared\_scratchpad\_s3\_bucket”: “/mnt/hgfs/Linux\_share/scratchpad/”, “import\_fact\_oracle\_local\_hostname”: “”, “import\_fact\_oracle\_sid\_name”: “”, “import\_fact\_schema”: “” } } } } ok: [192.168.1.108] =\> { “ansible\_local”: { “export”: { “localfacts”: { “export\_fact\_ansible\_env\_path”: “/home/ansible\_admin”, “export\_fact\_container\_database\_type”: “legacy”, “export\_fact\_export\_flag”: “on”, “export\_fact\_oracle\_database\_environment\_purpose”: “UAT”, “export\_fact\_oracle\_database\_environment\_readonly”: “false”, “export\_fact\_oracle\_export\_datapump\_dir”: “DATA\_PUMP\_DIR”, “export\_fact\_oracle\_export\_user\_name”: “source”, “export\_fact\_oracle\_export\_user\_password”: , “export\_fact\_oracle\_listener\_port\_number”: “1521”, “export\_fact\_oracle\_local\_hostname”: “lnx073”, “export\_fact\_oracle\_rdbms\_version”: “19.0.0”, “export\_fact\_oracle\_sid\_name”: “SRCUAT”, “export\_fact\_oracle\_tns\_admin”: “/u01/app/oracle/product/19c/dbhome\_1/network/admin”, “export\_fact\_rdbms\_home”: “/u01/app/oracle/product/19c/dbhome\_1”, “export\_fact\_schema”: “source”, “export\_fact\_shared\_scratchpad\_s3\_bucket”: “/mnt/hgfs/Linux\_share/scratchpad/”, “import\_fact\_oracle\_local\_hostname”: “lnx072”, “import\_fact\_oracle\_sid\_name”: “SRCPROD”, “import\_fact\_schema”: “source” } } } }

TASK [Check if Lockfile Exists or an Earlier Refresh Still Running | prepare oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ok: [192.168.1.64] ok: [192.168.1.108]

TASK [Create Lockfile if Doesnt Exist | prepare oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* changed: [192.168.1.64] changed: [192.168.1.108]

TASK [Generate Local SOURCE Db Export ParFile from a Centralized JINJA Refresh Template | prepare oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* changed: [192.168.1.64] changed: [192.168.1.108]

TASK [Export Source Schema to Scratchpad Usng the Custom Parfile | prepare oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* skipping: [192.168.1.108] changed: [192.168.1.64]

TASK [Generate One or More Target Schema Refresh ParFiles from a Centralized JINJA Refresh Template | prepare oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* skipping: [192.168.1.64] changed: [192.168.1.108]

TASK [Import into the Destination Db Usng the Custom Import ParFile | execute oracle\_database\_refresh of the “source” schema in the “SRCPROD” Database on “lnx072”] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* skipping: [192.168.1.64] changed: [192.168.1.108]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 192.168.1.108 : ok=8 changed=4 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0  
192.168.1.64 : ok=7 changed=3 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0

[ansible\_admin@ctrl ansible]$

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [May 6, 2025, 6:57pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/2 "2025-05-06T18:57:41Z")

</div>

Hi Symian. You did not show your whole playbooks and how they are suposed to call one another so it’s a bit hard to follow.

In your current setup, if I understood you correctly, this can be easily solved by replacing `include` with `import_playbook`.

What remains as a topic is whether your approach of splitting playbook functionality is sensible for your case.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [May 6, 2025, 11:06pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/3 "2025-05-06T23:06:10Z")

</div>

You cannot import a play inside a play, that is why you get an error about gather\_facts. You can import the play at the same level as other plays in a playbook, but not contained in one:

```auto
- name: first play
  tasks:
   ....
   - import_playbook: thiswontwork.yml

```

do it this way:

```auto
- name: first play
  tasks:
   ....
   # prev play ends

- import_playbook: thisworks.yml

```

---

<div class="post-metadata">

**Author:** ![Symian](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/symian/32/8301_2.png) [@Symian](https://forum.ansible.com/u/Symian)\
**Post date:** [May 6, 2025, 11:59pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/4 "2025-05-06T23:59:20Z")

</div>

Thank you. Uploaded the code: [https://github.com/symianarmy/oracle\_database\_refresh\_itsm](https://github.com/symianarmy/oracle_database_refresh_itsm)

---

<div class="post-metadata">

**Author:** ![Symian](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/symian/32/8301_2.png) [@Symian](https://forum.ansible.com/u/Symian)\
**Post date:** [May 7, 2025, 12:00am UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/5 "2025-05-07T00:00:07Z")

</div>

Much appreciated, uploaded the code: [https://github.com/symianarmy/oracle\_database\_refresh\_itsm](https://github.com/symianarmy/oracle_database_refresh_itsm)

---

<div class="post-metadata">

**Author:** ![Symian](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/symian/32/8301_2.png) [@Symian](https://forum.ansible.com/u/Symian)\
**Post date:** [May 7, 2025, 1:42am UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/6 "2025-05-07T01:42:08Z")

</div>

wow, your solution did work, thank you. Now I need to figure out how to close the task after the refresh. What I need to extend your solution further by adding two “- import playbook” statements, not just one. The wrapper would create a ticket. It would then call the actual script. It will do the actual refreshing, and call the third YML playbook to close the same ticket. But now I have to pass the VAR of ticket id from the first playbook(the wrapper) to the third, the finish playbook that will verify the refresh SYS-ID and then close the refresh task automatically.  
But how do I pass that var between the multiple include playbooks? Many thanks. Syman.

itsm\_oracle\_refresh\_wrapper.yml  
itsm\_oracle\_refresh\_actual.yml  
itsm\_oracle\_refresh\_finish.yml

---

<div class="post-metadata">

**Author:** ![wayt](https://avatars.discourse-cdn.com/v4/letter/w/3be4f8/32.png) [@wayt](https://forum.ansible.com/u/wayt)\
**Post date:** [May 7, 2025, 4:43am UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/7 "2025-05-07T04:43:56Z")

</div>

All facts ( `set_fact` ) are shared between plays for a host.

---

<div class="post-metadata">

**Author:** ![Symian](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/symian/32/8301_2.png) [@Symian](https://forum.ansible.com/u/Symian)\
**Post date:** [May 7, 2025, 12:09pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/8 "2025-05-07T12:09:37Z")

</div>

Thank you, @wayt . I tried your solution. It did not work because the facts and the vars are different. In an effort to be concise I opened another question [Ansible, 'import\_playbook' has extra params, Multiple Includes Fail!](https://forum.ansible.com/t/ansible-import-playbook-has-extra-params-multiple-includes-fail/42514) , please answer that one as well. The new code is modified. There is also a repo with the code.  
Thx.  
Symian.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 6, 2025, 12:10pm UTC](https://forum.ansible.com/t/ansible-conflicting-hosts-and-facts-settings-in-two-playbooks-for-oracle/42479/9 "2025-06-06T12:10:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
