Skip to content

Commit

Permalink
Add support for autobuild on RHEL
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar-j committed Sep 3, 2024
1 parent c28261c commit 77a22c6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/sdc_host_linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ versions={
}
scini = {
url = "http://example.com/release/5.15.0-1-generic"
linux_distro = "RHEL" #"Ubuntu"
linux_distro = "RHEL9" #"Ubuntu"
autobuild_scini = true
}
Expand Down Expand Up @@ -111,7 +111,7 @@ No resources.
| <a name="input_mdm_ips"></a> [mdm\_ips](#input\_mdm\_ips) | all the mdms (either primary,secondary or virtual ips) in a comma separated list by cluster if unset will use the mdms of the cluster set in the provider block eg. ['10.10.10.5,10.10.10.6', '10.10.10.7,10.10.10.8'] | `list(string)` | `[]` | no |
| <a name="input_powerflex_config"></a> [powerflex\_config](#input\_powerflex\_config) | Stores the configuration for terraform PowerFlex provider. | <pre>object({<br> # Define the attributes of the configuration for terraform PowerFlex provider.<br> username = string<br> endpoint = string<br> password = string<br> })</pre> | n/a | yes |
| <a name="input_remote_host"></a> [remote\_host](#input\_remote\_host) | Stores the SSH credentials for connecting to the remote Linux host. | <pre>object({<br> # Define the `user` attribute of the `remote` variable.<br> user = string<br> # Define the ssh `private_key` file with path for the SDC login user<br> private_key = optional(string, "")<br> # Define the ssh `certificate` file path, issued to the SDC login user<br> certificate = optional(string, "")<br> password = optional(string)<br> })</pre> | n/a | yes |
| <a name="input_scini"></a> [scini](#input\_scini) | The SCINI module package related variables. | <pre>object({<br> # The URL where the SCINI module package is located.<br> url = optional(string)<br> # specify distro where SDC will be deployed eg. RHEL, Ubuntu, SLES etc. as case sensitive<br> linux_distro = string<br> #allow to build scini on destination machine. This may not work on PowerFlex v3.X. Prerequisites here https://www.dell.com/support/kbdoc/en-us/000224134/how-to-on-demand-compilation-of-the-powerflex-sdc-driver <br> autobuild_scini = optional(bool, false)<br> })</pre> | n/a | yes |
| <a name="input_scini"></a> [scini](#input\_scini) | The SCINI module package related variables. | <pre>object({<br> # The URL where the SCINI module package is located. Ignored if autobuild_scini is true.<br> url = optional(string)<br> # specify distro where SDC will be deployed eg. RHEL9, Ubuntu etc. as case sensitive<br> linux_distro = string<br> #allow to build scini on destination machine. This may not work on PowerFlex v3.X. Prerequisites here https://www.dell.com/support/kbdoc/en-us/000224134/how-to-on-demand-compilation-of-the-powerflex-sdc-driver <br> autobuild_scini = optional(bool, false)<br> })</pre> | n/a | yes |
| <a name="input_sdc_pkg"></a> [sdc\_pkg](#input\_sdc\_pkg) | configuration for SDC package like url to download package from, copy as local package or directory on remote server. One of local\_dir or remote\_dir will be used based on the variable use\_remote\_path | <pre>object({<br> # examples "http://example.com/EMC-ScaleIO-sdc-3.6-700.103.Ubuntu.22.04.x86_64.tar", "ftp://username:password@ftpserver/path/to/file"<br> url = optional(string)<br> #the name of the SDC package for local.<br> pkg_name = optional(string)<br> #the name of the SDC package for remote machine. It should be emc-sdc-package.(tar/rpm)<br> remote_pkg_name = optional(string)<br> #local directory where the SDC package will be downloaded.<br> local_dir = optional(string)<br> #remote directory where the SDC package will be downloaded. (if use_remote_path is true)<br> remote_dir = optional(string, "/tmp")<br> # use the SDC package on remote machine path (where SDC is deployed)<br> use_remote_path = bool<br> # if SDC package is available in local directory, download can be skipped by setting to true<br> skip_download_sdc = optional(bool, false)<br> })</pre> | n/a | yes |
| <a name="input_versions"></a> [versions](#input\_versions) | n/a | <pre>object({<br> pflex = string<br> kernel = string<br> })</pre> | n/a | yes |

Expand Down
4 changes: 2 additions & 2 deletions examples/sdc_host_linux/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ variable "scini" {

description = "The SCINI module package related variables."
type = object({
# The URL where the SCINI module package is located.
# The URL where the SCINI module package is located. Ignored if autobuild_scini is true.
url = optional(string)
# specify distro where SDC will be deployed eg. RHEL, Ubuntu, SLES etc. as case sensitive
# specify distro where SDC will be deployed eg. RHEL9, Ubuntu etc. as case sensitive
linux_distro = string
#allow to build scini on destination machine. This may not work on PowerFlex v3.X. Prerequisites here https://www.dell.com/support/kbdoc/en-us/000224134/how-to-on-demand-compilation-of-the-powerflex-sdc-driver
autobuild_scini = optional(bool, false)
Expand Down
2 changes: 1 addition & 1 deletion modules/sdc_host_linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ No modules.
| <a name="input_ip"></a> [ip](#input\_ip) | Stores the IP address of the remote Linux host. | `string` | n/a | yes |
| <a name="input_mdm_ips"></a> [mdm\_ips](#input\_mdm\_ips) | all the mdms (either primary,secondary or virtual ips) in a comma separated list by cluster if unset will use the mdms of the cluster set in the provider block eg. ['10.10.10.5,10.10.10.6', '10.10.10.7,10.10.10.8'] | `list(string)` | n/a | yes |
| <a name="input_remote_host"></a> [remote\_host](#input\_remote\_host) | Stores the SSH credentials for connecting to the remote Linux host. | <pre>object({<br> # Define the `user` attribute of the `remote` variable.<br> user = string<br> # Define the ssh `private_key` file with path for the SDC login user<br> private_key = optional(string, "")<br> # Define the ssh `certificate` file path, issued to the SDC login user<br> certificate = optional(string, "")<br> password = optional(string)<br> })</pre> | n/a | yes |
| <a name="input_scini"></a> [scini](#input\_scini) | The SCINI module package related variables. | <pre>object({<br> # The URL where the SCINI module package is located.<br> url = optional(string)<br> # specify distro where SDC will be deployed eg. RHEL, Ubuntu, SLES etc. as case sensitive<br> linux_distro = string<br> #allow to build scini on destination machine. This may not work on PowerFlex v3.X. Prerequisites here https://www.dell.com/support/kbdoc/en-us/000224134/how-to-on-demand-compilation-of-the-powerflex-sdc-driver <br> autobuild_scini = optional(bool, false)<br> })</pre> | n/a | yes |
| <a name="input_scini"></a> [scini](#input\_scini) | The SCINI module package related variables. | <pre>object({<br> # The URL where the SCINI module package is located. Ignored if autobuild_scini is true.<br> url = optional(string)<br> # specify distro where SDC will be deployed eg. RHEL9, Ubuntu etc. as case sensitive<br> linux_distro = string<br> #allow to build scini on destination machine. This may not work on PowerFlex v3.X. Prerequisites here https://www.dell.com/support/kbdoc/en-us/000224134/how-to-on-demand-compilation-of-the-powerflex-sdc-driver <br> autobuild_scini = optional(bool, false)<br> })</pre> | n/a | yes |
| <a name="input_sdc_pkg"></a> [sdc\_pkg](#input\_sdc\_pkg) | configuration for SDC package like url to download package from, copy as local package or directory on remote server. One of local\_dir or remote\_dir will be used based on the variable use\_remote\_path | <pre>object({<br> # examples "http://example.com/EMC-ScaleIO-sdc-3.6-700.103.Ubuntu.22.04.x86_64.tar", "ftp://username:password@ftpserver/path/to/file"<br> url = optional(string)<br> #the name of the SDC package for local.<br> pkg_name = optional(string)<br> #the name of the SDC package for remote machine. It should be emc-sdc-package.(tar/rpm)<br> remote_pkg_name = optional(string)<br> #local directory where the SDC package will be downloaded.<br> local_dir = optional(string)<br> #remote directory where the SDC package will be downloaded. (if use_remote_path is true)<br> remote_dir = optional(string, "/tmp")<br> # use the SDC package on remote machine path (where SDC is deployed)<br> use_remote_path = bool<br> # if SDC package is available in local directory, download can be skipped by setting to true<br> skip_download_sdc = optional(bool, false)<br> })</pre> | n/a | yes |
| <a name="input_versions"></a> [versions](#input\_versions) | n/a | <pre>object({<br> pflex = string<br> kernel = string<br> })</pre> | n/a | yes |

Expand Down
9 changes: 5 additions & 4 deletions modules/sdc_host_linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ resource terraform_data sdc_pkg_remote {
# # STEP 3 - install pre-requisites (scini module)
# # provisioner to install scini module on SDC
resource "terraform_data" "linux_scini" {
count = ( var.scini.linux_distro == "RHEL" || var.scini.autobuild_scini) ? 0 : 1
count = var.scini.autobuild_scini ? 0 : 1
connection {
type = "ssh"
user = self.output.user.name
Expand All @@ -177,12 +177,13 @@ resource "terraform_data" "linux_scini" {
}
ip = var.ip
scini_url = var.scini.url
distro = var.scini.linux_distro
}

provisioner "remote-exec" {
inline = [
"mkdir -p /bin/emc/scaleio/scini_sync/driver_cache/Ubuntu/${local.pflex_v}/${local.kernel_v}",
"wget ${self.output.scini_url}/scini.ko -P /bin/emc/scaleio/scini_sync/driver_cache/Ubuntu/${local.pflex_v}/${local.kernel_v}",
"mkdir -p /bin/emc/scaleio/scini_sync/driver_cache/${self.output.distro}/${local.pflex_v}/${local.kernel_v}",
"wget ${self.output.scini_url}/scini.ko -P /bin/emc/scaleio/scini_sync/driver_cache/${self.output.distro}/${local.pflex_v}/${local.kernel_v}",
]
}
provisioner "remote-exec" {
Expand All @@ -196,7 +197,7 @@ resource "terraform_data" "linux_scini" {
# # provisioner to install scini module on SDC
resource "terraform_data" "linux_scini_auto" {
# Execute when autobuild flag is set and if it is not RHEL
count = ( var.scini.linux_distro != "RHEL" && var.scini.autobuild_scini) ? 1 : 0
count = var.scini.autobuild_scini ? 1 : 0
connection {
type = "ssh"
user = self.output.user.name
Expand Down
4 changes: 2 additions & 2 deletions modules/sdc_host_linux/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ variable "scini" {

description = "The SCINI module package related variables."
type = object({
# The URL where the SCINI module package is located.
# The URL where the SCINI module package is located. Ignored if autobuild_scini is true.
url = optional(string)
# specify distro where SDC will be deployed eg. RHEL, Ubuntu, SLES etc. as case sensitive
# specify distro where SDC will be deployed eg. RHEL9, Ubuntu etc. as case sensitive
linux_distro = string
#allow to build scini on destination machine. This may not work on PowerFlex v3.X. Prerequisites here https://www.dell.com/support/kbdoc/en-us/000224134/how-to-on-demand-compilation-of-the-powerflex-sdc-driver
autobuild_scini = optional(bool, false)
Expand Down

0 comments on commit 77a22c6

Please sign in to comment.