Quick Start

This scenario teaches you the basic operations of Exastro IT Automation by using a simple example: changing a hostname.
The goal of this scenario is to help you understand the greatest benefit of automation with Exastro IT Automation.
For this scenario, you’ll need to perform the following preparatory steps:
After completing the preparatory steps, you’ll perform the minimum necessary operations, such as registering an operation overview and configuring parameters, to repeatedly execute the task.
The goal of this scenario is for you to understand that once you complete the initial setup, you can perform the same task repeatedly with simple operations.

Prerequisites

The following conditions are necessary to run this scenario:
  1. An available server (RHEL8).

  2. The user must be able to log in via SSH and have full sudoer privileges.

  3. A workspace for the task.

Preparation

Design the format for system configuration information.
You don’t need to manage all system information as parameters. You can add or review them as needed when management becomes necessary in the future.

Create a Parameter Sheet

Parameter Sheet Creation, you manage parameter sheets for registering configuration values (parameters) used during operations.
Create a parameter sheet to manage hostnames.
Parameter Sheet Creation ▶ Parameter Sheet Definition/Creation, Create a parameter sheet named “Server Basic Information” to manage hostnames.
Create a parameter sheet
Table 53 Parameter Sheet Creation (Server Basic Information) - Item Settings

Setting Item

Setting Value (Item 1)

Field Name

Hostname

Field Name(For Rest API)

Hostname

Input Method

String(Single Line)

Maximum Bytes

64

Regexp

Initial Value

Required

Unique Constraint

Description

Remarks

Table 54 Configuration values for the creation of the Server Basic Information Parameter Sheet

Setting Item

Setting Value

Item Number

(Automatic Input)

Parameter Sheet Name

Server Basic Information

Parameter Sheet Name(REST)

Server_Information

Object To Be Created

Parameter Sheet(Hosted with Operations)

Display Order

1

Bundle Usage

Uncheck “Use” (Disabled)

Last Updated Timestamp

(Automatic Input)

Last Updated User

(Automatic Input)

Configure Work Items

To register a work procedure, you define a Movement (Job), which is the work unit handled in Exastro IT Automation.
In Exastro IT Automation, work is managed in units called Movements. A Movement corresponds to a work item in a work procedure manual.
A Movement is used to associate IaC (Infrastructure as Code) like an Ansible Playbook, or to link variables within the IaC to setting values in a parameter sheet.
:menuselection: From Ansible-Legacy –> Movement list, you register a Movement for hostname settings.
Movement Registration
Table 55 Movement Information Settings

Movement Name

Ansible Usage Information

Host Specification Format

Header Section

Hostname settings

IP

*See the Header section.

Listing 259 Header Section
- hosts: all
  remote_user: "{{ __loginuser__ }}"
  gather_facts: no
  become: yes

Register an Ansible Playbook

You will now register an Ansible Playbook. An Ansible Playbook corresponds to a command described in an operation manual.
In Ansible-Legacy mode, it is assumed that you will use a Playbook that you have created yourself.
A benefit of using Ansible-Legacy mode is the ability to freely create procedures by developing Playbooks that suit your specific needs.
However, to use Ansible-Legacy mode, you need knowledge of Playbook creation, as you must create the Playbooks yourself.
In this scenario, you’ll use the following Playbook. Please copy the code below and create hostname.yml in YAML format.
Listing 260 hostname.yml
- name: Set a hostname
  ansible.builtin.hostname:
    name: "{{ hostname }}"
Ansible-Legacy ▶ Playbook Library, you’ll register the Playbook mentioned above.
Playbook登録
Table 56 Ansible Playbook Information registration

Playbook Material Name

Playbook Material

hostname

hostname.yml

Register Devices

Register the target servers in the device list.
Ansible Common ▶ Device list,you register the connection information for the target servers.
Device list registration
Table 59 Device list settings

HW Device Type

Host Name

IP Address

Login Password

SSH Key Authentication Information

Ansible Usage Information

User

SSH Private Key File

Legacy/Role Usage Information

Authentication Method

SV

server01

192.168.0.1 *Set a proper IP address

Connection Username

(Private Key File)

Key Authentication(No Passphrase)

Tip

In this scenario, we’ll use key authentication, but you can also use password authentication. Please change the authentication method as needed, depending on how you log in to the target server.

Repetitive task (1st time)

Before we consider the specific parameter settings and work procedures, we’ll start by creating a work plan. First, let’s briefly organize the key information: what to do, how to do it, when to do it, and which devices to do it on.

Table 60 Work Approach

Execution Date And Time

2024/04/01 12:00:00

Target

Target Server(RHEL8)

Work Details

Hostname Change

Register Operation Overview (1st time)

When you register an operation, you define the work summary for carrying out the task. You must create one operation for each task, and you should not reuse operations.
Based on the work policy you’ve already decided on, let’s fill in the operation details.
Basic Console ▶ Operation List, register the task execution date and time, as well as the task name.
Operation Registration
Table 61 Operation Registration Details

Operation Name

Execution Schedule

RHEL8 Hostname Change Task

2024/04/01 12:00:00

Tip

