Skip to content
Closed
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
5 changes: 5 additions & 0 deletions examples/inventory/bmc_inventory_file_os_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[bmc_x86_64]
10.98.1.1

[bmc_aarch64]
10.98.1.2
10 changes: 10 additions & 0 deletions input/provision_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
# Format of csv: FUNCTIONAL_GROUP_NAME,GROUP_NAME,SERVICE_TAG,HOSTNAME,ADMIN_MAC,ADMIN_IP,BMC_MAC,BMC_IP
pxe_mapping_file_path: "/opt/omnia/input/project_default/pxe_mapping_file.csv"

# x64 bit Operating System ISO file name.
# This specifies the name of the ISO file to be used for OS provisioning.
# The ISO should be configured for unattended or silent installation.
os_iso_file_name_x86_64: ""

# arm Operating System ISO file name.
# This specifies the name of the ISO file to be used for OS provisioning.
# The ISO should be configured for unattended or silent installation.
os_iso_file_name_aarch64: ""

#### Mandatory
# Timezone that needs to be set during OS provisioning.
# Available timezones are provided in common/library/module_utils/input_validation/common_utils/timezone.txt
Expand Down
70 changes: 70 additions & 0 deletions utils/provision_diskfull_nodes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
- name: Set_fact for fetch omnia config credentials
hosts: localhost
connection: local
tasks:
- name: Set dynamic run tags including 'provision'
when: not config_file_status | default(false) | bool
ansible.builtin.set_fact:
omnia_run_tags: "{{ (ansible_run_tags | default([]) + ['provision']) | unique }}"
cacheable: true

- name: Invoke get_config_credentials.yml
when: not config_file_status | default(false) | bool
ansible.builtin.import_playbook: ../utils/credential_utility/get_config_credentials.yml

- name: Include input project directory
when: not project_dir_status | default(false) | bool
ansible.builtin.import_playbook: include_input_dir.yml
tags: always

- name: Deploy RHEL using iDRAC OS deployment
hosts: bmc_x86_64, bmc_aarch64
gather_facts: false
become: false

pre_tasks:
- name: Include provision config
ansible.builtin.include_vars: "{{ hostvars['localhost']['input_project_dir'] }}/provision_config.yml"

- name: Include oim metadata vars
ansible.builtin.include_vars: "/opt/omnia/.data/oim_metadata.yml"

- name: Select ISO file per architecture
ansible.builtin.set_fact:
os_iso_file_name: >-
{% if 'bmc_x86_64' in group_names %}
{{ os_iso_file_name_x86_64 }}
{% elif 'bmc_aarch64' in group_names %}
{{ os_iso_file_name_aarch64 }}
{% else %}
""
{% endif %}

- name: Fail if ISO file name is not defined or empty
ansible.builtin.fail:
msg: >-
The ISO file name for {{ group_names | join(', ') }} is empty!
Please set 'os_iso_file_name_x86_64' or 'os_iso_file_name_aarch64'
in provision_config.yml.
when: os_iso_file_name is not defined or os_iso_file_name | trim == ""

tasks:
- name: Run OS deployment via iDRAC
ansible.builtin.include_role:
name: dellemc.openmanage.idrac_os_deployment
vars:
hostname: "{{ inventory_hostname }}"
username: "{{ hostvars['localhost']['bmc_username'] }}"
password: "{{ hostvars['localhost']['bmc_password'] }}"
os_name: RHEL # hardcoded as the role accepts RHEL. Since custom iso being used this var won't have any impact.
os_version: 9 # hardcoded as the role accepts 9. Since custom iso being used this var won't have any impact.
validate_certs: false
source:
protocol: nfs
hostname: "{{ nfs_server_ip }}"
iso_path: "{{ nfs_server_share_path }}"
iso_name: "{{ os_iso_file_name }}"
is_custom_iso: true
eject_iso: true
os_deployment_timeout: 30