diff --git a/README.md b/README.md index 7e6c662..7e3f9dc 100644 --- a/README.md +++ b/README.md @@ -107,4 +107,32 @@ A virtual machine or virtual machine scale set. | [virtual\_machine\_id](#input\_virtual\_machine\_id) | Virtual machine resource id. | `string` | `null` | no | | [virtual\_machine\_scale\_set\_id](#input\_virtual\_machine\_scale\_set\_id) | Virtual machine scale set resource id. | `string` | `null` | no | | [virtual\_machine\_type](#input\_virtual\_machine\_type) | vm or vmss. | `string` | n/a | yes | - \ No newline at end of file + + +## Redhat ELS for RHEL 7.* +This README provides instructions for logging into Redhat ELS, checking the Subscription Manager and Insights-client, and other relevant details. + +## Logging into Redhat +To log into Redhat, use the following credentials stored in the Key Vault (KV): + +Username: lss-sre@hmcts.net +Password: https://portal.azure.com/#@HMCTS.NET/asset/Microsoft_Azure_KeyVault/Secret/https://acmedcdcnpdev.vault.azure.net/secrets/redhat-portal/cd61d615bffe415f8dd6c1907df3115b + + +## Certificate Information +The certificate is placed under the following directory: +/etc/pki/product/204.pem + +## Checking Subscription Manager and Insights-client Installation +Ensure that both the Subscription Manager and Insights-client are installed correctly and show an active status. + +## Inventory Check +You can verify the status of both Subscription Manager and Insights-client by visiting the following inventory link: + +https://console.redhat.com/insights/inventory + +Both Subscription Manager and Insights-client should display an active status. + +Documentation links - https://tools.hmcts.net/confluence/display/~thomas.thornton/RHEL+7+ELS+Support + +For more detailed documentation, please refer to the RHEL 7 ELS Support Documentation. \ No newline at end of file diff --git a/scripts/bootstrap_vm.sh b/scripts/bootstrap_vm.sh index 3ead099..84b9efb 100644 --- a/scripts/bootstrap_vm.sh +++ b/scripts/bootstrap_vm.sh @@ -188,3 +188,34 @@ if [ "${NESSUS_INSTALL}" = "true" ] then install_nessus "${NESSUS_SERVER}" "${NESSUS_KEY}" "${NESSUS_GROUPS}" fi + +# Change the permission and ownership of this file. +restorecon -Rv /etc/pki/product +chown root.root /etc/pki/product/204.pem +chmod 644 /etc/pki/product/204.pem +rct cat-cert /etc/pki/product/204.pem + +# Check if the OS is RHEL 7 +if [[ "$OS_TYPE" == *"Red Hat Enterprise"* && "$OS_TYPE" == *"7."* ]]; then + echo "This is Red Hat Enterprise Linux 7." + + # Register the system and attach a subscription pool + subscription-manager register --org=7324337 --activationkey=Rhel-els + + + # Refresh subscription-manager and verify identity + subscription-manager refresh + subscription-manager identity + + # Install insights-client and register it + yum install -y insights-client + insights-client --register + + # Enable repositories + subscription-manager config --rhsm.manage_repos=1 + subscription-manager repos --enable rhel-7-server-els-rpms + + echo "Configuration completed successfully." +else + echo "This script is intended for Red Hat Enterprise Linux 7 only." +fi \ No newline at end of file diff --git a/variables.tf b/variables.tf index 443a90a..8d3ee30 100644 --- a/variables.tf +++ b/variables.tf @@ -316,3 +316,4 @@ variable "soc_vault_name" { type = string default = "soc-prod" } +