Dell EMC OpenManage Ansible Modules Version 2.0 User’s Guide May 2019 Rev.
Notes, cautions, and warnings NOTE: A NOTE indicates important information that helps you make better use of your product. CAUTION: A CAUTION indicates either potential damage to hardware or loss of data and tells you how to avoid the problem. WARNING: A WARNING indicates a potential for property damage, personal injury, or death. Dell EMC OpenManage Ansible Modules Version 2.0 © Copyright 2019 Dell Inc. GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.
Contents Chapter 1: Overview...................................................................................................................... 5 Key Features.........................................................................................................................................................................5 What's new?.........................................................................................................................................................................
Create, modify or deploy a template...................................................................................................................... 52 Manage the device firmware..........................................................................................................................................54 Update device firmware.............................................................................................................................................54 Manage jobs...........
1 Overview Dell EMC OpenManage Ansible Modules allows data center and IT administrators to use RedHat Ansible to automate and orchestrate the configuration, deployment, and update of Dell EMC PowerEdge Servers (12th generation of PowerEdge servers and later) and modular infrastructure by leveraging the management automation capabilities in-built into the Integrated Dell Remote Access Controller (iDRAC) and OpenManage Enterprise (OME) respectively.
● ● ● ● ● ● Create, modify or deploy a template using a new OME module (dellemc_ome_template). Get the list and details of user accounts using a new OME module (dellemc_ome_user_facts). Get the list and details of templates using a new OME module (dellemc_ome_template_facts). A new OME module (dellemc_ome_job_facts) to view or track job details of PowerEdge devices . A new OME module (dellemc_ome_firmware) to update the firmware of PowerEdge devices and all its components.
2 Getting Started Topics: • • How OpenManage Ansible Modules works Running your first Playbook How OpenManage Ansible Modules works ● How OpenManage Ansible Modules for iDRAC works ● How OpenManage Ansible Modules for OME works Running your first Playbook Playbooks are essentially sets of instructions (plays) that you send to run on a single target or groups of targets (hosts).
3 Modules for iDRAC Topics: • • • • • • • How OpenManage Ansible Modules for iDRAC works Running your first iDRAC Playbook Updating Firmware Configuring PowerEdge Servers Deploying operating system Server Inventory Server administration tasks How OpenManage Ansible Modules for iDRAC works OpenManage Ansible modules uses iDRAC REST APIs based on Redfish standards and Server Configuration Profiles (SCP) for automated configuration, deployment and update of PowerEdge servers.
--- hosts: PowerEdge connection: local gather_facts: False tasks: - name: Get hardware inventory dellemc_get_system_inventory: idrac_ip: "{{ idrac_ip }}" idrac_user: "{{ idrac_user }}" idrac_pwd: "{{ idrac_pwd }}" 4. Now run the playbook. Run the following command from the directory where you created the inventory and the playbook: ansible-playbook playbook.yml -i inventory 5. Press Enter.
Table 1. dellemc_get_firmware_inventory (continued) Parameter Required Default Choices Comments idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port Table 2. Return Values Name Description ● Firmware Inventory ● Components of a server and their firmware versions. List of dictionaries, 1 dictionary per firmware. Returned Type Sample Success String https://github.com/dell/Dell-EMC-AnsibleModules-for-iDRAC/blob/master/samples/ dellemc_get_firmware_inventory.
Table 3. dellemc_install_firmware (continued) Parameter Required Default Choices Comments reboot No False NA Whether to reboot after applying the updates or not. share_name Yes NA NA CIFS or NFS Network share NA Network share user in the format 'user@domain' or 'domain\user' if user is part of a domain else 'user'. This option is mandatory for CIFS Network share. NA Network share user password. This option is mandatory for CIFS Network share.
Options Table 5. dellemc_idrac_firmware Parameter Required Default Choices Comments idrac_ip Yes NA NA iDRAC IP Address idrac_user Yes NA NA iDRAC username idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port job_wait Yes True NA Whether to wait for job completion or not. catalog_file_name No Catalog.xml NA Catalog file name relative to the I(share_name). reboot No False NA Whether to reboot after applying the updates or not.
Example - name: Update firmware from repository on a Network Share dellemc_idrac_firmware: idrac_ip: "192.168.0.1" idrac_user: "user_name" idrac_pwd: "user_pwd" share_name: "192.168.0.0:/share" share_user: "share_user_name" share_pwd: "share_user_pwd" share_mnt: "/mnt/share" reboot: True job_wait: True catalog_file_name: "Catalog.
Table 7. Return Values Name Description Returned Type Sample iDRAC/blob/master/samples/ dellemc_get_lcstatus.md Example -name: Get LC Status dellemc_get_lcstatus: idrac_ip: "xx.xx.xx.xx" idrac_user: "xxxx" idrac_pwd: "xxxxxxxx" Export Server Configuration Profile Module: dellemc_export_server_config_profile Synopsis You can export Server Configuration Profile (SCP) with various components such as iDRAC, BIOS, NIC, RAID together or with one of these components.
Table 8. dellemc_export_server_config_profile (continued) Parameter Required Default Choices Comments share_pwd No NA NA Network share user password. This option is mandatory for CIFS Network share.
Table 10.
share_name: share_user: share_pwd: scp_file: scp_components: job_wait: "xx.xx.xx.xx:/share" "xxxx" "xxxxxxxx" "scp_file.xml" "ALL" "True" Export or import Server Configuration Profile Module: dellemc_idrac_server_config_profile Synopsis This module exports Server Configuration profile (SCP) to a given network share or imports SCP from a network share or a local file. Options Table 12.
Table 12. dellemc_idrac_server_config_profile (continued) Parameter Required Default Choices Comments ● If C(Forced), it forcefully shuts down the system ● If C(NoReboot), it does not reboot the server On ● On ● Off This option is applicable for C(import) state. ● If C(On), End host power state is on ● If C(Off), End host power state is off No XML ● JSON ● XML Specify the output file format. This option is applicable for C(export) state.
share_name: "/scp_folder" share_user: "share_user_name" share_pwd: "share_user_pwd" scp_file: "scp_filename.xml" scp_components: "ALL" job_wait: True - name: Export Server Configuration Profile to a network share dellemc_idrac_server_config_profile: idrac_ip: "192.168.0.1" idrac_user: "user_name" idrac_pwd: "user_pwd" share_name: "192.168.0.
Table 13. dellemc_configure_idrac_users (continued) Parameter Required Default Choices Comments part of a domain else 'user'. This option is mandatory for CIFS Network share. share_pwd No NA NA Network share user password. This option is mandatory for CIFS Network share. share_mnt No NA NA Local mount path of the network share with read-write permission for Ansible user. This option is mandatory for CIFS or NFS Network share.
Example -name: Configure the iDRAC users attributes dellemc_configure_idrac_users: idrac_ip: "xx.xx.xx.xx" idrac_user: "xxxx" idrac_pwd: "xxxxxxxx" share_name: "xx.xx.xx.
Table 16. Return Values Name Description Returned Type Sample iDRAC Timezone Configures the iDRAC timezone attributes Success String https://github.com/dell/Dell-EMC-AnsibleModules-for-iDRAC/blob/master/samples/ dellemc_configure_idrac_timezone.md Example -name: Configure the iDRAC timezone attributes dellemc_configure_idrac_timezone: idrac_ip: "xx.xx.xx.xx" idrac_user: "xxxx" idrac_pwd: "xxxxxxxx" share_name: "xx.xx.xx.
Table 17.
Configure iDRAC services Module: dellemc_configure_idrac_services Synopsis This module configures the iDRAC services related attributes. Check_mode support: Yes Options Table 19.
Table 19. dellemc_configure_idrac_services (continued) Parameter Required Default Choices Comments alert_port No None NA SNMP alert port for iDRAC discovery_port No 162 NA SNMP discovery port for iDRAC trap_format No None NA SNMP trap format for iDRAC Table 20. Return Values Name Description Returned Type Sample iDRAC services Configures the iDRAC services attributes Success String https://github.
Table 21. dellemc_configure_idrac_network (continued) Parameter Required Default Choices Comments part of a domain else 'user'. This option is mandatory for CIFS Network share. share_pwd No NA NA Network share user password. This option is mandatory for CIFS Network share. share_mnt No NA NA Local mount path of the network share with read-write permission for Ansible user. This option is mandatory for CIFS or NFS Network share.
Table 21.
Synopsis This module configures the BIOS attributes for PowerEdge servers. Check_mode support: Yes Options Table 23. dellemc_configure_bios Parameter Required Default Choices Comments idrac_ip Yes NA NA iDRAC IP Address idrac_user Yes NA NA iDRAC username idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port share_name No NA NA CIFS or NFS network share or a local path share_user No NA NA Network share user in the format 'user@domain' or 'domain\user' if
Table 23. dellemc_configure_bios (continued) Parameter Required Default Choices Comments NOTE: This option has been deprecated, and will be removed in the later version. Please use the I(attributes) for BIOS attributes configuration instead. NOTE: I(nvme_mode) is mutually exclusive with I(boot_sources). secure_boot_mode No NA ● ● ● ● AuditMode, DeployedMode SetupMode UserMode (deprecated) Configures how the BIOS uses the Secure Boot Policy Objects in the 14 th generation of PowerEdge servers.
Table 23. dellemc_configure_bios (continued) Parameter Required Default Choices Comments I(onetime_boot_mode), I(secure_boot_mode), I(nvme_mode), and I(boot_mode). NOTE: When user does not provide Index or Enabled value in boot_sources option, dellemc_configure_bios module uses the current Index or Enabled value from the target server for the specified boot source while applying boot sources.
Enabled : True Index : 0 - name: Configure Boot Sources dellemc_configure_bios: idrac_ip: "xx.xx.xx.xx" idrac_user: "xxxx" idrac_pwd: "xxxxxxxx" boot_sources: - Name : "NIC.Integrated.x-x-x" Enabled : True Index : 0 - Name : "NIC.Integrated.x-x-x" Enabled : true Index : 1 - Name : "NIC.Integrated.x-x-x" Enabled : true Index : 2 - name: Configure Boot Sources - Enabled dellemc_configure_bios: idrac_ip: "xx.xx.xx.xx" idrac_user: "xxxx" idrac_pwd: "xxxxxxxx" boot_sources: - Name : "NIC.Integrated.
Table 25. dellemc_configure_raid (continued) Parameter Required Default Choices Comments This option is mandatory for CIFS Network share. share_pwd share_mnt No No NA NA NA Network share user password. This option is mandatory for CIFS Network share. NA Local mount path of the network share with read-write permission for Ansible user. This option is mandatory for Network share.
Table 25. dellemc_configure_raid (continued) Parameter Required Default Choices Comments ● If the value is 'absent', the module will perform 'remove' operations Table 26. Return Values Name Description Returned Type Sample RAID configuration Configures the RAID configuration attributes Success String https://github.com/dell/Dell-EMC-AnsibleModules-for-iDRAC/blob/master/samples/ dellemc_configure_raid.md Example -name: Configure the RAID attributes dellemc_configure_raid: idrac_ip: "xx.xx.xx.
Table 27.
Table 27. dellemc_idrac_storage_volume (continued) Parameter Required Default Choices Comments raid_init_operation No None ● None ● Fast This option represents Initialization Configuration operation to be performed on the virtual disk. Return Values msg: type: str description: Overall status of the storage configuration operation.
- name: volume_type: span_length: span_depth: drives: location: disk_cache_policy: write_cache_policy: read_cache_policy: stripe_size: capacity: raid_init_operation: "volume_2" "RAID 5" 3 1 [7,3,5] "Disabled" "WriteBack" "NoReadAhead" 131072 200 "None" -name: View all volume details dellemc_idrac_storage_volume: idrac_ip: "192.168.0.1" idrac_user: "username" idrac_pwd: "password" state: "view" -name: View specific volume details dellemc_idrac_storage_volume: idrac_ip: "192.168.0.
Table 28. dellemc_idrac_lc_attributes (continued) Parameter Required Default Choices Comments idrac_user Yes NA NA iDRAC username idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port share_name Yes NA NA CIFS or NFS network share or a local path share_user No NA NA Network share user in the format 'user@domain' or 'domain\user' if user is part of a domain else 'user'. This option is mandatory for CIFS Network share.
Table 30. dellemc_setup_idrac_syslog (continued) Parameter Required Default Choices Comments idrac_port No 443 NA iDRAC port share_name Yes NA NA CIFS or NFS Network share or a local path share_user No NA NA Network share user in the format 'user@domain' or 'domain\user' if user is part of a domain else 'user'. This option is mandatory for CIFS Network share. share_pwd No NA NA Network share user password. This option is mandatory for CIFS Network share.
Boot to a network ISO image Module: dellemc_boot_to_network_iso Synopsis This module facilitates the operating system deployment. You can run this module to boot the target system to a bootable ISO image on a CIFS or NFS share. This module looks for the customized ISO in the configured share location and transfers the image to iDRAC to load it. On the system reboot, the OS deployment begins. Check_mode support: No Options Table 32.
Synopsis System inventory provides basic and component level detailed inventory information. You can run this module when you want to verify the asset, configured state, inventory, and health-related information for the system and its component. Check_mode support: No Options Table 34.
Table 36. dellemc_change_power_state Parameter Required Default Choices Comments idrac_ip Yes NA NA iDRAC IP Address idrac_user Yes NA NA iDRAC username idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port NA ● ● ● ● ● ● change_power Yes On ForceOff GracefulRestart GracefulShutdown PushPowerButton Nmi Desired power state Table 37.
Example -name: Reset iDRAC dellemc_idrac_reset: idrac_ip: "xx.xx.xx.xx" idrac_user: "xxxx" idrac_pwd: "xxxxxxxx" idrac_port: "xxx" View LC job status Module: dellemc_get_lc_job_status Synopsis You can view the iDRAC or LC job status using this module. To view information about a job status, a job id is required. After a job is initiated, the system stages the job request information and sends a job id back to the system. You can query the progress and status of the job by using the job id.
Check_mode support: No Options Table 42. dellemc_export_lc_logs Parameter Required Default Choices Comments idrac_ip Yes NA NA iDRAC IP Address idrac_user Yes NA NA iDRAC username idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port share_name Yes NA NA CIFS or NFS Network share share_user No NA NA Network share user in the format 'user@domain' or 'domain\user' if user is part of a domain else 'user'. This option is mandatory for CIFS Network share.
Table 44. dellemc_delete_lc_job Parameter Required Default Choices Comments idrac_ip Yes NA NA iDRAC IP Address idrac_user Yes NA NA iDRAC username idrac_pwd Yes NA NA iDRAC user password idrac_port No 443 NA iDRAC port job_id Yes NA NA JOB ID in the format "JID_XXXXXXXXX" Table 45. Return Values Name Description Returned Type Sample Delete LC job Deletes an LC job for a given a JOB ID Success String https://github.
idrac_ip: idrac_user: idrac_pwd: idrac_port: "xx.xx.xx.xx" "xxxx" "xxxxx" "xxx" Configure System Lockdown Mode Module: dellemc_system_lockdown_mode Synopsis System Lockdown Mode provides a mechanism to protect configuration from any unintentional or accidental changes after the system is provisioned to a certain level. This module is responsible for enabling or disabling the lockdown mode of a system.
share_mnt: "/mnt/share" lockdown_mode: "xxxxxxx" 46 Modules for iDRAC
4 Modules for OpenManage Enterprise (OME) Topics: • • • • • • • How OpenManage Ansible Modules for OME works Running your first OME Playbook View device inventory Manage device configuration templates Manage the device firmware Manage jobs Manage users How OpenManage Ansible Modules for OME works OpenManage Enterprise (OME) is a system management and monitoring application that provides rich sets of features to manage the Dell EMC servers, chassis, storage, and network switches in an enterprise data cente
username: "{{ ome_username }}" password: "{{ ome_password }}" system_query_options: filter: "Type eq 1000" 4. Now run the playbook. Run the following command from the directory where you created the inventory and the playbook: ansible-playbook playbook.yml -i inventory 5. Press Enter. With OpenManage Ansible Modules, you can construct a playbook with a set of modules resulting in an automation workflow for configuration, deployments, and updates of PowerEdge and modular servers.
Table 50. dellemc_ome_device_facts (continued) Parameter Required Default Choices Comments ● device_service_tag: A list of service tags are applicable for C(detailed_inventory) and C(subsystem_health). ● inventory_type: For C(detailed_inventory), it returns details of the specified inventory type. ● filter: For C(basic_inventory), it filters the collection of devices. I(filter) query format should be aligned with OData standards.
Examples - name: Retrieve basic inventory of all devices. dellemc_ome_device_facts: hostname: "192.168.0.1" username: "username" password: "password" - name: Retrieve basic inventory for devices identified by IDs 33333 or 11111 using filtering. dellemc_ome_device_facts: hostname: "192.168.0.
Manage device configuration templates This section describes the specifications for viewing, creating, modifying and deploying templates on devices managed by OME for hardware configuration and deployment operations. Following are the tasks for managing device configuration templates: 1. View templates 2. Create, modify or deploy a template View templates Module: dellemc_ome_template_facts Synopsis This module retrieves the list and details of all templates or details of a specific template.
Examples - name: Retrieve basic details of all templates. dellemc_ome_template_facts: hostname: "192.168.0.1" username: "username" password: "password" - name: Retrieve details of a specific template identified by its template ID. dellemc_ome_template_facts: hostname: "192.168.0.1" username: "username" password: "password" template_id: 1 Create, modify or deploy a template Module: dellemc_ome_template Synopsis This module creates, modifies or deploys a template. Options Table 52.
Table 52. dellemc_ome_template (continued) Parameter Require d Default Choices Comments ● ● ● ● Default value is 'All'. This is applicable for C(create) operation. Options: Options to control device shutdown or end power state during template deployment. This is applicable for C(deploy) operation. Schedule: Options to schedule the deployment task immediately or at a specified time. This is applicable for C(deploy) operation. NetworkBootIsoModel: Payload to specify the ISO deployment details.
- name: modify template dellemc_ome_template: hostname: "192.168.0.1" username: "username" password: "password" state: "modify" template_id: 1234 attributes: Name: "New Custom Template" Description: "Custom Template Description" - name: deploy template. dellemc_ome_template: hostname: "192.168.0.
Table 53. dellemc_ome_firmware Parameter Required Default Choices Comments hostname Yes NA NA Target IP Address or hostname username Yes NA NA Target username password Yes NA NA Target user password port No 443 NA Target HTTPS port device_service_tag No NA NA List of targeted device service tags. device_id No NA NA List of targeted device ids. dup_file Yes NA NA Executable file to apply on the targets.
} 'UpdatedBy': None, 'EndTime': None, 'Id': 11117, 'JobType': { 'Internal': False, 'Id': 5, 'Name': 'Update_Task'} Examples - name: "Update firmware from DUP file using device ids." dellemc_ome_firmware: hostname: "192.168.0.1" username: "username" password: "password" device_id: - 11111 - 22222 dup_file: "/path/Chassis-System-Management_Firmware_6N9WN_WN64_1.00.01_A00.EXE" - name: "Update firmware from DUP file using device service tags." dellemc_ome_firmware: hostname: "192.168.0.
Table 54. dellemc_ome_job_facts (continued) Parameter Required Default Choices Comments ● skip: Number of records to skip. Default value is 0. ● filter: Filter records by the values supported. Return Values msg: description: Overall status of the job facts operation. returned: always type: str job_facts: description: Details of the OpenManage Enterprise jobs.
- name: Get job details for id. dellemc_ome_job_facts: hostname: "192.168.0.1" username: "username" password: "password" job_id: 12345 - name: Get filtered job details. dellemc_ome_job_facts: hostname: "192.168.0.1" username: "username" password: "password" system_query_options: top: 2 skip: 1 filter: "JobType/Id eq 8" Manage power state operations Module: ome_power_state Synopsis This module performs the supported power state management operations. Options Table 55.
} "CreatedBy": "user", "Editable": true, "EndTime": null, "Id": 11111, "JobDescription": "DeviceAction_Task", "JobName": "DeviceAction_Task_PowerState", "JobStatus": { "Id": 1111, "Name": "New" }, "JobType": { "Id": 1, "Internal": false, "Name": "DeviceAction_Task" }, "LastRun": "2019-04-01 06:39:02.
hostname: "192.168.0.1" username: "username" password: "password" device_id: "{{ item.device_id }}" power_state: "{{ item.state }}" with_items: - { "device_id": 11111, "state": "on" } - { "device_id": 22222, "state": "off" } - name: Power state operation based on list of device service tags. ome_powerstate: hostname: "192.168.0.1" username: "username" password: "password" device_service_tag: "{{ item.service_tag }}" power_state: "{{ item.
} } "Description": "user name description", "Name": "user_name", "Password": null, "UserName": "user_name", "RoleId": "10", "Locked": false, "IsBuiltin": true, "Enabled": true Examples - name: Retrieve basic details of all accounts. dellemc_ome_user_facts: hostname: "192.168.0.1" username: "username" password: "password" - name: Retrieve details of a specific account identified by its account ID. dellemc_ome_user_facts: hostname: "192.168.0.
Table 57. ome_user (continued) Parameter Required Default Choices Comments ● ● ● ● ● Password UserName RoleId Locked Enabled NOTE: OME will throw an error message if required parameter is not provided for the operation. NOTE: See OpenManage Enterprise API Reference Guide for more details. Return Values msg: description: Overall status of the user operation.
Locked: False Name: "user2" - name: modify existing user ome_user: hostname: "192.168.0.1" username: "username" password: "password" state: "present" attributes: UserName: "user3" RoleId: "10" Enabled: True Description: "Modify user Description" - name: delete existing user. ome_user: hostname: "192.168.0.
5 Troubleshooting ● While creating new iDRAC users, the provided values are not getting applied completely on 14G servers. — In case the user is not created with all the required user settings, change the user setting with action option modify in the dellemc_configure_idrac_users module.
6 Accessing documents from the Dell EMC support site You can access the required documents using the following links: ● For Dell EMC Enterprise Systems Management documents — www.dell.com/esmmanuals ● For Dell EMC OpenManage documents — www.dell.com/openmanagemanuals ● For Dell EMC Remote Enterprise Systems Management documents — www.dell.com/esmmanuals ● For iDRAC and Dell Lifecycle Controller documents — www.dell.