diff options
Diffstat (limited to 'ansible_collections/dellemc/openmanage/playbooks/idrac')
30 files changed, 1877 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/dellemc_idrac_storage_volume.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/dellemc_idrac_storage_volume.yml new file mode 100644 index 00000000..d8164065 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/dellemc_idrac_storage_volume.yml @@ -0,0 +1,110 @@ +--- +- hosts: idrac + connection: local + name: iDRAC storage volume configuration. + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Create single volume. + dellemc_idrac_storage_volume: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "create" + controller_id: "RAID.Slot.1-1" + volumes: + - drives: + location: [5] + tags: + - create_single_volume + + - name: Create multiple volume. + dellemc_idrac_storage_volume: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + raid_reset_config: "True" + state: "create" + controller_id: "RAID.Slot.1-1" + volume_type: "RAID 1" + span_depth: 1 + span_length: 2 + number_dedicated_hot_spare: 1 + disk_cache_policy: "Enabled" + write_cache_policy: "WriteBackForce" + read_cache_policy: "ReadAhead" + stripe_size: 65536 + capacity: 100 + raid_init_operation: "Fast" + volumes: + - name: "volume_1" + drives: + id: ["Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1", + "Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.1-1"] + - name: "volume_2" + volume_type: "RAID 5" + span_length: 3 + span_depth: 1 + drives: + location: [7, 3, 5] + disk_cache_policy: "Disabled" + write_cache_policy: "WriteBack" + read_cache_policy: "NoReadAhead" + stripe_size: 131072 + capacity: "200" + raid_init_operation: "None" + tags: + - create_multiple_volume + + - name: Delete single volume. + dellemc_idrac_storage_volume: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "delete" + volumes: + - name: "volume_1" + tags: + - delete_single_volume + + + - name: Delete multiple volume. + dellemc_idrac_storage_volume: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "delete" + volumes: + - name: "volume_1" + - name: "volume_2" + tags: + - delete_multiple_volume + + - name: View specific volume details. + dellemc_idrac_storage_volume: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "view" + controller_id: "RAID.Slot.1-1" + volume_id: "Disk.Virtual.0:RAID.Slot.1-1" + tags: + - view_specific_volume + + - name: View all volume details. + dellemc_idrac_storage_volume: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "view" + tags: + - view_all_volume
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_configure_idrac_eventing.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_configure_idrac_eventing.yml new file mode 100644 index 00000000..c712288e --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_configure_idrac_eventing.yml @@ -0,0 +1,62 @@ +--- +- hosts: idrac + connection: local + name: Configure the iDRAC eventing attributes + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Setup iDRAC SMTP + dellemc_configure_idrac_eventing: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + smtp_ip_address: "0.0.0.0" + authentication: "Enabled" + username: "test" + password: "test" + + tags: + - idrac_smtp + + - name: Setup iDRAC SNMP Trap + dellemc_configure_idrac_eventing: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + snmp_trap_state: "Enabled" + destination_number: "2" + snmp_v3_username: "None" + destination: "1.1.1.1" + + tags: + - idrac_snmptrap + + - name: Setup iDRAC Email Alerts + dellemc_configure_idrac_eventing: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + email_alert_state: "Disabled" + address: "test@test.com" + alert_number: "1" + custom_message: "test" + + tags: + - idrac_email_alerts + + - name: Setup iDRAC Alerts + dellemc_configure_idrac_eventing: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + enable_alerts: "Disabled" + + tags: + - idrac_alerts
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_configure_idrac_services.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_configure_idrac_services.yml new file mode 100644 index 00000000..e0d4bbe8 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_configure_idrac_services.yml @@ -0,0 +1,46 @@ +--- +- hosts: idrac + connection: local + name: Configure the iDRAC services attributes + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Setup iDRAC Webserver + dellemc_configure_idrac_services: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + ssl_encryption: "T_168_Bit_or_higher" + tls_protocol: "TLS_1_0_and_Higher" + + tags: + - idrac_webserver + + - name: Setup iDRAC SNMP + dellemc_configure_idrac_services: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + snmp_enable: "Enabled" + snmp_protocol: "All" + + tags: + - idrac_snmp + + - name: Setup iDRAC SNMP settings + dellemc_configure_idrac_services: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + ipmi_lan: + community_name: public + alert_port: 161 + trap_format: SNMPv3 + tags: + - idrac-snmp-settings diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_get_firmware_inventory.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_get_firmware_inventory.yml new file mode 100644 index 00000000..ac4736c5 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_get_firmware_inventory.yml @@ -0,0 +1,16 @@ +--- +- hosts: idrac + connection: local + name: Get Installed Firmware Inventory + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Get Installed Firmware Inventory + dellemc_get_firmware_inventory: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_get_system_inventory.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_get_system_inventory.yml new file mode 100644 index 00000000..085b14bf --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_get_system_inventory.yml @@ -0,0 +1,16 @@ +--- +- hosts: idrac + connection: local + name: Get system inventory + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Get system inventory + dellemc_get_system_inventory: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_idrac_lc_attributes.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_idrac_lc_attributes.yml new file mode 100644 index 00000000..51a06ad1 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_idrac_lc_attributes.yml @@ -0,0 +1,17 @@ +--- +- hosts: idrac + connection: local + name: Configure iDRAC CSIOR Setting + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Configure iDRAC CSIOR Setting + dellemc_idrac_lc_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + csior: "Enabled" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_system_lockdown_mode.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_system_lockdown_mode.yml new file mode 100644 index 00000000..61260e3e --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/dellemc_system_lockdown_mode.yml @@ -0,0 +1,17 @@ +--- +- hosts: idrac + connection: local + name: Configure System lockdown mode + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Configure System lockdown mode + dellemc_system_lockdown_mode: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + lockdown_mode: "Disabled"
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/idrac_network.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/idrac_network.yml new file mode 100644 index 00000000..9ee11728 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/idrac_network.yml @@ -0,0 +1,75 @@ +--- +- hosts: idrac + connection: local + name: Configure the iDRAC network attributes + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Register iDRAC on DNS + idrac_network: + idrac_ip: "{{idrac_ip}}" + idrac_user: "{{idrac_user}}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + register_idrac_on_dns: "Enabled" + dns_idrac_name: "idrac-3CZWCK2" + auto_config: "Enabled" + static_dns: "dell.com" + + tags: + - dns_register + + - name: Setup VLAN attributes + idrac_network: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + setup_idrac_nic_vlan: "Enabled" + + tags: + - setup_vlan + + - name: Setup iDRAC NIC + idrac_network: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + enable_nic: "Enabled" + nic_selection: "Dedicated" + failover_network: "T_None" + auto_detect: "Disabled" + auto_negotiation: "Enabled" + network_speed: "T_1000" + duplex_mode: "Full" + + tags: + - idrac_nic + + - name: Setup iDRAC IPv4 + idrac_network: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + enable_dhcp: "Enabled" + dns_from_dhcp: "Enabled" + enable_ipv4: "Enabled" + + tags: + - idrac_ipv4 + + - name: Setup iDRAC Static IPv4 + idrac_network: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + dns_from_dhcp: "Disabled" + + tags: + - idrac_staticipv4
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/idrac_timezone_ntp.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/idrac_timezone_ntp.yml new file mode 100644 index 00000000..c5fe7791 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/deprecated/idrac_timezone_ntp.yml @@ -0,0 +1,24 @@ +--- +- hosts: idrac + connection: local + name: Configure the iDRAC timezone attributes + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Setup iDRAC Timezone + idrac_timezone_ntp: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + setup_idrac_timezone: "Singapore" + enable_ntp: "Disabled" + ntp_server_1: "100.100.25.1" + ntp_server_2: "100.100.26.2" + ntp_server_3: "100.100.27.3" + + tags: + - idrac_timezone
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_attributes.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_attributes.yml new file mode 100644 index 00000000..9a362176 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_attributes.yml @@ -0,0 +1,155 @@ +--- +- hosts: idrac + connection: local + name: Dell OpenManage Ansible iDRAC Certificates management. + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Update iDRAC attributes + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + SNMP.1.AgentCommunity: Enabled + tags: idrac + + - name: Update System attributes + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + system_attributes: + ThermalSettings.1.ThermalProfile: Sound Cap + tags: system + + - name: Update Lifecycle Controller attributes + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + lifecycle_controller_attributes: + LCAttributes.1.AutoUpdate: Enabled + tags: lc + + - name: Configure the iDRAC attributes for email alert settings. + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + EmailAlert.1.CustomMsg: Display Message + EmailAlert.1.Enable: Enabled + EmailAlert.1.Address: test@test.com + tags: email-alerts + + - name: Configure the iDRAC attributes for SNMP alert settings. + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + SNMPAlert.1.Destination: 192.168.0.2 + SNMPAlert.1.State: Enabled + SNMPAlert.1.SNMPv3Username: username + tags: snmp-alerts + + - name: Configure the iDRAC attributes for SMTP alert settings. + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + RemoteHosts.1.SMTPServerIPAddress: 192.168.0.3 + RemoteHosts.1.SMTPAuthentication: Enabled + RemoteHosts.1.SMTPPort: 25 + RemoteHosts.1.SMTPUserName: username + RemoteHosts.1.SMTPPassword: password + tags: smtp-alerts + + - name: Configure the iDRAC attributes for webserver settings. + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + WebServer.1.SSLEncryptionBitLength: 128-Bit or higher + WebServer.1.TLSProtocol: TLS 1.1 and Higher + tags: webserver-settings + + - name: Configure the iDRAC attributes for SNMP settings. + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + SNMP.1.SNMPProtocol: All + SNMP.1.AgentEnable: Enabled + SNMP.1.TrapFormat: SNMPv1 + SNMP.1.AlertPort: 162 + SNMP.1.AgentCommunity: public + tags: snmp-settings + + - name: Configure the iDRAC LC attributes for collecting system inventory. + idrac_attributes: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + lifecycle_controller_attributes: + LCAttributes.1.CollectSystemInventoryOnRestart: Enabled + tags: collect-inventory + + - name: Configure the iDRAC system attributes for LCD settings. + idrac_attributes: + idrac_ip: "192.168.0.1" + idrac_user: "user_name" + idrac_password: "user_password" + ca_path: "/path/to/ca_cert.pem" + system_attributes: + LCD.1.Configuration: Service Tag + LCD.1.vConsoleIndication: Enabled + LCD.1.FrontPanelLocking: Full-Access + LCD.1.UserDefinedString: custom lcd string + tags: lcd-config + + - name: Configure the iDRAC attributes for Timezone settings. + idrac_attributes: + idrac_ip: "192.168.0.1" + idrac_user: "user_name" + idrac_password: "user_password" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + Time.1.TimeZone: CST6CDT + NTPConfigGroup.1.NTPEnable: Enabled + NTPConfigGroup.1.NTP1: 192.168.0.5 + NTPConfigGroup.1.NTP2: 192.168.0.6 + NTPConfigGroup.1.NTP3: 192.168.0.7 + tags: timezone-settings + + - name: Configure all attributes + dellemc.openmanage.idrac_attributes: + idrac_ip: "192.168.0.1" + idrac_user: "user_name" + idrac_password: "user_password" + ca_path: "/path/to/ca_cert.pem" + idrac_attributes: + SNMP.1.AgentCommunity: test + SNMP.1.AgentEnable: Enabled + SNMP.1.DiscoveryPort: 161 + system_attributes: + ServerOS.1.HostName: demohostname + lifecycle_controller_attributes: + LCAttributes.1.AutoUpdate: Disabled + tags: all-attributes diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_bios.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_bios.yml new file mode 100644 index 00000000..a541dce7 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_bios.yml @@ -0,0 +1,115 @@ +--- +- hosts: idrac + connection: local + name: Configure Boot Mode Setting + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Configure Bios Generic Attributes + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + attributes: + BootMode: "Bios" + OneTimeBootMode: "Enabled" + BootSeqRetry: "Enabled" + tags: + - bootconfig + + - name: Configure PXE Generic Attributes + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + attributes: + PxeDev1EnDis: "Enabled" + PxeDev1Protocol: "IPV4" + PxeDev1VlanEnDis: "Enabled" + PxeDev1VlanId: x + PxeDev1Interface: "NIC.Embedded.x-x-x" + PxeDev1VlanPriority: x + tags: + - pxeconfig + + - name: Configure attributes of the BIOS at Maintenance window + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + apply_time: AtMaintenanceWindowStart + maintenance_window: + start_time: "2022-09-30T05:15:40-05:00" + duration: 600 + attributes: + BootMode: "Bios" + OneTimeBootMode: "Enabled" + BootSeqRetry: "Enabled" + tags: + - at_maintenance_start + + - name: Clear pending BIOS attributes + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + clear_pending: yes + tags: + - clear_pending + + - name: Reset BIOS attributes to default settings. + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_pwd }}" + ca_path: "/path/to/ca_cert.pem" + reset_bios: yes + tags: + - reset_bios + + - name: Configure Boot Sources + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_sources: + - Name: "NIC.Integrated.x-x-x" + Enabled: true + Index: 1 + - Name: "NIC.Integrated.x-x-x" + Enabled: true + Index: 0 + tags: + - boot_sources + + - name: Configure Boot Sources - Enabled + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_sources: + - Name: "HardDisk.List.1-1" + Enabled: true + tags: + - boot_sources_enabled + + - name: Configure Boot Sources - Index + idrac_bios: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_sources: + - Name: "NIC.Integrated.x-x-x" + Index: 1 + tags: + - boot_sources_index
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_boot.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_boot.yml new file mode 100644 index 00000000..22afb949 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_boot.yml @@ -0,0 +1,69 @@ +--- +- hosts: idrac + connection: local + name: Configure the boot order settings + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + + - name: Configure the system boot options settings. + idrac_boot: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_options: + - display_name: Hard drive C + enabled: true + - boot_option_reference: NIC.PxeDevice.2-1 + enabled: true + tags: boot-option + + - name: Configure the boot order settings. + idrac_boot: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_order: + - Boot0001 + - Boot0002 + - Boot0004 + - Boot0003 + tags: boot-order + + - name: Configure the boot source override mode. + idrac_boot: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_source_override_mode: legacy + boot_source_override_target: cd + boot_source_override_enabled: once + tags: boot-mode + + - name: Configure the UEFI target settings. + idrac_boot: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_source_override_mode: uefi + boot_source_override_target: uefi_target + uefi_target_boot_source_override: "VenHw(3A191845-5F86-4E78-8FCE-C4CFF59F9DAA)" + tags: uefi-target + + - name: Configure the boot source override mode as pxe. + idrac_boot: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + boot_source_override_mode: legacy + boot_source_override_target: pxe + boot_source_override_enabled: continuous + tags: pxe-boot-mode diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_boot_virtual_media_workflow.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_boot_virtual_media_workflow.yml new file mode 100644 index 00000000..aa6d43ed --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_boot_virtual_media_workflow.yml @@ -0,0 +1,56 @@ +--- +- hosts: idrac + connection: local + name: Dell OpenManage Ansible iDRAC boot operations. + vars: + ansible_python_interpreter: /usr/bin/python3 + virtual_media_uri: "/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia" + file_location: "192.168.0.1:/nfsshare/path/to/boot_image.iso" + nfs_dir: "192.168.0.1:/nfsshare" + iso_file: "boot_image.iso" + ca_path: "/path/to/ca_cert.pem" + boot_source_mode: "legacy" #other options are UEFI + + gather_facts: False + + tasks: + +# Mount the ISO image as a virtual media CD. + - name: "Insert virtual media" + ansible.builtin.uri: + url: "https://{{ idrac_ip }}{{ virtual_media_uri }}" + user: "{{ idrac_user }}" + password: "{{ idrac_password }}" + method: "POST" + body_format: json + body: + Image: "{{ file_location }}" + Inserted: true + WriteProtected: true + use_proxy: yes + status_code: 204 + return_content: no + ca_path: "{{ ca_path }}" + force_basic_auth: yes + headers: + Content-Type: "application/json" + Accept: "application/json" + tags: + - virtual_media + - vm_boot + +# One-time boot with virtual media. + - name: Boot once from mounted CD. + dellemc.openmanage.idrac_boot: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "{{ ca_path }}" + boot_source_override_mode: "{{ boot_source_mode }}" + boot_source_override_target: cd + boot_source_override_enabled: once + tags: + - boot_cd + - vm_boot + +# Eject the virtual media after boot. diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_certificates.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_certificates.yml new file mode 100644 index 00000000..801f12ed --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_certificates.yml @@ -0,0 +1,69 @@ +--- +- hosts: idrac + connection: local + name: Dell OpenManage Ansible iDRAC Certificates management. + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Generate https signing request + idrac_certificates: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: "generate_csr" + certificate_type: "HTTPS" + certificate_path: "/home/omam/mycert_dir" + cert_params: + common_name: "sample.domain.com" + organization_unit: "OrgUnit" + locality_name: "Bangalore" + state_name: "Karnataka" + country_code: "IN" + email_address: "admin@domain.com" + organization_name: "OrgName" + subject_alt_name: + - 192.198.2.1 + + - name: Import a SSL certificate. + idrac_certificates: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: "import" + certificate_type: "HTTPS" + certificate_path: "/path/to/cert.pem" + + - name: Export a SSL certificate. + idrac_certificates: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: "export" + certificate_type: "HTTPS" + certificate_path: "/home/omam/mycert_dir" + + - name: Import a CSC certificate. + idrac_certificates: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: "import" + certificate_type: "CSC" + certificate_file: "/path/to/cert.pem" + + - name: Export a Client trust certificate. + idrac_certificates: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: "export" + certificate_type: "CLIENT_TRUST_CERTIFICATE" + certificate_path: "/home/omam/mycert_dir"
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_firmware.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_firmware.yml new file mode 100644 index 00000000..c1a2c891 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_firmware.yml @@ -0,0 +1,69 @@ +--- +- hosts: idrac + connection: local + name: Update Firmware Inventory + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Update firmware from repository on a HTTP/HTTP/FTP repository + idrac_firmware: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "https://downloads.dell.com" + reboot: True + job_wait: True + apply_update: True + + - name: Update firmware from repository on a internally hosted HTTP repository. + idrac_firmware: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password}}" + ca_path: "/path/to/ca_cert.pem" + share_name: "http://192.168.0.1/path_to_folder/" + reboot: True + job_wait: True + apply_update: True + catalog_file_name: "Catalog.xml" + + - name: Update firmware from repository on a NFS Share + idrac_firmware: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password}}" + ca_path: "/path/to/ca_cert.pem" + share_name: "192.168.0.1:/complete_share_path" + reboot: True + job_wait: True + apply_update: True + catalog_file_name: "Catalog.xml" + + - name: Update firmware from repository on a CIFS Share + idrac_firmware: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password}}" + ca_path: "/path/to/ca_cert.pem" + share_name: "\\\\192.168.0.1\\share_path" + share_user: "{{ share_user }}" + share_password: "{{ share_password }}" + share_mnt: "/mnt/cifs_share" + reboot: False + job_wait: True + catalog_file_name: "Catalog.xml" + + - name: Firmware compliance report using HTTPS repository. + idrac_firmare: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "https://downloads.dell.com" + reboot: False + job_wait: True + apply_update: False diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_firmware_info.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_firmware_info.yml new file mode 100644 index 00000000..aaca53a5 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_firmware_info.yml @@ -0,0 +1,16 @@ +--- +- hosts: idrac + connection: local + name: Get Installed Firmware Inventory + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Get Installed Firmware Inventory. + idrac_firmware_info: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_job_status_info.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_job_status_info.yml new file mode 100644 index 00000000..9f0f61de --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_job_status_info.yml @@ -0,0 +1,17 @@ +--- +- hosts: idrac + connection: local + name: Get LC job Status + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Get LC job Status + idrac_lifecycle_controller_job_status_info: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + job_id: "JID_844222910040" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_jobs.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_jobs.yml new file mode 100644 index 00000000..495e84a6 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_jobs.yml @@ -0,0 +1,28 @@ +--- +- hosts: idrac + connection: local + name: Delete LC job + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Delete LC job Queue + idrac_lifecycle_controller_jobs: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + tags: + - delete_all_jobs + + - name: Delete a LC job + idrac_lifecycle_controller_jobs: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + job_id: "JID_123456789" + tags: + - delete_job
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_logs.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_logs.yml new file mode 100644 index 00000000..99c9d0ce --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_logs.yml @@ -0,0 +1,18 @@ +--- +- hosts: idrac + connection: local + name: Export Lifecycle Controller Logs + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Export Lifecycle Controller Logs + idrac_lifecycle_controller_logs: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "{{ playbook_dir }}" + job_wait: "True"
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_status_info.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_status_info.yml new file mode 100644 index 00000000..1798ab99 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_lifecycle_controller_status_info.yml @@ -0,0 +1,16 @@ +--- +- hosts: idrac + connection: local + name: Check LC Ready Status + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Check LC Ready Status + idrac_lifecycle_controller_status_info: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_os_deployment.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_os_deployment.yml new file mode 100644 index 00000000..3ad52adc --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_os_deployment.yml @@ -0,0 +1,22 @@ +--- +- hosts: idrac + connection: local + gather_facts: false + name: Booting to Network Operating System image + + collections: + - dellemc.openmanage + + tasks: + - name: "Booting to Network Operating System image" + idrac_os_deployment: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "{{ playbook_dir }}" + iso_image: "uninterrupted_os_installation_image.iso." + expose_duration: 180 + + tags: + - network_iso
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_redfish_storage_controller.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_redfish_storage_controller.yml new file mode 100644 index 00000000..2cb44788 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_redfish_storage_controller.yml @@ -0,0 +1,216 @@ +--- +- hosts: idrac + connection: local + name: Dell OpenManage Ansible iDRAC Redfish Storage Controller service. + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Assign dedicated hot spare. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + volume_id: + - "Disk.Virtual.0:RAID.Slot.1-1" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - assign_dedicated_hot_spare + + - name: Assign global hot spare. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - assign_global_hot_spare + + - name: Unassign hot spare + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + command: UnassignSpare + tags: + - un-assign-hot-spare + + - name: Set controller encryption key. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "SetControllerKey" + controller_id: "RAID.Slot.1-1" + key: "PassPhrase@123" + key_id: "mykeyid123" + tags: + - set_controller_key + + - name: Rekey in LKM mode. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ReKey" + controller_id: "RAID.Slot.1-1" + key: "NewPassPhrase@123" + key_id: "newkeyid123" + old_key: "OldPassPhrase@123" + tags: + - rekey_lkm + + - name: Rekey in SEKM mode. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ReKey" + controller_id: "RAID.Slot.1-1" + mode: "SEKM" + tags: + - rekey_sekm + + - name: Remove controller key. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "RemoveControllerKey" + controller_id: "RAID.Slot.1-1" + tags: + - remove_controller_key + + - name: Reset controller configuration. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ResetConfig" + controller_id: "RAID.Slot.1-1" + tags: + - reset_config + + - name: Enable controller encryption + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "EnableControllerEncryption" + controller_id: "RAID.Slot.1-1" + mode: "LKM" + key: "your_Key@123" + key_id: "your_Keyid@123" + tags: + - enable-encrypt + + - name: Blink physical disk. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "BlinkTarget" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - blink-target + + - name: Blink virtual drive. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "BlinkTarget" + volume_id: "Disk.Virtual.0:RAID.Slot.1-1" + tags: + - blink-volume + + - name: Unblink physical disk. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "UnBlinkTarget" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - unblink-target + + - name: Unblink virtual drive. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "UnBlinkTarget" + volume_id: "Disk.Virtual.0:RAID.Slot.1-1" + tags: + - unblink-drive + + - name: Convert physical disk to RAID + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ConvertToRAID" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - convert-raid + + - name: Convert physical disk to non-RAID + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ConvertToNonRAID" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - convert-non-raid + + - name: Change physical disk state to online. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ChangePDStateToOnline" + target: "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - pd-state-online + + - name: Change physical disk state to offline. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ChangePDStateToOnline" + target: "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1" + tags: + - pd-state-offline + + - name: Lock virtual drive + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "LockVirtualDisk" + volume_id: "Disk.Virtual.0:RAID.SL.3-1" + tags: + - lock diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_redfish_storage_controller_job_tracking.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_redfish_storage_controller_job_tracking.yml new file mode 100644 index 00000000..d61112f0 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_redfish_storage_controller_job_tracking.yml @@ -0,0 +1,138 @@ +--- +- hosts: idrac + connection: local + name: iDRAC Redfish storage controller service with job tracking. + gather_facts: False + vars: + retries_count: 100 + polling_interval: 10 + all_ctrl_task_tags: + - assign_dedicated_hot_spare + - assign_global_hot_spare + - set_controller_key + - rekey_lkm + - rekey_sekm + - remove_controller_key + - reset_config + + collections: + - dellemc.openmanage + +# Use a single tag to run each task with job tracker + tasks: + - name: Assign dedicated hot spare. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + volume_id: + - "Disk.Virtual.0:RAID.Slot.1-1" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + register: result + tags: + - assign_dedicated_hot_spare + + - name: Assign global hot spare. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1" + register: result + tags: + - assign_global_hot_spare + + - name: Set controller encryption key. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "SetControllerKey" + controller_id: "RAID.Slot.1-1" + key: "PassPhrase@123" + key_id: "mykeyid123" + register: result + tags: + - set_controller_key + + - name: Rekey in LKM mode. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ReKey" + controller_id: "RAID.Slot.1-1" + key: "NewPassPhrase@123" + key_id: "newkeyid123" + old_key: "OldPassPhrase@123" + register: result + tags: + - rekey_lkm + + - name: Rekey in SEKM mode. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ReKey" + controller_id: "RAID.Slot.1-1" + mode: "SEKM" + register: result + tags: + - rekey_sekm + + - name: Remove controller key. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "RemoveControllerKey" + controller_id: "RAID.Slot.1-1" + register: result + tags: + - remove_controller_key + + - name: Reset controller configuration. + idrac_redfish_storage_controller: + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + ca_path: "/path/to/ca_cert.pem" + command: "ResetConfig" + controller_id: "RAID.Slot.1-1" + register: result + tags: + - reset_config + + - name: "iDRAC Job tracking" + uri: + url: "https://{{ baseuri }}{{ result.task.uri }}" + user: "{{ username }}" + password: "{{ password }}" + method: "GET" + use_proxy: yes + status_code: 200, 202 + return_content: yes + validate_certs: no + force_basic_auth: yes + headers: + Content-Type: "application/json" + Accept: "application/json" + register: result + until: result.json.JobState == 'Completed' + retries: "{{ retries_count }}" + delay: "{{ polling_interval }}" + tags: "{{ all_ctrl_task_tags }}" + + - name: "iDRAC job result." + set_fact: + job_details: "{{ result.json }}" + failed_when: result.json.Message == "Failed" + changed_when: result.json.Message != "Failed" + tags: "{{ all_ctrl_task_tags }}"
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_reset.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_reset.yml new file mode 100644 index 00000000..209befd2 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_reset.yml @@ -0,0 +1,19 @@ +--- +- hosts: idrac + connection: local + name: Reset iDRAC + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Reset iDRAC + idrac_reset: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + + tags: + - idrac_reset
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_reset_result_tracking.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_reset_result_tracking.yml new file mode 100644 index 00000000..534b2227 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_reset_result_tracking.yml @@ -0,0 +1,39 @@ +--- +- hosts: idrac + connection: local + name: Reset iDRAC + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Reset iDRAC + idrac_reset: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + register: result + failed_when: result is changed + + - name: Wait for port 443 to become open on the host + wait_for: + host: "{{idrac_ip}}" + port: 443 + delay: 30 + connect_timeout: 5 + timeout: 500 + register: result + failed_when: result.elapsed < 20 + + - name: Get LC status. + idrac_lifecycle_controller_status_info: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + register: result + until: result.msg.LCStatus == 'Ready' or result.msg.LCReady is true + retries: 30 + delay: 10 diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_server_config_profile.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_server_config_profile.yml new file mode 100644 index 00000000..0d61f54c --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_server_config_profile.yml @@ -0,0 +1,220 @@ +--- +- hosts: idrac + connection: local + name: Server Configuration Profile + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + + - name: Export SCP with IDRAC components in JSON format to a local path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "/scp_folder" + scp_components: IDRAC + scp_file: example_file + export_format: JSON + export_use: Clone + job_wait: True + tags: export-scp-local + + - name: Import SCP with IDRAC components in JSON format from a local path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "/scp_folder" + command: import + scp_components: "IDRAC" + scp_file: example_file.json + shutdown_type: Graceful + end_host_power_state: "On" + job_wait: False + tags: import-scp-local + + - name: Export SCP with BIOS components in XML format to a NFS share path with auto-generated file name + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "192.168.0.2:/share" + scp_components: "BIOS" + export_format: XML + export_use: Default + job_wait: True + tags: export-scp-nfs + + - name: Import SCP with BIOS components in XML format from a NFS share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "192.168.0.2:/share" + command: import + scp_components: "BIOS" + scp_file: 192.168.0.1_20210618_162856.xml + shutdown_type: NoReboot + end_host_power_state: "Off" + job_wait: False + tags: import-scp-nfs + + - name: Export SCP with RAID components in XML format to a CIFS share path with share user domain name + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "\\\\192.168.0.2\\share" + share_user: share_username@domain + share_password: share_password + share_mnt: /mnt/cifs + scp_file: example_file.xml + scp_components: "RAID" + export_format: XML + export_use: Default + job_wait: True + tags: export-scp-cifs + + - name: Import SCP with RAID components in XML format from a CIFS share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "\\\\192.168.0.2\\share" + share_user: share_username + share_password: share_password + share_mnt: /mnt/cifs + command: import + scp_components: "RAID" + scp_file: example_file.xml + shutdown_type: Forced + end_host_power_state: "On" + job_wait: True + tags: import-scp-cifs + + - name: Export SCP with ALL components in JSON format to a HTTP share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "http://192.168.0.3/share" + share_user: share_username + share_password: share_password + scp_file: example_file.json + scp_components: ALL + export_format: JSON + job_wait: False + tags: export-scp-http + + - name: Import SCP with ALL components in JSON format from a HTTP share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: import + share_name: "http://192.168.0.3/share" + share_user: share_username + share_password: share_password + scp_file: example_file.json + shutdown_type: Graceful + end_host_power_state: "On" + job_wait: True + tags: import-scp-http + + - name: Export SCP with ALL components in XML format to a HTTPS share path without SCP file name + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "https://192.168.0.4/share" + share_user: share_username + share_password: share_password + scp_components: ALL + export_format: XML + export_use: Replace + job_wait: True + tags: export-scp-https + + - name: Import SCP with ALL components in XML format from a HTTPS share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + command: import + share_name: "https://192.168.0.4/share" + share_user: share_username + share_password: share_password + scp_file: 192.168.0.1_20160618_164647.xml + shutdown_type: Graceful + end_host_power_state: "On" + job_wait: False + tags: import-scp-https + + - name: Preview SCP with ALL components in XML format from a CIFS share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "\\\\192.168.0.2\\share" + share_user: share_username + share_password: share_password + command: preview + scp_components: "ALL" + scp_file: example_file.xml + job_wait: True + tags: preview-scp-cifs + + - name: Preview SCP with ALL components in JSON format from a NFS share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "192.168.0.2:/share" + command: preview + scp_components: "IDRAC" + scp_file: example_file.xml + job_wait: True + tags: preview-scp-nfs + + - name: Preview SCP with ALL components in XML format from a HTTP share path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "http://192.168.0.1/http-share" + share_user: share_username + share_password: share_password + command: preview + scp_components: "ALL" + scp_file: example_file.xml + job_wait: True + tags: preview-scp-http + + - name: Preview SCP with ALL components in XML format from a local path + dellemc.openmanage.idrac_server_config_profile: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "/scp_folder" + command: preview + scp_components: "IDRAC" + scp_file: example_file.json + job_wait: False + tags: import-scp-local diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_syslog.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_syslog.yml new file mode 100644 index 00000000..9820b6b6 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_syslog.yml @@ -0,0 +1,18 @@ +--- +- hosts: idrac + connection: local + name: Configure iDRAC syslog attributes + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Configure iDRAC syslog attributes + idrac_syslog: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + share_name: "{{ playbook_dir }}" + syslog: "Disabled"
\ No newline at end of file diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_system_info.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_system_info.yml new file mode 100644 index 00000000..b2f1e1ec --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_system_info.yml @@ -0,0 +1,16 @@ +--- +- hosts: idrac + connection: local + name: Get system inventory + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Get system inventory. + idrac_system_info: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_user.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_user.yml new file mode 100644 index 00000000..ab011e13 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_user.yml @@ -0,0 +1,71 @@ +--- +- hosts: idrac + connection: local + name: Configure the iDRAC users attributes + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + - name: Configure the create iDRAC users attributes + idrac_user: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "present" + user_name: "user_name" + user_password: "user_password" + privilege: "Administrator" + ipmi_lan_privilege: "User" + enable: "true" + sol_enable: "true" + protocol_enable: "true" + authentication_protocol: "MD5" + privacy_protocol: "DES" + tags: + - create-user + + - name: Configure the modify iDRAC users attributes + idrac_user: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + action: "present" + user_name: "user_name" + new_user_name: "new_user_name" + privilege: "Administrator" + ipmi_lan_privilege: "User" + enable: "true" + sol_enable: "true" + protocol_enable: "true" + authentication_protocol: "MD5" + privacy_protocol: "DES" + tags: + - modify-user + + - name: Configure the modify iDRAC username and password attributes. + idrac_user: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + action: "present" + user_name: "user_name" + new_user_name: "new_user_name" + user_password: "user_password" + tags: + - modify-username + + - name: Configure the delete iDRAC users attributes + idrac_user: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + state: "absent" + user_name: "user_name" + tags: + - remove-user diff --git a/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_virtual_media.yml b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_virtual_media.yml new file mode 100644 index 00000000..9a2cc520 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/idrac/idrac_virtual_media.yml @@ -0,0 +1,107 @@ +--- +- hosts: idrac + connection: local + name: Configure the boot order settings + gather_facts: False + + collections: + - dellemc.openmanage + + tasks: + + - name: Insert image file to Remote File Share 1 using CIFS share. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + virtual_media: + - insert: true + image: "//192.168.0.2/file_path/file.iso" + username: "username" + password: "password" + tags: insert-media-cifs + + - name: Insert image file to Remote File Share 2 using NFS share. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + virtual_media: + - index: 2 + insert: true + image: "192.168.0.4:/file_path/file.iso" + tags: insert-media-nfs + + - name: Insert image file to Remote File Share 1 and 2 using HTTP. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + force: true + virtual_media: + - index: 1 + insert: true + image: "http://192.168.0.4/file_path/file.img" + - index: 2 + insert: true + image: "http://192.168.0.4/file_path/file.img" + tags: insert-media-http + + - name: Insert image file using HTTPS. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + force: true + virtual_media: + - index: 1 + insert: true + image: "https://192.168.0.5/file_path/file.img" + username: username + password: password + tags: insert-media-http + + - name: Eject multiple virtual media. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + virtual_media: + - index: 1 + insert: false + - index: 2 + insert: false + tags: eject-media + + - name: Ejection of image file from Remote File Share 1. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + force: true + virtual_media: + insert: false + tags: eject-media-rfs1 + + - name: Insertion and ejection of image file in single task. + idrac_virtual_media: + idrac_ip: "{{ idrac_ip }}" + idrac_user: "{{ idrac_user }}" + idrac_password: "{{ idrac_password }}" + ca_path: "/path/to/ca_cert.pem" + force: true + virtual_media: + - index: 1 + insert: true + image: https://192.168.0.5/file/file.iso + username: username + password: password + - index: 2 + insert: false + tags: insert-eject-media |