diff options
Diffstat (limited to 'ansible_collections/dellemc/openmanage/playbooks/roles')
27 files changed, 356 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/README.md b/ansible_collections/dellemc/openmanage/playbooks/roles/README.md new file mode 100644 index 000000000..0535438b3 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/README.md @@ -0,0 +1,56 @@ +# Roles Playbooks + +### Using the Example playbooks + +1. Update the inventory +Update the idrac IP's, hostnames in the `inventory` file. + +1. Update the varaibles required for a role under `vars_files` folder. + +1. Run the following command to run the role +`ansible-playbook <role_folder>/<role_file>.yml -i inventory + +### Folder Tree + +``` +. +├── idrac_attributes +│ └── idrac_attributes.yml +├── idrac_bios +│ └── idrac_bios.yml +├── idrac_certificate +│ └── idrac_certificate.yml +├── idrac_export_server_config_profile +│ └── idrac_export_server_config_profile.yml +├── idrac_firmware +│ └── idrac_firmware.yml +├── idrac_gather_facts +│ └── idrac_gather_facts.yml +├── idrac_import_server_config_profile +│ └── idrac_import_server_config_profile.yml +├── idrac_os_deployment +│ └── idrac_os_deployment.yml +├── idrac_reset +│ └── idrac_reset.yml +├── idrac_server_powerstate +│ └── idrac_server_powerstate.yml +├── idrac_storage_controller +│ └── idrac_storage_controller.yml +├── inventory +├── README.md +├── redfish_firmware +│ └── redfish_firmware.yml +├── redfish_storage_volume +│ └── redfish_storage_volume.yml +└── vars_files + ├── bios.yml + ├── certificates.yml + ├── credentials.yml + ├── export.yml + ├── firmware.yml + ├── import.yml + ├── osd.yml + ├── reset.yml + └── storage_controller.yml + └── storage.yml +``` diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_attributes/idrac_attributes.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_attributes/idrac_attributes.yml new file mode 100644 index 000000000..3bd391f9b --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_attributes/idrac_attributes.yml @@ -0,0 +1,9 @@ +--- +- name: Manage attributes configurations in iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/attributes.yml + roles: + - dellemc.openmanage.idrac_attributes diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_bios/idrac_bios.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_bios/idrac_bios.yml new file mode 100644 index 000000000..6ef77791a --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_bios/idrac_bios.yml @@ -0,0 +1,9 @@ +--- +- name: Manage bios configurations in iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/bios.yml + roles: + - dellemc.openmanage.idrac_bios diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_certificate/idrac_certificate.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_certificate/idrac_certificate.yml new file mode 100644 index 000000000..0f0abd34e --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_certificate/idrac_certificate.yml @@ -0,0 +1,9 @@ +--- +- name: Manage certificates in iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/certificates.yml + roles: + - dellemc.openmanage.idrac_certificate diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_export_server_config_profile/idrac_export_server_config_profile.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_export_server_config_profile/idrac_export_server_config_profile.yml new file mode 100644 index 000000000..c11d7a8fc --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_export_server_config_profile/idrac_export_server_config_profile.yml @@ -0,0 +1,9 @@ +--- +- name: Export Server configuration profile + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/export.yml + roles: + - dellemc.openmanage.idrac_export_server_config_profile diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_firmware/idrac_firmware.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_firmware/idrac_firmware.yml new file mode 100644 index 000000000..4cdbba537 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_firmware/idrac_firmware.yml @@ -0,0 +1,11 @@ +--- +- name: Firmware update using catalog for iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/firmware.yml + vars: + hostname: "{{ inventory_hostname }}" + roles: + - dellemc.openmanage.idrac_firmware diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_gather_facts/idrac_gather_facts.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_gather_facts/idrac_gather_facts.yml new file mode 100644 index 000000000..d49b08bc0 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_gather_facts/idrac_gather_facts.yml @@ -0,0 +1,10 @@ +--- +- name: Get iDRAC information + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + vars: + target: "{{ gather_facts_target }}" + roles: + - dellemc.openmanage.idrac_gather_facts diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_import_server_config_profile/idrac_import_server_config_profile.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_import_server_config_profile/idrac_import_server_config_profile.yml new file mode 100644 index 000000000..7b2025325 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_import_server_config_profile/idrac_import_server_config_profile.yml @@ -0,0 +1,9 @@ +--- +- name: Import Server configuration profile + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/import.yml + roles: + - dellemc.openmanage.idrac_import_server_config_profile diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_job_queue/idrac_job_queue.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_job_queue/idrac_job_queue.yml new file mode 100644 index 000000000..b234ca8af --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_job_queue/idrac_job_queue.yml @@ -0,0 +1,10 @@ +--- +- name: Manage the iDRAC lifecycle controller job queue. + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + vars: + clear_job_queue: true + roles: + - dellemc.openmanage.idrac_job_queue diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_os_deployment/idrac_os_deployment.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_os_deployment/idrac_os_deployment.yml new file mode 100644 index 000000000..79f08501d --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_os_deployment/idrac_os_deployment.yml @@ -0,0 +1,9 @@ +--- +- name: Operating System Deployment in iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/osd.yml + roles: + - dellemc.openmanage.idrac_os_deployment diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_reset/idrac_reset.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_reset/idrac_reset.yml new file mode 100644 index 000000000..b46e3dfb0 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_reset/idrac_reset.yml @@ -0,0 +1,9 @@ +--- +- name: Reset iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/reset.yml + roles: + - dellemc.openmanage.idrac_reset diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_server_powerstate/idrac_server_powerstate.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_server_powerstate/idrac_server_powerstate.yml new file mode 100644 index 000000000..b2e7c1f46 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_server_powerstate/idrac_server_powerstate.yml @@ -0,0 +1,10 @@ +--- +- name: Manage iDRAC server power cycle + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + vars: + reset_type: "On" + roles: + - dellemc.openmanage.idrac_server_powerstate diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_storage_controller/idrac_storage_controller.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_storage_controller/idrac_storage_controller.yml new file mode 100644 index 000000000..b8763f4ac --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/idrac_storage_controller/idrac_storage_controller.yml @@ -0,0 +1,9 @@ +--- +- name: Manage storage controller in iDRAC + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/storage_controller.yml + roles: + - dellemc.openmanage.idrac_storage_controller diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/inventory b/ansible_collections/dellemc/openmanage/playbooks/roles/inventory new file mode 100644 index 000000000..5da778f1c --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/inventory @@ -0,0 +1,4 @@ +[idrac] +192.168.0.1 +192.168.0.2 +192.168.0.3 diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/redfish_firmware/redfish_firmware.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/redfish_firmware/redfish_firmware.yml new file mode 100644 index 000000000..915d56627 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/redfish_firmware/redfish_firmware.yml @@ -0,0 +1,9 @@ +--- +- name: Firmware update using DUP file + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/firmware.yml + roles: + - dellemc.openmanage.redfish_firmware diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/redfish_storage_volume/redfish_storage_volume.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/redfish_storage_volume/redfish_storage_volume.yml new file mode 100644 index 000000000..06684710d --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/redfish_storage_volume/redfish_storage_volume.yml @@ -0,0 +1,9 @@ +--- +- name: Redfish Storage volume Configurations + hosts: idrac + gather_facts: false + vars_files: + - ../vars_files/credentials.yml + - ../vars_files/storage.yml + roles: + - dellemc.openmanage.redfish_storage_volume diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/attributes.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/attributes.yml new file mode 100644 index 000000000..86278b227 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/attributes.yml @@ -0,0 +1,8 @@ +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 diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/bios.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/bios.yml new file mode 100644 index 000000000..cf60e098e --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/bios.yml @@ -0,0 +1,13 @@ +attributes: + BootMode: "Bios" + OneTimeBootMode: "Enabled" + BootSeqRetry: "Enabled" +apply_time: "Immediate" +maintenance_window: + start_time: "2022-09-30T05:15:40-05:00" + duration: 600 +clear_pending: false +reset_bios: false +reset_type: "graceful_restart" +job_wait: true +job_wait_timeout: 1200 diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/certificates.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/certificates.yml new file mode 100644 index 000000000..32ebd4aca --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/certificates.yml @@ -0,0 +1,13 @@ +command: "generate_csr" +certificate_type: "HTTPS" +certificate_path: "/home/omam/mycerts" +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.168.0.3 diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/credentials.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/credentials.yml new file mode 100644 index 000000000..78990bb87 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/credentials.yml @@ -0,0 +1,27 @@ +hostname: "{{ inventory_hostname }}" +username: "username" +password: "password" + +# Required for Export Role +idrac_ip: "{{ inventory_hostname }}" +idrac_user: "{{ username }}" +idrac_password: "{{ password }}" + +validate_certs: false +proxy_params: + server: 192.168.0.6 + port: 8080 + username: "proxy_user" + password: "proxy_password" + +repo_details: + proto: "https" + ip: "192.168.0.5" + username: "username" + password: "password" + +http_url: "{{ repo_details.proto }}://{{ repo_details.ip }}/{{ http_path }}" +cifs_url: "//{{ repo_details.ip }}" +nfs_url: "{{ repo_details.ip }}:/{{ nfs_path }}" + +gather_facts_target: "System" diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/export.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/export.yml new file mode 100644 index 000000000..6749763ee --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/export.yml @@ -0,0 +1,14 @@ +share_parameters: + share_name: "{{ repo_url }}/myshare" + share_user: "{{ repo_details.username }}" + share_password: "{{ repo_details.password }}" + scp_file: "filename.xml" + proxy_support: false + proxy_server: "{{ proxy_params.server }}" + proxy_port: "{{ proxy_params.port }}" + proxy_type: socks4 + ignore_certificate_warning: ignore +target: ["ALL"] +include_in_export: default +export_format: "XML" +export_use: "Default" diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/firmware.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/firmware.yml new file mode 100644 index 000000000..588d8376b --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/firmware.yml @@ -0,0 +1,16 @@ +# Role idrac_firmware Vars +share_name: "{{ repo_url }}/firmware_repo/" +catalog_file_name: "MyCatalog.xml" +reboot: true +job_wait: true +apply_update: true +proxy_support: ParametersProxy +proxy_server: "{{ proxy_params.server }}" +proxy_type: HTTP +proxy_port: "{{ proxy_params.port }}" +proxy_uname: "{{ proxy_params.username }}" +proxy_passwd: "{{ proxy_params.password }}" + +# Role redfish_firmware Vars +image_uri: "{{ repo_url }}/firmware_repo/component.exe" +transfer_protocol: "HTTP" diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/import.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/import.yml new file mode 100644 index 000000000..3696a7d63 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/import.yml @@ -0,0 +1,11 @@ +share_parameters: + share_name: "{{ repo_url }}/scp_share" + share_user: "{{ repo_details.username }}" + share_password: "{{ repo_details.password }}" + scp_file: "filename.xml" + proxy_support: false + proxy_server: "{{ proxy_params.server }}" + proxy_port: "{{ proxy_params.port }}" + proxy_type: socks4 + ignore_certificate_warning: ignore +target: ["ALL"] diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/osd.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/osd.yml new file mode 100644 index 000000000..c27c7c2d3 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/osd.yml @@ -0,0 +1,27 @@ +os_name: rhel +os_version: 9 +source: + protocol: "{{ repo_details.proto }}" + hostname: "{{ repo_details.ip }}" + iso_path: "/users/rhel" + iso_name: "esxi.iso" + # ks_path: "/users/rhel/myks.cfg" + # is_custom_iso: true + # username: "username" + # password: "password" +destination: + protocol: "{{ repo_details.proto }}" + hostname: "{{ repo_details.ip }}" + iso_path: "/{{ http_path }}" + # iso_name: "my_custom_rhel_name.iso" + mountpoint: "/var/www/repo" + os_type: "linux" + username: "username" + password: "password" + +wait_for_os_deployment: true +os_deployment_timeout: 30 +eject_iso: true +delete_custom_iso: true +rhel_rootpw: "" +esxi_rootpw: "" diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/reset.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/reset.yml new file mode 100644 index 000000000..808aa0683 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/reset.yml @@ -0,0 +1,3 @@ +wait_for_idrac: true +force_restart: false +reset_to_default: "Default" diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/storage.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/storage.yml new file mode 100644 index 000000000..ba22d319f --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/storage.yml @@ -0,0 +1,12 @@ +state: "present" +raid_type: "RAID1" +name: "VD0" +controller_id: "RAID.Slot.1-1" +drives: + - Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.1-1 + - Disk.Bay.6:Enclosure.Internal.0-1:RAID.Slot.1-1 +block_size_bytes: 512 +capacity_bytes: 299439751168 +optimum_io_size_bytes: 65536 +encryption_types: NativeDriveEncryption +encrypted: true diff --git a/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/storage_controller.yml b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/storage_controller.yml new file mode 100644 index 000000000..7d754c646 --- /dev/null +++ b/ansible_collections/dellemc/openmanage/playbooks/roles/vars_files/storage_controller.yml @@ -0,0 +1,21 @@ +controller_id: "RAID.Integrated.1-1" +attributes: + ControllerMode: "RAID" +apply_time: "Immediate" +maintenance_window: + start_time: "2022-09-30T05:15:40-05:00" + duration: 1200 +disks: + id: "Disk.Bay.0:Enclosure.Internal.0-0:RAID.Integrated.1-1" + status: "online" +volumes: + id: "Disk.Virtual.0:RAID.Integrated.1-1" + blink: true +reset_config: false +set_controller_key: false +re_key: false +key: "PassPhrase@123" +key_id: "mykeyid123" +old_key: "OldPhassParse@123" +mode: "LKM" +remove_key: false |