2. Ansible-Legacy¶
2.1. Introduction¶
This document aims to explain how to use Ansible-Legacy.
2.2. Ansible-Legacy overview¶
Ansible Legacy uses the standard Ansible function to input settings to the different hosts.
Register structure code as YAML files configure them with job patterns.
It can be used to configure environments to servers, storages and network devices.
2.4. Ansible-Legacy procedure¶
This section explains how to use Ansible-Legacy.
2.4.1. Ansible-Legacy workflow¶
A standard workflow using Ansible Legacy can be seen below.
Workflow details and references
- Register connection information for the targetFrom themenu, register connection information for the target.For more information, see Device list.
- Register operation nameFrom themenu, register an Operation list.For more information, see Operation list.
- **Register Ansible Automation Controller host information (if needed) **From themenu, Register information for the Ansible Automation Controller host.For more information, see Ansible Automation Controller host list.
- Register Interface informationFrom themenu, select Ansible Core, Ansible Automation Controller or Ansible Execution Agent for the execution engine and register connection information for the execution engine serverFor more information, see Interface information.
- Register Execution environment definition template management(If needed)From themenu, Register the template file for the Execution environment definition file (execution-environment.yml) which is used to build the Execution environment by the ansible-builder within the Ansible Execution Agent.For more information, see ansible_execution_environment_definition_template_list and Using the Template file registered to Ansible common ▶ Execution environment definition template ` and :menuselection:"Execution Environment Parameter Definition" Parameter sheet`.Installing ITA registers a template file that allows users to add python module and ansible galaxy collections.
- Register "Execution environment parameter definition" parameter sheet. sheet(If needed)Register Parameters that will be embedded to the execution environment definition file (execution-environment.yml) template file registered in.For more information, see Using the Template file registered to Ansible common ▶ Execution environment definition template ` and :menuselection:"Execution Environment Parameter Definition" Parameter sheet`.Installing ITA registers , thewith the parameters that embeds to the execution environment definition template file (execution-environment.yml) file is registered.
- Register Execution environment management (If needed)Register a link between theand the template file for the execution environment definition file (execution-environment.yml) registered inFor more information, see Execution environment management.Installing ITA registers a link between theand .
- Register PlaybookFrom themenu, register a Playbook.For more information, see Playbook file collection.
- **Register Global variables (if needed) **From themenu, register global variables to be used in the Playbook.For more information, see Global variable management.
- **Register Template files (if needed) **From themenu, register template files and template embedded variables to be used in the Playbooks.For more information, see Template management.
- **Register File material (if needed) **From themenu, register file materials and file embedded variables to be used in the Playbooks.For more information, see File management.
- **Register Unmanaged variables (if needed) **From themenu, register extracted variables which will not be displayed in 's .For more information, see Unmanaged target variable list.
- Register Playbooks to MovementFrom themenu, register link between Playbook and Movement.For more information, see Movement-Playbook link.
- Create parameter sheetFrom themenu, create a Parameter sheet which will have data registered to it that can configure settings for the target.For more information, see Parameter sheet creation function.
- Register data to Parameter sheetRegister data to the parameter sheet created in the previous step.For more information, see Parameter sheet creation function.
- Substitute value auto registration settingsFrom themenu, link the Movement variables with the Parameter sheet's item's setting values.For more information, see Substitute value auto registration settings.
- ExecuteFrom themenu, select the desired Movement and Operation and execute them.For more information, see Execute.
- Confirm execution statusFrom themenu,the status of all previously executed operations will be updated in realtime. Users can also monitor error logs and execution logs as well as stop them with an emergency stop.For more information, see Confirm execution status.
- Confirm execution historyFrom themenu, users can check the history of all previously executed operations..For more information, see Execution management.
2.6. Describing Playbook (Ansible-Legacy)¶
Playbooks uploaded to Playbook file collection are executed in include format by the Master playbook generated by ITA.
The Master Playbook are configured by the Header section and tasks section.
2.6.1. Header section¶
Playbooks does not require a header section when being uploaded.
Header sections have default values, but users can change them by using
's .▼Header section default value
- hosts: all
remote_user: "{{ __loginuser__ }}"
gather_facts: no
become: yes
# For winrm connections, "become: yes" is ommited.
2.6.2. tasks section¶
Uploaded Playbooks are executed in include format by the Master playbook generated by ITA.
For more information regarding Playbooks, see Ansible's official manuals.
e.g.) Playbook example
- name: Comment
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ item.owner is none |ternary('root', item.owner) }}"
group: "{{ item.group is none |ternary('bacula', item.group) }}"
mode: "{{ item.mode is none |ternary('0654', item.mode) }}"
Uploaded Playbooks are included according to
's .
2.7. Appendix¶
2.7.2. Result data created when executing Ansible¶
The results from executing "Input data" with Ansible are saved as "Result data" in a ZIP file.
"Result data" can be downloaded from
menu's in a ZIP file.File list saved to Legacy result data¶
File name |
Recorded contents |
Ansible Core |
Ansible Automation Controller |
Ansible Execution Agent |
---|---|---|---|---|
result.txt |
Records Ansible execution result's execution results |
〇 |
||
error.log |
Error output file with Executing.
Ansible-playbbok command standard error output file.
Contents displayed in the Execute confirmation error log.
|
〇 |
〇 |
〇 |
exec.log.org |
xecution log output by Ansible-playbook |
〇 |
〇 |
〇 |
exec.log |
Edited Aexec.log.org
Contents displayed to the Execution confirmation execution log
|
〇 |
〇 |
〇 |
exec_<Execution number>_<group number> |
Divided execution log file
For more information regarding file name conventions, see the execution log in Confirm execution status .
|
〇 |
||
forced.txt |
Text file if stopped with Emergency stop |
〇 |
〇 |
|
user_files |
A directory where files are recorded when some file is output to ITA's original variable "__workflowdir__" in the playbook executed. |
〇 |
〇 |
〇 |
child_exec.log
child_error.log
|
ansible-builder execution log |
〇 |