1===================================
2Oracle Cloud Infrastructure Guide
3===================================
4
5************
6Introduction
7************
8
9Oracle provides a number of Ansible modules to interact with Oracle Cloud Infrastructure (OCI). In this guide, we will explain how you can use these modules to orchestrate, provision and configure your infrastructure on OCI.
10
11************
12Requirements
13************
14To use the OCI Ansible modules, you must have the following prerequisites on your control node, the computer from which Ansible playbooks are executed.
15
161. `An Oracle Cloud Infrastructure account. <https://cloud.oracle.com/en_US/tryit>`_
17
182. 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 <https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policies.htm>`_.
19
203. The necessary credentials and OCID information.
21
22************
23Installation
24************
251. Install the Oracle Cloud Infrastructure Python SDK (`detailed installation instructions <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/installation.html>`_):
26
27.. code-block:: bash
28
29        pip install oci
30
312.  Install the Ansible OCI Modules in one of two ways:
32
33a.	From Galaxy:
34
35.. code-block:: bash
36
37 ansible-galaxy install oracle.oci_ansible_modules
38
39b.	From GitHub:
40
41.. code-block:: bash
42
43     $ git clone https://github.com/oracle/oci-ansible-modules.git
44
45.. code-block:: bash
46
47    $ cd oci-ansible-modules
48
49
50Run one of the following commands:
51
52- If Ansible is installed only for your user:
53
54.. code-block:: bash
55
56    $ ./install.py
57
58- If Ansible is installed as root:
59
60.. code-block:: bash
61
62    $ sudo ./install.py
63
64*************
65Configuration
66*************
67
68When creating and configuring Oracle Cloud Infrastructure resources, Ansible modules use the authentication information outlined `here <https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdkconfig.htm>`_.
69.
70
71********
72Examples
73********
74Launch a compute instance
75=========================
76This `sample launch playbook <https://github.com/oracle/oci-ansible-modules/tree/master/samples/compute/launch_compute_instance>`_
77launches a public Compute instance and then accesses the instance from an Ansible module over an SSH connection. The sample illustrates how to:
78
79- Generate a temporary, host-specific SSH key pair.
80- Specify the public key from the key pair for connecting to the instance, and then launch the instance.
81- Connect to the newly launched instance using SSH.
82
83Create and manage Autonomous Data Warehouses
84============================================
85This `sample warehouse playbook <https://github.com/oracle/oci-ansible-modules/tree/master/samples/database/autonomous_data_warehouse>`_ creates an Autonomous Data Warehouse and manage its lifecycle. The sample shows how to:
86
87- Set up an Autonomous Data Warehouse.
88- List all of the Autonomous Data Warehouse instances available in a compartment, filtered by the display name.
89- Get the "facts" for a specified Autonomous Data Warehouse.
90- Stop and start an Autonomous Data Warehouse instance.
91- Delete an Autonomous Data Warehouse instance.
92
93Create and manage Autonomous Transaction Processing
94===================================================
95This `sample playbook <https://github.com/oracle/oci-ansible-modules/tree/master/samples/database/autonomous_database>`_
96creates an Autonomous Transaction Processing database and manage its lifecycle. The sample shows how to:
97
98- Set up an Autonomous Transaction Processing database instance.
99- List all of the Autonomous Transaction Processing instances in a compartment, filtered by the display name.
100- Get the "facts" for a specified Autonomous Transaction Processing instance.
101- Delete an Autonomous Transaction Processing database instance.
102
103You can find more examples here: `Sample Ansible Playbooks <https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/ansiblesamples.htm>`_.
104