The playbooks in this project can be used as a baseline for deploying a vast majority of Red Hat's product portfolio in a defined manner. The playbooks were originally built out to deploy on a set of field kits used by Red Hat North American Public Sector Solutions Architects.
The playbooks are setup in a way to be utilized in a standalone fashion for each function or for deploying a complete Red Hat Cloud Suite infrastructure.
Currently the provisioning of utility resources happens on a main RHEL+KVM host for deployment. After that either Red Hat OpenStack Platform or Red Hat Virtualization should be deployed. Once the chosen infrastructure is up and running, the remaining resources are provisioned on top. The provisioning mechanisms could be replaced with another infrastructure provider like VMware or Public Clouds.
All required variables are in vars/vars.example.yml. If you need to customize further, you'll have to dig into the roles to see all the available vars to override.
We've attempted to make this setup very flexible. However, if you believe there is a better way, please contribute.
You need to configure an Ansible host to execute these playbooks
NOTE: If you intend on running these playbooks from a RHEL 7 system, you need the system subscribed and have the following repos enabled:
- rhel-7-server-rpms
- rhel-7-server-extras-rpms
- rhel-7-server-optional-rpms
- rhel-7-server-ansible-2.9-rpms
For RHEL 8 machines, you need the following repos enabled
- rhel-8-for-x86_64-baseos-rpms
- rhel-8-for-x86_64-appstream-rpms
- ansible-2.9-for-rhel-8-x86_64-rpms
NOTE: CentOS 7 is not currently supported as the Ansible host because we are using python 3.6 and CentOS 7 does not currently have an rpm available for libselinux-python3. Because RHEL 7.7 has this package in beta, we expect CentOS will have this package available in the near future.
You can do this manually, or you can use the provided playbook
-
Install Ansible on your target Ansible host
-
Download the playbook from the hattrick repo
$ curl https://raw.githubusercontent.com/RedHatGov/hattrick/master/playbooks/hattrick/ansible-host-setup.yml -o ansible-host-setup.yml
- Run the playbook
$ ansible-playbook ansible-host-setup.yml
NOTE: The playbook automatically clones the hattrick repo and places it in a folder named hattrick in the current working directory
- Modify your vars file
$ cd hattrick/
$ vi vars/vars.yml
NOTE: The vars example file only exposes the variables you must care about. If you need to dig deeper you'll have to dig into the roles.
Before you run any of the following playbooks, you need to enter the pipenv shell that was created for you during the ansible-host-setup playbook.
$ cd hattrick/
$ pipenv shell
- Follow the instructions to create a bootable custom ISO to install the base operating system for what will become the initial RHEL+KVM utility server
- Verify your networking is the way you expect. We recommend two bridges for the VMs. br1 for the external network and br2 for the provisioning network
- Run the kvm playbook from the ht directory
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/kvm.yml
- Follow the instructions above for Cloning and configuring the repository
- Run the IdM playbook
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/idm.yml
NOTE: If you need to teardown the IdM vm, run the following playbook. This will destroy and undefine the VM that was created.
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/kvm-teardown.yml --extra-vars "kvm_vm_name=idm"
- Follow the instructions above for Cloning and configuring the repository
- Run the content playbook
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/content.yml
NOTE: If you need to teardown the content server vm, run the following playbook. This will destroy and undefine the VM that was created.
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/kvm-teardown.yml --extra-vars "kvm_vm_name=content"
- Run the Director playbook
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/director.yml
NOTE: If you need to teardown the Director vm, run the following playbook. This will destroy and undefine the VM that was created.
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/kvm-teardown.yml --extra-vars "kvm_vm_name=director"
NOTE: The overcloud deployment templates stored in this repo have been built to deploy on our Project Hat Trick hardware kits. If you are deploying against different hardware, you will likely need to modify the templates which are stored in the overcloud role inside playbooks/roles/
- Run the overcloud playbook
$ ansible-playbook -i inventory/inventory.yml -e @vars/vars.yml playbooks/hattrick/overcloud.yml
The remainder of this readme will be completed as the capabilities come into the repo