This guide uses Ansible to prepare installer hosts and execute openshift-install in a reproducible way.
install-config.yaml- name: Run OpenShift installer workflow
hosts: openshift_installer
become: true
vars:
ocp_install_dir: /opt/openshift-install
tasks:
- name: Install utility packages
ansible.builtin.package:
name:
- tar
- curl
- jq
state: present
- name: Ensure install directory exists
ansible.builtin.file:
path: "{{ ocp_install_dir }}"
state: directory
mode: "0755"
- name: Copy install-config
ansible.builtin.copy:
src: files/install-config.yaml
dest: "{{ ocp_install_dir }}/install-config.yaml"
mode: "0600"
- name: Create manifests
ansible.builtin.command: openshift-install create manifests
args:
chdir: "{{ ocp_install_dir }}"
- name: Create cluster
ansible.builtin.command: openshift-install create cluster --log-level=info
args:
chdir: "{{ ocp_install_dir }}"
ansible-playbook -i inventory.ini openshift-install.yml