Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [OCPQE-18907] - Ansible playbook to setup Dell R650 servers #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion servers-management/dell/ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The OMSDK version installed with pip prevents the ansible module to work with di
git clone https://github.com/dell/omsdk.git
cd omsdk
pip3 install -r requirements-python3x.txt
sh build.sh 1.2 503
sh build.sh 1.2 503 (See package version on github)
cd dist
pip install omsdk-1.2.503-py2.py3-none-any.whl
```
118 changes: 118 additions & 0 deletions servers-management/dell/ansible/dell_setup_R650.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
- hosts: idrac
connection: local
name: Dell Server Management
gather_facts: False
vars_files:
- idrac_vars.yaml
environment: "{{proxy_env}}"

tasks:

- name: Reset BIOS attributes to default settings, parallel execution
dellemc.openmanage.idrac_bios:
idrac_ip: "{{ item }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
validate_certs: False
reset_bios: true
with_items: "{{ groups['idrac'] }}"
register: _create_instances
async: 600 # Maximum runtime in seconds. Adjust as needed.
poll: 0 # Fire and continue (never poll)
tags:
- reset_bios

- name: Wait for BIOS reset jobs to finish
async_status:
jid: "{{ item.ansible_job_id }}"
register: _jobs
until: _jobs.finished
delay: 120 # Check every 120 seconds. Adjust as you like.
retries: 10 # Retry up to 10 times. Adjust as needed.
with_items: "{{ _create_instances.results }}"
tags:
- parallel

- name: Enable PXE 1 and 2, Disable PXE 3 and 4
dellemc.openmanage.idrac_bios:
idrac_ip: "{{ item }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
validate_certs: False
attributes:
PxeDev1EnDis: "Enabled"
PxeDev2EnDis: "Enabled"
PxeDev3EnDis: "Disabled"
PxeDev4EnDis: "Disabled"
with_items: "{{ groups['idrac'] }}"
tags:
- pxeconfig_enable_devices

- name: Configure PXE Device 1 to boot from Embedded Nic 1 Port 1 Partition 1
dellemc.openmanage.idrac_bios:
idrac_ip: "{{ item }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
validate_certs: False
attributes:
PxeDev1Interface: "{{ nic_baremetal }}" # ref: https://issues.redhat.com/browse/OCPQE-18907
PxeDev1Protocol: "IPv4"
PxeDev1VlanEnDis: "Disabled"
with_items: "{{ groups['idrac'] }}"
tags:
- pxeconfig_dev1_baremetal

- name: Configure PXE Device 2 to PXE boot from Embedded Nic 2 Port 1 Partition 1
dellemc.openmanage.idrac_bios:
idrac_ip: "{{ item }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
validate_certs: False
attributes:
PxeDev2Interface: "{{ nic_provisioning }}" # ref: https://issues.redhat.com/browse/OCPQE-18907
PxeDev2Protocol: "IPv4"
PxeDev2VlanEnDis: "Disabled"
with_items: "{{ groups['idrac'] }}"
tags:
- pxeconfig_dev2_provisioning



- name: Configure Bios Generic Attributes # ref: https://issues.redhat.com/browse/OCPQE-18907
# Boot mode: UEFI
# TPM off
# Performance hardware profile
# Virtualization technology enabled
# SR-IOV enabled
# Hard-disk Drive Placeholder disabled
dellemc.openmanage.idrac_bios:
idrac_ip: "{{ item }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
validate_certs: False
attributes:
BootMode: "Uefi"
TpmSecurity: "Off"
SysProfile: "PerfOptimized"
ProcVirtualization: "Enabled"
SriovGlobalEnable: "Enabled"
HddPlaceholder: "Disabled"
with_items: "{{ groups['idrac'] }}"
tags:
- bios_config

- name: Configure Boot Sources
dellemc.openmanage.idrac_boot:
idrac_ip: "{{ item }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
validate_certs: False
boot_options:
- boot_option_reference: "NIC.PxeDevice.1-1"
enabled: false
- boot_option_reference: "NIC.PxeDevice.2-1"
enabled: false
with_items: "{{ groups['idrac'] }}"
tags:
- boot_sources
5 changes: 4 additions & 1 deletion servers-management/dell/ansible/idrac_vars.example.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
idrac_user: "idrac_user"
idrac_password: "idrac_password"
idrac_password: "idrac_password"
proxy_env:
http_proxy: PROXY_CONF
https_proxy: PROXY_CONF
24 changes: 24 additions & 0 deletions servers-management/dell/ansible/inventory_R650.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
idrac:
hosts:
192.168.70.120:
# 192.168.70.105:
# 192.168.70.107:
# 192.168.70.117:
# 192.168.70.116:
# 192.168.70.118:
# 192.168.70.121:
# 192.168.70.119:
# 192.168.70.106:
# 192.168.70.130:
# 192.168.70.122:
# 192.168.70.128:
# 192.168.70.82:
# 192.168.70.127:
# 192.168.70.92:
# 192.168.70.129:
# 192.168.70.83:
# 192.168.70.94:
# 192.168.70.93:
vars:
nic_baremetal: "NIC.Embedded.1-1-1"
nic_provisioning: "NIC.Embedded.2-1-1"