This Ansible playbook is used to install OpenShift on Terraform supported providers. Out of the box this playbook will create a three node OpenShift cluster with a Master and two OpenShift nodes on Amazon EC2 instances in the AWS cloud. Future versions of this playbook will enable more providers. This playbook can be modified to increase the number of nodes in the cluster if so desired.
After checking out this repository, search for the string "INSERT_VALUES_HERE" through out the files and replace that string with the appropriate values for the field. The files and fields that need this change are listed below.
- Terraform (v0.8.5)
- Ansible (v2.2.1.0)
- Red Hat Customer Portal Activation Key
- Red Hat Cloud Access (optional)
- AWS Command Line Interface
- Domain purchased through AWS and managed by Route53
- TBD
- TBD
The following variables must be set before usage.
default_domain: "${INSERT_VALUE_HERE}"
default_user: "${INSERT_VALUE_HERE}"
aws_access_key_id: "${INSERT_VALUE_HERE}"
aws_secret_access_key: "${INSERT_VALUE_HERE}"
aws_route53_zone_id: "${INSERT_VALUE_HERE}"
The aws_route53_zone_id
value can be found using the following command:
aws route53 list-hosted-zones --query 'HostedZones[*]' --output text | \ grep '\/hostedzone\/.*${INSERT_VALUE_HERE}' | sed -e 's/.*\///' -e 's/[^a-zA-Z0-9].*//'
Make sure to replace ${INSERT_VALUE_HERE}
with the domain purchased through AWS and managed by Route53.
rhel_rhsm_activationkey: "${INSERT_VALUE_HERE}"
rhel_rhsm_org_id: "${INSERT_VALUE_HERE}"
openshift_cluster_admin_username: "${INSERT_VALUE_HERE}"
openshift_cluster_admin_password: "${INSERT_VALUE_HERE}"
!Important These variables must be updated manually, based on vault_default_subdomain
value from group_vars/all/vault.yml
file.
master.{{ default_subdomain }}
node.[0:1].{{ default_subdomain }}
[NOTE]: The value [0:1]
is a pattern that declares how many OpenShift nodes to create. In this case it will create node0
and node1
.
!Important You must encrypt your group_vars/all/vault.yml before running your playbook. You must add a vault_pass.txt to your home directory containing your password.
ansible-vault encrypt group_vars/all/vault.yml
You will be prompted to create a password and once complete, you can put this password is a file referenced in the ansible.cfg (vault_password_file = ~/.vault_pass.txt) file. The current entry has a location of ~/.vault_pass.txt but you can chnage this at your discretion.
ansible-playbook -i inventory site.yml
[NOTE]: This hidden directory contains the key pair for SSH access to instantiated host systems.
cd $(pwd)/.{{ default_domain }}
terraform destroy