Oracle Cloud Infrastructure Documentation

Ansible Modules

This topic provides information about installing, configuring, and using Ansible and the Oracle Cloud Infrastructure Ansible modules.

Oracle supports the use of Ansible for cloud infrastructure provisioning, orchestration, and configuration management. Ansible allows you to automate configuring and provisioning your cloud infrastructure, deploying and updating software assets, and orchestrating your complex operational processes.

What enables orchestrating, provisioning, and configuration management tasks are the Ansible modules for Oracle Cloud Infrastructure. Ansible provides a library of these Ansible modules "out of the box" for managing common tasks, and libraries of custom modules from cloud providers like AWS and Azure (see the Module Index). Oracle also provides a library of Ansible cloud modules that support provisioning and managing Oracle Cloud Infrastructure services.

Ansible playbooks automate configuration, deployment, and orchestration tasks using a declarative language (YAML), which allows you to describe infrastructure configuration, deployment policy, and orchestrating complex process steps, either synchronously or asynchronously. Ansible playbooks can be thought of as automation instruction manuals; Ansible modules, then, are your task execution tools.

Ansible modules allow you to author Ansible playbooks that enable automating the provisioning and configuring of Oracle Cloud Infrastructure services and resources, such as Compute, Load Balancing, Database, and other Oracle Cloud Infrastructure services.

  • Services supported:

    • Block Volume
    • Compute
    • Container Engine for Kubernetes
    • Database
    • DNS
    • Email Delivery
    • File Storage
    • IAM
    • Load Balancing
    • Networking
    • Object Storage
    • Search
    • WAF
  • Licensing: Copyright © 2018, Oracle and/or its affiliates. This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. See LICENSE.TXT for details.
  • Download: You can download the Oracle Cloud Infrastructure Ansible Module from the Oracle GitHub repository. Please follow guidance in Getting Started with Ansible for Oracle Cloud Infrastructure, in the section "Installing the Oracle Cloud Infrastructure Ansible Modules."
  • Documentation: Getting Started with Ansible for Oracle Cloud Infrastructure


To use Ansible, you must have the following prerequisites on your controller computer, that is, the computer from which Ansible playbooks are executed. For more information, see the Ansible Installation Guide.

  • An Oracle Cloud Infrastructure account.
  • A user created in that account, in a security group with a policy that grants the necessary permissions for working with resources in those compartments. For guidance, see How Policies Work.
  • The necessary credentials and OCID information.
  • The Oracle Cloud Infrastructure Python SDK. To download and install the SDK, see the topic Python SDK.
  • Install the Ansible modules by following guidance in Getting Started with Ansible for Oracle Cloud Infrastructure, in the section "Installing the Oracle Cloud Infrastructure Ansible Modules."

Ansible Key Concepts


Modules represent discrete provisioning tasks or operations that you can invoke individually from the command line, or else run individually or in sequence from a playbook. Ansible provides a large library of out-of-box modules that are listed in the Module Index. Other Ansible providers like Microsoft Azure and Amazon Web Services (AWS) also provide libraries of Ansible modules. Oracle also provides a library of Ansible modules that interact with services. For more information, see Working with Modules.


Playbooks provide a declarative language that allows you to create and persist your Ansible cloud infrastructure provisioning tasks. Playbooks are coded sets of instructions that you create to manage cloud infrastructure provisioning, and more advanced processes. For more information, see Working with Playbooks. See also a set of available Example Playbooks.


Ansible roles are units of organization that allows you to abstract configuration, orchestration, and provisioning tasks into roles that you can save and share among playbooks and other users, and that are useful for organizing functionality in playbooks. In a sense, playbooks are minimalist playbooks that encapsulate common configuration steps so you can share them across users or playbooks. For more information, see Ansible Roles.


Ansible inventory is a means for describing hosts and groups. The inventory can be static (as a simple .ini file), or dynamic, where a look-up script assembles an up-to-date infrastructure inventory. For more information about Ansible inventory, see Working with Inventory.


When using Ansible to work with Oracle Cloud Infrastructure hosts, we recommend using the Oracle dynamic inventory script to obtain a dynamic inventory list. For more information, see Using the Dynamic Inventory Script.


To be notified when new Ansible modules are released, subscribe to the Ansible Atom Feed.

Questions or Feedback

Ways to get in touch: