diff --git a/omnia.sh b/omnia.sh index 6c06c8ecbd..c997d2ff97 100755 --- a/omnia.sh +++ b/omnia.sh @@ -30,7 +30,7 @@ GREEN='\033[0;32m' BLUE='\033[0;34m' NC='\033[0m' # No Color YELLOW='\033[0;33m' -omnia_release=2.0.0.0 +omnia_release=2.1.0.0 core_container_status=false omnia_path="" @@ -925,9 +925,10 @@ start_container_session() { } show_help() { - echo "Usage: $0 [--install | --uninstall | --help]" + echo "Usage: $0 [--install | --uninstall | --version | --help]" echo " -i, --install Install and start the Omnia core container" echo " -u, --uninstall Uninstall the Omnia core container and clean up configuration" + echo " -v, --version Display Omnia version information" echo " -h, --help More information about usage" } @@ -1110,6 +1111,34 @@ install_omnia_core() { fi } +# Check if Omnia core container is running +check_container_status() { + # Check if the Omnia core container is running + if ! podman ps --format '{{.Names}}' | grep -qw "omnia_core"; then + echo -e "${RED}ERROR: Omnia core container is not running.${NC}" + exit 1 + fi +} + +# Function to display version information +display_version() { + # Check if metadata file exists and Omnia core container is running + check_container_status + + # Fetch the metadata from the oim_metadata.yml file in the container + echo -e "${GREEN} Fetching metadata from omnia_core container...${NC}" + core_config=$(podman exec omnia_core /bin/bash -c 'cat /opt/omnia/.data/oim_metadata.yml') + + # Extract Omnia version from metadata file + omnia_version=$(echo "$core_config" | grep "omnia_version:" | cut -d':' -f2 | tr -d ' \t\n\r') + + # Display version information + echo "Omnia version: $omnia_version" + + # Return exit code 0 on success + exit 0 +} + # Main function to check if omnia_core container is already running. # If yes, ask the user if they want to enter the container or reinstall. # If no, set it up. @@ -1121,6 +1150,9 @@ main() { --uninstall|-u) cleanup_omnia_core ;; + --version|-v) + display_version + ;; --help|-h|"") show_help ;; diff --git a/upgrade/ansible.cfg b/upgrade/ansible.cfg new file mode 100644 index 0000000000..c8b2d1e469 --- /dev/null +++ b/upgrade/ansible.cfg @@ -0,0 +1,17 @@ +[defaults] +log_path = /opt/omnia/log/core/playbooks/upgrade.log +remote_tmp = /opt/omnia/tmp/.ansible/tmp/ +host_key_checking = false +forks = 5 +timeout = 180 +executable = /bin/bash +library = ../common/library/modules +module_utils = ../common/library/module_utils + +[persistent_connection] +command_timeout = 180 +connect_timeout = 180 + +[ssh_connection] +retries = 3 +ssh_args = -o ControlMaster=auto -o ControlPersist=60 -o ConnectTimeout=60 diff --git a/upgrade/main.yml b/upgrade/main.yml new file mode 100644 index 0000000000..f4c5b1b7cb --- /dev/null +++ b/upgrade/main.yml @@ -0,0 +1,14 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- diff --git a/upgrade/roles/import_input_parameters/tasks/main.yml b/upgrade/roles/import_input_parameters/tasks/main.yml new file mode 100644 index 0000000000..f4c5b1b7cb --- /dev/null +++ b/upgrade/roles/import_input_parameters/tasks/main.yml @@ -0,0 +1,14 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- diff --git a/upgrade/roles/import_input_parameters/templates/network_spec.j2 b/upgrade/roles/import_input_parameters/templates/network_spec.j2 new file mode 100644 index 0000000000..98d3073c0f --- /dev/null +++ b/upgrade/roles/import_input_parameters/templates/network_spec.j2 @@ -0,0 +1,14 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/upgrade/roles/import_input_parameters/vars/main.yml b/upgrade/roles/import_input_parameters/vars/main.yml new file mode 100644 index 0000000000..f4c5b1b7cb --- /dev/null +++ b/upgrade/roles/import_input_parameters/vars/main.yml @@ -0,0 +1,14 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- diff --git a/upgrade/roles/upgrade_cluster/tasks/main.yml b/upgrade/roles/upgrade_cluster/tasks/main.yml new file mode 100644 index 0000000000..196366870b --- /dev/null +++ b/upgrade/roles/upgrade_cluster/tasks/main.yml @@ -0,0 +1,18 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- + +- name: Include import input parameters + ansible.builtin.include_role: + name: import_input_parameters diff --git a/upgrade/roles/upgrade_cluster/vars/main.yml b/upgrade/roles/upgrade_cluster/vars/main.yml new file mode 100644 index 0000000000..f4c5b1b7cb --- /dev/null +++ b/upgrade/roles/upgrade_cluster/vars/main.yml @@ -0,0 +1,14 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- diff --git a/upgrade/roles/upgrade_oim/tasks/main.yml b/upgrade/roles/upgrade_oim/tasks/main.yml new file mode 100644 index 0000000000..196366870b --- /dev/null +++ b/upgrade/roles/upgrade_oim/tasks/main.yml @@ -0,0 +1,18 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- + +- name: Include import input parameters + ansible.builtin.include_role: + name: import_input_parameters diff --git a/upgrade/roles/upgrade_oim/vars/main.yml b/upgrade/roles/upgrade_oim/vars/main.yml new file mode 100644 index 0000000000..f4c5b1b7cb --- /dev/null +++ b/upgrade/roles/upgrade_oim/vars/main.yml @@ -0,0 +1,14 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- diff --git a/upgrade/upgrade_cluster.yml b/upgrade/upgrade_cluster.yml new file mode 100644 index 0000000000..86e475f6d2 --- /dev/null +++ b/upgrade/upgrade_cluster.yml @@ -0,0 +1,20 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- + +- name: Upgrade cluster tasks + hosts: localhost + connection: local + roles: + - role: upgrade_cluster diff --git a/upgrade/upgrade_oim.yml b/upgrade/upgrade_oim.yml new file mode 100644 index 0000000000..3e91f1a479 --- /dev/null +++ b/upgrade/upgrade_oim.yml @@ -0,0 +1,20 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- + +- name: Upgrade OIM tasks + hosts: localhost + connection: local + roles: + - role: upgrade_oim diff --git a/upgrade/upgrade_omnia.yml b/upgrade/upgrade_omnia.yml new file mode 100644 index 0000000000..61050ec244 --- /dev/null +++ b/upgrade/upgrade_omnia.yml @@ -0,0 +1,20 @@ +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- + +- name: Upgrade OIM tasks + ansible.builtin.import_playbook: upgrade_oim.yml + +- name: Upgrade cluster tasks + ansible.builtin.import_playbook: upgrade_cluster.yml