Get Started with Oracle Linux Automation Manager

3
0
Send lab feedback

Get Started with Oracle Linux Automation Manager

Introduction

Oracle Linux Automation Manager provides features that allow your organization to manage infrastructure configuration effectively through a browser-based user interface.

By the end of this tutorial, you'll have a working Oracle Linux Automation Manager installation ready to run more complex playbooks.

Objectives

In this tutorial, you'll learn how to:

  • Use the WebUI
  • Review the Default Organization
  • Add a User
  • Set up an Inventory
  • Set up a Credential
  • Create a Project
  • Set up a Job Template
  • Run the Job

Prerequisites

  • A control system with Oracle Linux Automation Manager installed.
  • A remote system to run playbooks against.

For details on installing Oracle Linux Automation Manager, see the Oracle Linux Automation Manager Installation Guide .

Deploy Oracle Linux Automation Manager

Note: If running in your own tenancy, read the linux-virt-labs GitHub project README.md and complete the prerequisites before deploying the lab environment.

  1. Open a terminal on the Luna Desktop.

  2. Clone the linux-virt-labs GitHub project.

    git clone https://github.com/oracle-devrel/linux-virt-labs.git
  3. Change into the working directory.

    cd linux-virt-labs/olam
  4. Install the required collections.

    ansible-galaxy collection install -r requirements.yml
  5. Update the Oracle Linux instance configuration.

    cat << EOF | tee instances.yml > /dev/null
    compute_instances:
      1:
        instance_name: "olam-node"
        type: "control"
      2:
        instance_name: "ol-host"
        type: "remote"
    EOF
  6. Deploy the lab environment.

    ansible-playbook create_instance.yml -e ansible_python_interpreter="/usr/bin/python3.6" -e "@instances.yml" -e olam_single_host=true

    The free lab environment requires the extra variable ansible_python_interpreter because it installs the RPM package for the Oracle Cloud Infrastructure SDK for Python. The location for this package's installation is under the python3.6 modules.

    The default deployment shape uses the AMD CPU and Oracle Linux 8. To use an Intel CPU or Oracle Linux 9, add -e instance_shape="VM.Standard3.Flex" or -e os_version="9" to the deployment command.

    Important: Wait for the playbook to run successfully and reach the pause task. The Oracle Linux Automation Manager installation is complete at this stage of the playbook, and the instances are ready. Take note of the previous play, which prints the public and private IP addresses of the nodes it deploys.

Login to the WebUI

  1. Open a terminal and configure an SSH tunnel to the deployed Oracle Linux Automation Manager instance.

    ssh -o ExitOnForwardFailure=yes -f -L 8444:localhost:443 oracle@<public_ip_address_of_olam-node> sleep 300
    • -o ExitOnForwardFailure=yes: waits for all remote port forwards to establish successfully
    • -f: runs the SSH tunnel in the background
    • -L: creates the tunnel on port 8444 on the local system and 443 on the remote system
    • sleep 300: keeps remote tunnel open for 5 minutes, waiting for an established connection before automatically closing
  2. Open a web browser and enter the URL.

    https://localhost:8444

    Note: Approve the security warning based on the browser used. For Chrome, click the Advanced button and then the Proceed to localhost (unsafe) link.

  3. Login to Oracle Linux Automation Manager with the Username admin and the Password admin created during the automated deployment.

    olam2-login

  4. After login, the WebUI displays.

    olam2-webui

Oracle Linux Automation Manager's centralized web UI engine allows for securely and efficiently controlling and managing your infrastructure.

The product is based on the open-source Ansible and AWX projects, providing a visual dashboard for role-based access control, inventory management, and scheduling jobs.

  1. Along the left-hand side of the WebUI, there is a navigation menu allowing quick access to Projects, Inventories, Templates, and Jobs.

    olam2-nav-menu

  2. Click the menu icon at the top of the menu to collapse and hide the menu. Click it again to expand and unhide the menu.

    olam2-nav-hide

  3. At the bottom of the navigation menu is the Settings menu item.

    olam2-settings-menu

  4. Select this item to navigate to the Settings page.

    olam2-settings-page

    The Settings page gives access to alternative Authentication settings and settings for Job, System, and the User Interface.

  5. Click the Dashboard menu item in the navigation menu.

    olam2-dashboard-page

    Clicking this menu item returns you to the main dashboard view showing current Job Status, Recently Used Templates, and Recent Job Runs. The list of recent items only appears after using templates or running jobs.

