1Z0-1067-25 Question 29
Single answerYour organization frequently launches and terminates multiple Compute instances in Oracle Cloud Infrastructure. You need to ensure these instances are automatically configured using Ansible whenever they come online. What is the most effective way to have an up-to-date list of live instances for your Ansible playbooks with minimal manual maintenance?
- A
Maintain a static inventory file with IP addresses and update it manually whenever instances change
- B
Leverage Oracle Cloud Infrastructure� dynamic inventory plugin for Ansible to discover instances automatically
- C
Create a JSON file that is periodically refreshed from the OCI CLI and reference it as an Ansible inventory
- D
Rely on an external load balancer configuration to translate to Ansible host entries
Show answer and explanation
Correct answer: B
Explanation
Using automation tools like Ansible in a dynamic OCI environment calls for real-time visibility into infrastructure changes. Oracle Cloud Infrastructure offers a native dynamic inventory plugin for Ansible that queries OCI resources and retrieves the current list of Compute instances automatically. This approach aligns with best practices and is detailed in Oracle� official documentation: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/ansibleinventoryintro.htm
- A. Incorrect.
Option 1: Incorrect. Manually updating a static inventory file is prone to human error and is impractical in a dynamic environment where instances are frequently added or removed.
- B. Correct.
Option 2: Correct. The OCI dynamic inventory plugin for Ansible automatically retrieves the current list of Compute instances, reducing manual intervention and ensuring accurate inventory in real-time.
- C. Incorrect.
Option 3: Incorrect. While generating a JSON file from the CLI is a possible workaround, it requires additional scripting and scheduling, which is more complex and less automated than using the native OCI dynamic inventory plugin.
- D. Incorrect.
Option 4: Incorrect. An external load balancer configuration does not provide a comprehensive Ansible inventory of instances and does not directly track the environment� state. It� intended for directing traffic, not for managing infrastructure configurations.