my $playbook_setup = sles4sap::sap_deployment_automation_framework::ansible->new();
Class used for handling list of playbook settings for further execution by sdaf_execute_playbook(). Playbook description is here as well: https://learn.microsoft.com/en-us/azure/sap/automation/run-ansible?tabs=linux
my $playbook_setup = sles4sap::sap_deployment_automation_framework::ansible->new();
$playbook_setup->set(@components)
Method Creates list of playbook settings according to @components that are to be installed. Method can be called only once, otherwise it will die. This is to prevent resetting playbook order accidentally. Returns full data structure of settings compiled in ARRAYREF format. Example: [ {playbook_filename => 'playbook_name_A.yaml', timeout => 120}, {playbook_filename => 'playbook_name_B.yaml', timeout => 90} ]
components: ARRAYREF of components that should be installed
my $playbook_setup = sles4sap::sap_deployment_automation_framework::ansible->new();
$playbook_setup->set(@components);
$playbook_setup->get();
Purpose of this method is to serve the caller playbook name and related settings which are to be executed next. Method is supposed to be called in a loop until all playbooks are returned. Once there are no playbooks left, structure with undefined values is returned.
ansible_execute_command(
command=>'rm -Rf /', host_group=>'QES_SCS', sdaf_config_root_dir=>'/some/path' , sap_sid=>'CAT');
Execute command on host group using ansible. Returns execution output.
sdaf_config_root_dir: SDAF Config directory containing SUT ssh keys
sap_sid: SAP system ID. Default 'SAP_SID'
host_group: Host group name from inventory file
command: Command to be executed
verbose: verbose ansible output
proceed_on_failure: proceed on failure setting
sdaf_ansible_verbosity_level($verbosity_level);
Returns string that is to be used as verbosity parameter -v for 'ansible-playbook' command. This is controlled by positional argument $verbosity_level. Values can specify verbosity level using integer up to 6 (max supported by ansible) or just set to anything equal to 'true' which will default to -vvvv. Value -vvvv should be enough to debug network connection problems according to ansible documentation: https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html#cmdoption-ansible-playbook-v
$verbosity_level: Change default verbosity value by either anything equal to 'true' or int between 1-6. Default: false
sdaf_execute_playbook(
playbook_filename=>'playbook_04_00_01_db_ha.yaml',
sdaf_config_root_dir=>'/path/to/joy/and/happiness/'
sap_sid=>'ABC',
timeout=>'42',
verbosity_level=>'3'
);
Execute playbook specified by playbook_filename and record command output in separate log file. Verbosity level of ansible-playbook is controlled by openQA parameter SDAF_ANSIBLE_VERBOSITY_LEVEL. If undefined, it will use standard output without adding any -v flag. See function sdaf_execute_playbook for details.
playbook_filename: Filename of the playbook to be executed.
sdaf_config_root_dir: SDAF Config directory containing SUT ssh keys
sap_sid: SAP system ID. Default 'SAP_SID'
timeout: Timeout for executing playbook. Passed into asset_script_run. Default: 1800s
$verbosity_level: Change default verbosity value by either anything equal to 'true' or int between 1-6. Default: false
sdaf_register_byos(sdaf_config_root_dir=>'/stairway/to_heaven', scc_reg_code=>'CODE-XYZ', sap_sid='PRD');
Performs SCC registration on BYOS image using registercloudguest method.
sdaf_config_root_dir: SDAF root configuration directory
scc_reg_code: SCC registration code
sap_sid: SAP system ID