Review the Default Organization

Organizations sit at the top of the role-based pyramid and are a logical collection of users, teams, projects, and inventories.

  1. In the navigation menu, click Organizations.

    olam2-org-menu

    The main window displays a list of the available organizations.

    olam2-org-page

    Oracle Linux Automation Manager automatically creates a Default organization available to all users.

  2. View the Default organization by clicking the organization's name.

    olam2-org-default-details

    For this tutorial, we'll use the Default organization as is.

  3. (Optional) If needing to make changes to the Default organization, click the Edit button.

    Make any desired changes and then click the Save button.

    olam2-org-default-edit

Administrators needing information about creating new organizations should see the Oracle Linux Automation Manager Users Guide .

Add a User

The WebUI navigation menu Access section manages the default user administration of Oracle Linux Automation Manager. The user administration is role-based and consists of a combination of Organizations, Users, and Teams. Adding users is possible from the Users navigation menu item or directly from within an organization.

Find an Organization's Users

  1. Click the Access tab on the Default organization's details page.

    olam2-org-default-details

  2. The Default organization's access page shows the admin user.

    After installation, the admin user is the only Oracle Linux Automation Manager user and part of the Default organization.

    olam2-org-default-access

  3. From this page, you can add a new user by clicking the Add button or view the admin user details by clicking the admin user name.

  4. View the admin user by clicking the admin user's name.

    Clicking this item displays the user details page.

    olam2-user-details

  5. Click the Edit button to show the Edit Details page.

    This page allows editing the user's email, password, role, and other details.

    olam2-user-edit-details

    Important: Do not change the admin user's type (role). Oracle Linux Automation Manager requires at least one System Administrator. Changing the admin user type without having another user with the System Administrator role will lock you out of administrating Oracle Linux Automation Manager.

    Click the Cancel button.

Add a User

  1. In the navigation menu, click Users.

    olam2-user-menu

    The main window displays a list of available users.

    olam2-user-page

  2. Click the Add button to create a new user.

  3. Add the required details on the Create New User page.

    olam2-user-create

  4. Click the Save button.

  5. The new user details page displays.

    olam2-user-details-new

Set up an Inventory

An inventory is a group of hosts managed by Oracle Linux Automation Manager. Users leverage an inventory to automate host orchestration by running playbooks.

  1. View the current list of inventories by clicking the Inventories navigation menu item.

    olam2-inv-menu

    The main window shows the message No Inventories Found on a new installation.

  2. Add a new inventory by clicking the Add button.

    Select Add Inventory from the drop-down menu.

    olam2-inv-page

  3. Add the requested details to the Create new inventory page.

    olam2-inv-create

  4. Click the Save button when finished.

  5. The new inventory details page displays.

    olam2-inv-details

  6. Click the Hosts tab from the inventory details page.

    olam2-inv-hosts

    The page displays a list of hosts that are associated with the inventory. The message No Hosts Found appears on a newly created inventory until you add the first host.

  7. Click the Add button.

    The Create new host page displays.

    olam2-inv-host-create

  8. Enter a hostname or IP address for a host in the Name text field.

    When using hostnames, they must be resolvable on the network where the Oracle Linux Automation Manager resides.

    olam2-inv-host-create2

    Enter ol-host, which is the hostname of the target remote instance.

  9. Click the Save button.

    The main window displays the Host details page and summarizes information about the newly created host we added to the inventory.

    olam2-inv-host-detail

Set up a Credential

