Skip to main content

Uniphore Customer Portal

Working with Ansible Code

After cloning the ansible code from the Release package, perform the below steps:

  1. Navigate to infra/terraform/environments.

  2. Add the default SSH key to /default-user-data.yaml.

    image4.png

    Important

    Without adding the SSH key, you cannot execute Terraform.

    cd ~/infra/terraform/environments/dev
    
    vi main.tf
    
  3. If you want to create a bucket, then add the below code block to the main.tf and change the bucket name accordingly. Ensure that bucket name is unique.

    resource "aws_s3_bucket"
    "global_unique_bucket_name" {
    
    bucket = "global_unique_bucket_name"
    
    versioning {
    
    enabled = true
    

    Note

    If you have a bucket created already, then no need of adding the code block.

  4. Modify the bucket name, key, and Security Group.

    image5.png
    image6.png
  5. Add Cluster Number and Instance Type in the Module.

  6. Change the name and cluster size details as required.

  7. Edit or update the variables in the Makefile (TF_VAR_region and TF_VAR_username) as per the requirement.

    image7.png
  8. Ensure that the parameter “backend-config=key=” contains $(TF_VAR_username) and other required variables (refer to the above step).

    image8.png
  9. Remove .terraform from ~/infra/terraform/envrionment/dev/ (if exists).

    cd ~/infra/terraform/envrionment/dev/
  10. Run makeinit from ~/infra/terraform/envrionment/dev.

  11. Run makeplan from ~/infra/terraform/envrionment/dev.

    Note

    Ensure that there are no instances getting destroyed. If any instance is destroyed, modify the main.tf file and add respective cluster name details.

    image9.tmp

    ~/infra/terraform/envrionment/dev/make apply

    image10.tmp

    Important

    Before proceeding with makeapply, ensure that no existing environment is destroyed. If any such messages arise, add all the instance details to main.tf file.