diff --git a/images/scripts/install_daos.sh b/images/scripts/install_daos.sh index 898ed34..36f9cdb 100644 --- a/images/scripts/install_daos.sh +++ b/images/scripts/install_daos.sh @@ -179,21 +179,14 @@ add_repo() { ;; esac - echo "Adding DAOS version ${DAOS_VERSION} repo" - cat > /etc/yum.repos.d/daos.repo < [access\_points](#output\_access\_points) | List of DAOS servers to use as access points | | [daos\_agent\_yml](#output\_daos\_agent\_yml) | YAML to configure the daos agent. This is typically saved in /etc/daos/daos\_agent.yml | +| [daos\_client\_install\_script](#output\_daos\_client\_install\_script) | Script to install the DAOS client package. | | [daos\_config\_script](#output\_daos\_config\_script) | Script to configure the DAOS system. This will format the sytem with dmg -l and optionally create the specified pools. | | [daos\_control\_yml](#output\_daos\_control\_yml) | YAML configuring DAOS control. This is typically saved in /etc/daos/daos\_control.yml | diff --git a/terraform/modules/daos_server/main.tf b/terraform/modules/daos_server/main.tf index 97e1335..da2a85d 100644 --- a/terraform/modules/daos_server/main.tf +++ b/terraform/modules/daos_server/main.tf @@ -58,6 +58,9 @@ locals { } ) + daos_client_install_script_content = file( + "${path.module}/scripts/daos_client_install_script.sh") + # Google Virtual NIC (gVNIC) network interface nic_type = var.gvnic ? "GVNIC" : "VIRTIO_NET" total_egress_bandwidth_tier = var.gvnic ? "TIER_1" : "DEFAULT" diff --git a/terraform/modules/daos_server/module.json b/terraform/modules/daos_server/module.json index 45ef6ca..d0974e6 100644 --- a/terraform/modules/daos_server/module.json +++ b/terraform/modules/daos_server/module.json @@ -191,6 +191,10 @@ "name": "daos_agent_yml", "description": "YAML to configure the daos agent. This is typically saved in /etc/daos/daos_agent.yml" }, + { + "name": "daos_client_install_script", + "description": "Script to install the DAOS client package." + }, { "name": "daos_config_script", "description": "Script to configure the DAOS system. This will format the sytem with dmg -l and optionally create the specified pools." diff --git a/terraform/modules/daos_server/outputs.tf b/terraform/modules/daos_server/outputs.tf index c48a936..79f7821 100644 --- a/terraform/modules/daos_server/outputs.tf +++ b/terraform/modules/daos_server/outputs.tf @@ -21,3 +21,8 @@ output "daos_config_script" { description = "Script to configure the DAOS system. This will format the sytem with dmg -l and optionally create the specified pools." value = local.configure_daos_content } + +output "daos_client_install_script" { + description = "Script to install the DAOS client package." + value = local.daos_client_install_script_content +} diff --git a/terraform/modules/daos_server/scripts/daos_client_install_script.sh b/terraform/modules/daos_server/scripts/daos_client_install_script.sh new file mode 100644 index 0000000..90b337c --- /dev/null +++ b/terraform/modules/daos_server/scripts/daos_client_install_script.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Install DAOS Client package +# +# TODO: Add support for installing on openSUSE Leap 15.3 and Ubuntu 20.04 LTS +# + +DAOS_VERSION="${DAOS_VERSION:-2.0}" + +echo "BEGIN: DAOS Client Installation" + +# Determine which repo to use +# shellcheck disable=SC1091 +source "/etc/os-release" +OS_VERSION=$(echo "${VERSION_ID}" | cut -d. -f1) +OS_VERSION_ID="${ID,,}_${OS_VERSION}" +case ${OS_VERSION_ID} in + centos_7) + DAOS_OS_VERSION="CentOS7" + ;; + centos_8) + DAOS_OS_VERSION="CentOS8" + ;; + rocky_8) + DAOS_OS_VERSION="CentOS8" + ;; + *) + echo "ERROR: Unsupported OS: ${OS_VERSION_ID}. Exiting." + exit 1 + ;; +esac + +echo "Adding DAOS v${DAOS_VERSION} packages repo" +curl -s --output /etc/yum.repos.d/daos_packages.repo "https://packages.daos.io/v${DAOS_VERSION}/${DAOS_OS_VERSION}/packages/x86_64/daos_packages.repo" + +echo "Installing daos-client and daos-devel packages" +yum install -y daos-client daos-devel +systemctl enable daos_agent + +echo "END: DAOS Client Installation"