Skip to content

ibm-client-engineering/terraform-artifactory-vmware

Repository files navigation

Terraform Artifactory VMware Deployment

This repository provides Terraform configurations to deploy Artifactory on a VMware vSphere environment.

Requirements

Before deploying, ensure you have:

  • Terraform - Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files.
  • Access to a VMware vSphere environment with the proper authorization to create VMs.
  • DNS entry for artifactory.gym.lan pointing to the deployed VM's IP address (e.g., 192.168.252.8).

IBM TechZone Access to vSphere

If you are an IBMer or Business Parter, you can request access to vSphere through IBM TechZone.

VMware on IBM Cloud Environments

Select Request vCenter access (OCP Gym)


Pre flight checklist

🛠️ Preparing a RHEL 9 Template for Terraform on vSphere

An existing RHEL VM template needs to be created. See the Packer RHEL 8 & 9 for VMware vSphere project for instructions on building a VM template in vSphere.

Install Terraform

💡 Tip: If you're connecting to vSphere through a WireGuard VPN, you might experience timeouts or connectivity issues.
In such cases, consider running your Terraform commands from a bastion host that resides within the same network or environment as vSphere.
This can help avoid VPN-related latency or firewall restrictions that interfere with the connection.

To install Terraform from a RHEL 8 bastion host, follow these steps:


Open a terminal and run:

sudo yum install -y yum-utils git bind-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum install -y terraform

Check the installed version:

terraform -version

Configure Networking

Required Static IPs

There is 1 static IP addresses that is needed.

💡 Important: The subnet is controlled by the subnet_cidr value in the variables, default is 192.168.252.0/24.

Hostname IP FQDN
artifactory 192.168.252.8 artifactory.gym.lan

The example table above assumes the base_domain is set to gym.lan, no common_prefix is set and default subnet_cidr is being used.

🛠️ How to Set Static IPs in pfSense

  1. Log in to pfSense via the web UI (usually at https://192.168.252.1).
  2. Navigate to:
    ServicesDNS Forwarder.
  3. Scroll down to Host Overrides.
  4. For each device:
    • Click Add.
    • Set the IP address (from the table above).
    • Set the Hostname (e.g., artifactory).
    • Set the Domain to gym.lan (or appropriate base domain) to form the FQDN.
    • Click Save.
  5. Click Apply Changes at the top of the page.

🔁 Verifying DNS Resolution

To ensure the FQDNs resolve correctly:

  • Test resolution using:
nslookup artifactory.gym.lan

Clone the repository

Clone this repository to your local workstation. This will allow you to configure and run terraform.

1. Install Required Packages

Open a terminal and run:

sudo dnf install -y git bind-utils

2. Clone the repo

Now clone this repo:

git clone github.com/ibm-client-engineering/terraform-artifactory-vmware.git
cd terraform-artifactory-vmware

Define Terraform variables

There is a file called terraform.tfvars.example. Copy this file to terraform.tfvars and set variables here according to your needs.

Deploy

We are now ready to deploy our infrastructure. First, we initialize the providers.

terraform init

Now we ask terraform to plan the execution with (this step is optional):

terraform plan

Now we can deploy our resources with:

terraform apply

Accessing Artifactory

  • Default Username: admin
  • Auto-generated Password: To retrieve the password, run:
    terraform output -raw artifactory_password && echo
  • Base URL: https://artifactory.gym.lan:8443

Troubleshooting

If you see the "Artifactory is starting up" page, it indicates the web server is running but there's an issue with the Artifactory application itself. Check the following:

  • Ensure the PostgreSQL database is running and accessible.
  • Verify that disk space is not at 100% utilization.

Important Notes

  • The default daily/weekly backups are disabled during the first startup.

Destroy

To destroy all resources, run the following command.

terraform destroy -auto-approve

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published