Use Ansible to deploy Red Hat CodeReady Containers with HACKS
CodeReady Containers brings a minimal, preconfigured OpenShift 4.1 or newer cluster to your local laptop or desktop computer for development and testing purposes. CodeReady Containers is delivered as a Red Hat Enterprise Linux virtual machine that supports native hypervisors for Linux, macOS, and Windows 10.
- Ansible
- Fedora or RHEL 8.x
- IF using RHEL make sure it is registered
- OpenShift CodeReady WorkSpaces pull secret
- Anisble post fix module
ansible-galaxy collection install ansible.posix
Accessing CodeReady Containers on a Remote Server by Jason Dobies
Overview: running crc on a remote server by Trevor McKay
Deploy Bare-Metal Clusters with CRC by Brandon B. Jozsa
- CodeReady Containers Remote Server Access
- CodeReady Containers on local host
Type | Description | Default Value |
---|---|---|
crc_version | Target CRC version | latest |
crc_url | CRC download URL | https://mirror.openshift.com/pub/openshift-v4/clients/crc/ |
crc_file_name | CRC filename | crc-linux-amd64.tar.xz |
use_all_in_one_haproxy | Use current machine as haproxy LB | true |
haproxy_ip | Set ha proxy ip if above is set to flase NOT TESTED | "" |
log_level | Change log level of crc start command | info |
crc_ip_address | Default CRC ip address | 192.168.130.11 |
ocp4_release | OCP release folder for cli | latest |
ocp4_version | OCP cli version | latest |
ocp4_release_url | OCP release url | "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ ocp4_release }}/" |
ocp4_client | OCP cli filename | "openshift-client-linux-{{ ocp4_version }}.tar.gz" |
remove_oc_tool | remove oc cli | false |
delete_crc_deployment | delete CodeReady Containers deployment | false |
forward_server | Server to manage external requests | 1.1.1.1 |
- Register system
- Follow system requirements from the code ready containers documentation
- Follow system requirements from the code ready containers documentation
- enable and start sshd
Download pull-secret to your Downloads folder here. Ansible will look for it in ~/Downloads/pull-secret or change the pull secret variable "{{ pull_secret_path }}"
You can use any of these flags individually to run just that part of the playbook.
- download_crc
- extract_crc
- configure_oc_cli
- setup_crc
- start_crc_deployment
- configure_ha_proxy
ansible-playbook localhost.yml --tags download_crc,extract_crc,configure_oc_cli,setup_crc,start_crc_deployment
ansible-playbook localhost.yml --tags get_codeready_info
ansible-playbook localhost.yml --extra-vars "delete_crc_deployment=true"
GPL-3.0