Introduction
TFE application is being installed in an automated way using Terraform code and leveraging the GCP provider for creating a Redhat OS on the server using a template.
Installing TFE using the Terraform GCP provider automation fails without any error and there are no containers running on the server.
Problem
The google_compute_instance resource is using the metadata_startup_script attribute to install TFE from a user data template.
The user data template is not executed on the server and TFE is not getting installed or any other pre-requisites.
Prerequisites (if applicable)
- Redhat on GCP
Cause
- The cloud-init process is not installed on the server that runs Redhat OS
Solution:
- Install the cloud-init on the Redhat server to execute the user data template
-
-
Install the cloud-init process on the server
-
dnf install cloud-init
-
- Enable the cloud-init process
systemctl enable cloud-init
-
- Start cloud-init
systemctl start cloud-init
Outcome
Installing cloud-init and starting it on the OS should pick up your user data template and install TFE.