Credentials authenticate a user within Oracle Linux Automation Manager against machines using passwords and SSH keys, sync inventory sources, and import playbooks from version control systems such as GitHub. Each credential may contain usernames, passwords, private keys, or other security-related information.

  1. Navigate within the menu and click Credentials.

    olam2-cred-menu

    The Credentials page displays a No Items Found message on a newly installed system.

    olam2-cred-page

  2. Click the Add button.

    The Create New Credential page displays.

    olam2-cred-create

  3. Enter the requested information.

    olam2-cred-create2

    Select the Machine credential type in the Credential Type list of values.

    olam2-cred-type

    The Create New Credential page expands to allow you to enter information for specific hosts or machines.

    olam2-cred-type-detail2

    Enter a Username of opc and browse for the SSH Private Key. Clicking the Browse... button displays an Open File dialog window.

    olam2-open-file

    Select Home in the Open File dialog menu.

    Right-click on the main window of the dialog and then select Show Hidden Files.

    olam2-show-hide

    Then select the .ssh folder and the id_rsa file. Clicking the Select button causes the contents of the private key file to copy into the SSH Private Key dialog box. Scroll down and click the Save button.

  4. The main window updates to show the credential Details page.

    This page provides a summary of the newly created credentials.

    olam2-cred-detail-summary

Create a Project

A Project is a compilation of playbooks grouped based on their actions or the hosts with which they interact.

We have multiple ways to manage these playbooks using Oracle Linux Automation Manager, such as manually or using a git-based source control management (SCM) solution like GitHub or GitLab.

Use Source Control

While Oracle Linux Automation Manager allows storing playbooks locally on the same server, storing them within a supported source control server such as Git is best practice.

Oracle provides a collection of sample Ansible playbooks on GitHub for use with Oracle Linux Automation Manager or Oracle Linux Automation Engine.

If using a private Git repository, you'll need to add a Source Control credential type under Credentials to allow access. These credentials enable Oracle Linux Automation Manager to pull the project securely over an SSH connection. A Git repository uses the username git by default and a private key from an SSH key pair configured with the Git server.

Create a SCM Project

  1. Click Projects in the navigation menu.

    olam2-project-menu

  2. Then click the Add button.

    olam2-project-page

  3. Enter the requested information on the Create New Project page.

    olam2-project-new

  4. Click the search icon next to the Execution Environment list of values.

  5. In the Select Execution Environment pop-up dialog box, click the OLAM EE (2.2) radio button.

    olam2-project-env

  6. Click the Select button to close the dialog box.

  7. Select Git from the Source Control Credential Type list of values.

    olam2-project-cred-type

    The Create New Project page expands to show the Type Details.

  8. Enter the Source Control URL value into the text field.

    https://github.com/oracle-devrel/linux-virt-labs.git

    Click the more information icon next to this field to see sample values. A Source Control Credential is unnecessary for a public repository where the project is available without authentication over the HTTPS protocol.

  9. Review each of the additional Options.

    olam2-project-type-options

    Clicking on the more information icon next to each option provides details on its functionality.

  10. Click the Save button.

  11. The main window displays a project summary on a Details page.

    If the project can adequately communicate with the Git server and pull the project, a Successful job status will appear in the summary details.

    olam2-project-detail-summary

Set up a Job Template

A Job Template consists of all the parts and pieces required to run a playbook and represents the ansible-playbook command provided in the Oracle Linux Automation Engine.

  1. From the navigation menu, click Templates.

    olam2-template-menu

  2. Click the Add button on the main Templates page.

    olam2-template-page

  3. Select Add job template from the displayed list of values.

  4. Enter the requested information on the Create New Job Template page.

    olam2-template-new-job

  5. Scroll to the bottom, and click the Save button.

  6. The Detail summary page displays the new template.

    olam2-template-summary

Run the Job

With the template creation complete, we can now run the playbook.

  1. Using the breadcrumbs navigation at the top of the page, click Templates.

    olam2-template-bc

    This click returns you to the Templates overview page.

    olam2-template-list

  2. Use the rocket icon under the Actions column and launch the Hello Template job template.

    olam2-template-launch

  3. After launch, a status page displays the job output and, eventually, the results.

    olam2-template-job-output

    The playbook prints a welcome message to the screen if it runs successfully.

Next Steps

The welcome message confirms you have a working Oracle Linux Automation Manager installation and a successful run of your first job. Now, you are ready to explore more of our content around automation on the Oracle Linux Training Station.

Oracle Linux Automation Manager Documentation
Oracle Linux Automation Manager Training
Oracle Linux Training Station

SSR