This repository provides Terraform configurations to deploy Artifactory on a VMware vSphere environment.
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.lanpointing to the deployed VM's IP address (e.g.,192.168.252.8).
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)
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.
💡 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 -versionThere is 1 static IP addresses that is needed.
💡 Important: The subnet is controlled by the
subnet_cidrvalue in the variables, default is192.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.
- Log in to pfSense via the web UI (usually at
https://192.168.252.1). - Navigate to:
Services → DNS Forwarder. - Scroll down to Host Overrides.
- 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.
- Click Apply Changes at the top of the page.
To ensure the FQDNs resolve correctly:
- Test resolution using:
nslookup artifactory.gym.lanClone this repository to your local workstation. This will allow you to configure and run terraform.
Open a terminal and run:
sudo dnf install -y git bind-utilsNow clone this repo:
git clone github.com/ibm-client-engineering/terraform-artifactory-vmware.git
cd terraform-artifactory-vmware
There is a file called terraform.tfvars.example. Copy this file to terraform.tfvars and set variables here according to
your needs.
We are now ready to deploy our infrastructure. First, we initialize the providers.
terraform initNow we ask terraform to plan the execution with (this step is optional):
terraform planNow we can deploy our resources with:
terraform apply- Default Username:
admin - Auto-generated Password: To retrieve the password, run:
terraform output -raw artifactory_password && echo
- Base URL:
https://artifactory.gym.lan:8443
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.
- The default daily/weekly backups are disabled during the first startup.
To destroy all resources, run the following command.
terraform destroy -auto-approve