In this scenario, the task execution date and time can be set arbitrarily. However, if the actual work date has been determined, it is recommended to set the exact scheduled execution date and time.
For tasks that are performed repeatedly, such as periodic operations, if the exact work date is not determined, it is acceptable to register the current date and time.

Set Parameters (1st time)

The parameter sheet is used to register the parameters to be configured for each device.
For the operation, select the task created in the task overview registration, such as RHEL8 Hostname Change Task. By selecting an operation, you can associate the target server and parameters with that operation.
In this scenario, the hostname server01 is set as the target server for the task.
Input ▶ Basic Server Information, parameters are registered for the host.
Parameter Registration
Table 62 Basic Server Parameter Settings

Host Name

Operation

Parameters

Operation Name

Host Name

server01

2024/04/01 12:00:00_RHEL8 Hostname Change Task

server01

Execute Task (1st time)

  1. Pre-execution Check

    First, let’s check the current status of the server.
    Log in to the target server via SSH and check the current hostname.
    Listing 261 Command
    # Getting the Hostname
    hostnamectl status --static
    
    Listing 262 Execution Result
    # The results will differ between environments.
    localhost
    
  2. Task Execution

    Ansible-Legacy ▶ Task Execution, select the Setting the Hostname Movement, then click  Task Execution.
    Next, in Task Execution Settings, select RHEL8 Hostname Change Task for the operation, and click Confirm Selection.
    Finally, review the execution details and click Confirm Selection.
    Check Task Status After the screen opens and the execution is complete, verify that the status has changed to ‘Completed’.
Task Execution
  1. Post-check

    Log in to the target server via SSH again and verify that the hostname has been changed.
    Listing 263 Command
    # Getting the Hostname
    hostnamectl status --static
    
    Listing 264 Execution Result
    server01
    

Repetitive task (2nd time)

Before considering specific parameter settings or task procedures, start by creating a work plan. First, let’s briefly organize the information: when, on which device, what will be done, and how it will be carried out.

Table 63 Task Policy

Execution Schedule

2024/05/01 12:00:00

Target of the Task

Target Server(RHEL8)

Task Details

Hostname Update

Register Operation Overview (2nd time)

During operation registration, the task overview for performing the work is defined. Create one operation per task. Operations should not be reused.
Enter the operation details based on the previously established work policy.
Basic Console ▶ Operation List, register the task execution date and time, as well as the task name.
Operation Registration
Table 64 Operation Registration Details

Operation Name

Scheduled Date and Time

RHEL8 Hostname Update Operation

2024/05/01 12:00:00

Tip

For this scenario, any appropriate date and time can be used for the task execution date and time. However, if the work date is fixed, it is recommended to set the accurate scheduled execution date and time.
For recurring tasks such as regular maintenance where the exact work date is not determined, it is acceptable to register the current date and time.

Set Parameters (2nd time)

In this scenario, the hostname server01 was set as the parameter value.
However, the hostname is also managed in the Device List, resulting in duplicate management of the hostname.
In Exastro IT Automation, device information can be acquired via ansible_common_ita_original_variable, and the hostname of the target host can be obtained using the variable __inventory_hostname__. This enables centralized management of parameters.
Input ▶ Basic Console, let’s register the hostname listed in the device list using the ITA-specific variables.
Parameter Settings
Table 65 Configuration Values for Basic Server Parameters

Host Name

Operation

Parameter

Operation Name

Host Name

server01

2024/05/01 12:00:00_RHEL8 Hostname Update Operation

"{{ __inventory_hostname__ }}"

Using the __inventory_hostname__ variable enables referencing the host information stored in the device list.
Next, update the hostname of the target server to db01.
Ansible Common ▶ Device list, update the hostname of the target server to db01
Parameter Registration
Table 66 Configuration Values in the Device List

HWDevice Type

Host Name

IP Address

Login Password

ssh Authentication Key Info

Ansible Configuration Information

User

ssh Authentication Key Info

Linkegacy/Role Usage Information

Authentication Method

SV

db01

192.168.0.1 *Set the appropriate IP address

Connection Username

(Private Key File)

Key Authentication(No Passphrase)

Execute Task (2nd time)

  1. Execute Task

    In Ansible-Legacy ▶ Execution, select the Host Name Setting Movement, and click  Working execution to run the task.
    Next, in Working execution setting, select the RHEL8 Hostname Update Task operation, then click Decision to select.
    Finally, review the execution detail, then click Working execution.
    Open the Check operation status, after the execution is complete, confirm that the status has changed to “Completed.”
Execute Task
  1. Post-Execution Check

    Log in to the server again via SSH and verify that the hostname has been changed.
    Listing 265 Command
    # Getting the Hostname
    hostnamectl status --static
    
    Listing 266 Execution Result
    db01
    
The following steps, Ansible Common ▶ Device list, by simply changing the hostname and executing the task, you can update the hostname.

Overview

Through the scenario of setting the hostname on a RHEL8 server, you have learned the basic operation of Exastro IT Automation.
Additionally, you have learned about the greatest benefit of automation with Exastro IT Automation: improving efficiency by automating repetitive tasks.