Skip to content

Terraform code to deploy and configure an Ansible AWX node on IBM Cloud VPC

License

Notifications You must be signed in to change notification settings

cloud-design-dev/ibmcloud-vpc-awx

Repository files navigation

Deploy an AWX server on IBM Cloud VPC

Overview

Use this template to provision AWX on Virtual Private Cloud (VPC) Infrastructure in IBM Cloud by using [Terraform][] or IBM Clouds hosted Terraform solution, [Schematics][]. The AWX instance is automatically configured along with security groups so that it can be readily accessible after installation using your virtual server instance's floating IP address.

Prerequisites

If you are deploying this template via IBM Cloud Schematics, you can skip this section and move on to the deployment section.

Local Prerequisites

If you are running this code from your local machine, you will need to ensure you have the following software installed:

  • IBM Cloud API Key. See here for instructions on how to create one via the Portal.
  • Recent version of Terraform installed. This guide was tested on terraform 1.5.3.
  • (Optional) - tfswitch installed. The tfswitch utility allows you to run multiple versions of Terraform on the same system. If you do not have a particular version of terraform installed, tfswitch will download the version you select from an interactive menu.

tfswitch

Deployment

The Terraform performs the following deployment Steps

  • Provision VPC Infrastructure with one VSI
  • Deploy AWX on the provisioned VSI

The deployment of AWX on IBM Cloud VPC can be done in two ways

IBM Cloud Schematics

  • TODO - Add Schematics instructions
  • TODO - Add Schematics deploy button

Local Machine using Terraform CLI

With our local prerequisites installed, we can now deploy the AWX template. The following steps will walk you through the deployment process.

  1. Clone this repo and cd into the terraform-ibm-awx directory.

    git clone https://github.com/greyhoundforty/terraform-ibm-awx.git
    cd terraform-ibm-awx
  2. Copy the tfvars-example to terraform.tfvars file and update the values as needed. See the Required Variables section for .

    cp tfvars-example terraform.tfvars
  3. Initialize Terraform:

    terraform init -upgrade
  4. Run a Terraform plan:

    terraform plan -out default.tfplan 
  5. Run Terraform apply:

    terraform apply default.tfplan
  6. Once the apply completes, you will see the URL for the deployed AWX instance in the Terraform output:

    Apply complete! Resources: 13 added, 0 changed, 0 destroyed.
    
    Outputs:
    
    awx_access = "Access AWX via browser https://<your-floating-ip>"
    

Required Variables

Name Description Type
owner Owner declaration for resource tags. e.g. 'ryantiffany' string
project_prefix Represents a name of the VPC that awx will be deployed into. Resources associated with awx will be prepended with this name. string
region The region to create your VPC in, such as us-south. To get a list of all regions, run ibmcloud is regions. string

Output

Name Description
awx_access The AWX web server address

Destroying the deployed Infrastructure and AWX

On a Standalone machine using Terraform CLI

Using below command the deployed Infrastructure and AWX can be destroyed

terraform destroy

Using IBM Cloud Schematics

Select option Actions in the created workspace and choose Destroy Resources/Destroy workspace.

  • TODO - Add Schematics destroy button image/gif

Additional Resources

https://www.ibm.com/cloud/garage/tutorials/public-cloud-infrastructure

https://github.com/ibm-cloud-architecture/refarch-vsi-on-vpc

https://cloud.ibm.com/docs/tutorials?topic=solution-tutorials-strategies-for-resilient-applications

https://github.com/ansible/awx/blob/devel/INSTALL.md

https://github.com/Crazy450/terraform-aws-awx

https://cloud.ibm.com/docs/vpc-on-classic?topic=vpc-on-classic-about&locale=en

https://github.com/IBM-Cloud/vpc-tutorials

Costs

When you apply template, the infrastructure resources that you create incur charges as follows. To clean up the resources, you can delete your Schematics workspace or your instance. Removing the workspace or the instance cannot be undone. Make sure that you back up any data that you must keep before you start the deletion process.

  • VPC: VPC charges are incurred for the infrastructure resources within the VPC, as well as network traffic for internet data transfer. For more information, see Pricing for VPC.
  • VPC virtual servers: The price for your virtual server instances depends on the flavor of the instances, how many you provision, and how long the instances are run. For more information, see Pricing for Virtual Servers for VPC.

About

Terraform code to deploy and configure an Ansible AWX node on IBM Cloud VPC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published