The purpose of this playbook is to provided an automated fashion to create, mount, and boot your OpenShift cluster nodes with the Discovery ISO image. Once the image is mounted, refer to your Assisted Installer UI to provide the API VIP and Ingress VIP prior to deployment.
-
Assisted Installer UI exists and is reachable via http://REMOTE_SERVICE_URL:6008
-
The assisted_installer node used by the playbook must be able to
ping
the OpenShift cluster nodes
-
DELL servers with iDRAC9 using redfish
-
DELL servers with iDRAC8 and below using racadm
-
HPE servers
-
VMs
-
Systems with an existing OS with
ssh
access
-
inventory
- contains the file hosts.sample that:-
contains all the modifiable variables, their default values, and their definition.
-
the setting up of your provision node, master nodes, and worker nodes. Each section will require additional details (i.e. Management credentials).
-
-
collections
- contains the Ansible collection hosting the multiple roles (setup_repository
,create_iso
,host_iso
,boot_iso
)-
setup_repository
- sets up this existing repository on the system where the ISO be created -
create_iso
- creates the discovery ISO image -
host_iso
- creates a podman container running a webserver to host the ISO image -
boot_iso
- boots the ISO on the physical nodes via virtual media (no OS on system) -
boot_iso_existing_os
- boots the ISO on physical or virtual nodes viakexec
usingssh
access to the existing operating system
-
.
├── ansible.cfg
├── collections
│ └── ansible_collections
│ └── okd
│ └── assisted_installer
│ ├── docs
│ ├── galaxy.yml
│ ├── plugins
│ │ └── README.md
│ ├── README.md
│ └── roles
│ ├── boot_iso
│ │ ├── defaults
│ │ │ └── main.yml
│ │ ├── files
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── meta
│ │ │ └── main.yml
│ │ ├── README.md
│ │ ├── tasks
│ │ │ ├── boot_iso.yml
│ │ │ ├── boot_iso.yml.orig
│ │ │ └── main.yml
│ │ ├── templates
│ │ ├── tests
│ │ │ ├── inventory
│ │ │ └── test.yml
│ │ └── vars
│ │ └── main.yml
│ ├── boot_iso_existing_os
│ │ ├── defaults
│ │ │ └── main.yml
│ │ ├── files
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── meta
│ │ │ └── main.yml
│ │ ├── README.md
│ │ ├── tasks
│ │ │ ├── main.yml
│ │ ├── templates
│ │ ├── tests
│ │ │ ├── inventory
│ │ │ └── test.yml
│ │ └── vars
│ │ └── main.yml
│ ├── create_iso
│ │ ├── defaults
│ │ │ └── main.yml
│ │ ├── files
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── meta
│ │ │ └── main.yml
│ │ ├── README.md
│ │ ├── tasks
│ │ │ └── main.yml
│ │ ├── templates
│ │ ├── tests
│ │ │ ├── inventory
│ │ │ └── test.yml
│ │ └── vars
│ │ └── main.yml
│ ├── host_iso
│ │ ├── defaults
│ │ │ └── main.yml
│ │ ├── files
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── library
│ │ │ └── podman_container.py
│ │ ├── meta
│ │ │ └── main.yml
│ │ ├── README.md
│ │ ├── tasks
│ │ │ └── main.yml
│ │ ├── templates
│ │ ├── tests
│ │ │ ├── inventory
│ │ │ └── test.yml
│ │ └── vars
│ │ └── main.yml
│ ├── setup_repository
│ │ ├── defaults
│ │ │ └── main.yml
│ │ ├── files
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── meta
│ │ │ └── main.yml
│ │ ├── README.md
│ │ ├── tasks
│ │ │ └── main.yml
│ │ ├── templates
│ │ ├── tests
│ │ │ ├── inventory
│ │ │ └── test.yml
│ │ └── vars
│ │ └── main.yml
│ └── validations
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── README.md
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
├── inventory
│ ├── hosts_with_os.sample
│ └── hosts_without_os.sample
├── playbook_assisted_installer_with_os.yml
├── playbook_assisted_installer_without_os.yml
├── pull_secret.txt
├── README.adoc
└── requirements.yml
The following are the steps to successfully run the Ansible playbook.
The first step to using the Ansible playbook is to clone the assisted-test-infra repository.
Note
|
This should be done on a system that can access the provision host |
-
Clone the
git
repository[user@laptop ~]$ git clone https://github.com/openshift/assisted-test-infra
NoteEnsure git
is installed on your localhost -
Change to the
ansible-bm-install
directory[user@laptop ~]$ cd /path/to/git/repo/assisted-test-infra/ansible-bm-install
While the ansible.cfg
may vary upon your environment
a sample is provided in the repository.
[defaults]
inventory=./inventory
collections_paths=./collections
remote_user=root
callback_whitelist = profile_tasks
[privilege_escalation]
become_method=sudo
Note
|
Ensure to change the |
Note
|
This example inventory is for systems with no operating system and require BMC credentials to boot into the ISO. |
The hosts file provides all the definable variables and provides a description of each variable.
The hosts file ensures all your nodes that will be used to create, mount and boot the discovery ISO are setup. There are three groups: masters
, workers
,
assisted_installer
. The masters
and
workers
group collects information about the host such as its name,
role, user management (i.e. iDRAC) user, user management (i.e. iDRAC)
password, bmc_address
.
Below is a sample of the inventory/hosts file
[all:vars]
###############################################################################
# Required configuration variables for Assisted Install Installations #
###############################################################################
# Base domain, i.e. example.com
domain="example.com"
# Name of the cluster, i.e. openshift
cluster_name="openshift"
# Contents of the pull-secret.txt file
pull_secret="{{ lookup('file', './pull_secret.txt') }}"
# Provide Remote Service URL and port
#e.g. remote_service_url="http://example.com:6000
remote_service_url=""
# Version of the openshift-installer, undefined or empty results in the playbook failing.
openshift_version="4.5"
[assisted_installer]
assisted-installer.example.com
#Options for vendor include: Dell, HPE
# Master nodes
[masters]
master-0 role=master bmc_user=admin bmc_password=password bmc_address=192.168.1.1 vendor=Dell
master-1 role=master bmc_user=admin bmc_password=password bmc_address=192.168.1.2 vendor=Dell
master-2 role=master bmc_user=admin bmc_password=password bmc_address=192.168.1.3 vendor=Dell
# Worker nodes
[workers]
worker-0 role=worker bmc_user=admin bmc_password=password bmc_address=192.168.1.4 vendor=HPE
worker-1 role=worker bmc_user=admin bmc_password=password bmc_address=192.168.1.5 vendor=HPE
Note
|
===
vendor value of Dell or HPE is used to determine on the OpenShift node should be booted.
===
|
Note
|
This example inventory is for systems with an operating system and requires IP addresses of the master and worker nodes.
|
The hosts file provides all the definable variables and provides a description of each variable.
The hosts file ensures all your nodes that will be used to create, mount and boot the discovery ISO are setup. There are three groups: masters
, workers
,
assisted_installer
.
Below is a sample of the inventory/hosts_with_os file
[all:vars]
###############################################################################
# Required configuration variables for Assisted Install Installations #
###############################################################################
# Base domain, i.e. example.com
domain="example.com"
# Name of the cluster, i.e. openshift
cluster_name="openshift"
# Contents of the pull-secret.txt file
pull_secret="{{ lookup('file', './pull_secret.txt') }}"
# Provide Remote Service URL and port
#e.g. remote_service_url="http://example.com:6000
remote_service_url=""
# Version of the openshift-installer, undefined or empty results in the playbook failing.
openshift_version="4.5"
[assisted_installer]
assisted-installer.example.com
# Master nodes (<master-name>.<cluster-name>.<domain>)
[masters]
master-0.openshift.example.com
master-1.openshift.example.com
master-2.openshift.example.com
# Worker nodes (<worker-name>.<cluster-name>.<domain>)
[workers]
worker-0.openshift.example.com
worker-1.openshift.example.com
worker-2.openshift.example.com
With the ansible.cfg
file in place, the next step is
to ensure to copy your public ssh
key to your assisted installer
node using ssh-copy-id
.
From the system that is to run the playbook,
$ ssh-copy-id <user>@assisted_installer.example.com
The Ansible playbook connects to your assisted installer host and
runs through the roles.
No modification is necessary. All modifications of variables
may be done within the inventory/hosts_with_os
or inventory/hosts_without_os
file. A sample file
is located in this repository under inventory/hosts_with_os.sample
and inventory/hosts_without_os.sample
.
From the system that is to run the playbook,
playbook_assisted_installer_without_os.yml
---
- name: Creating,Mounting,Booting the Assisted Installer Discovery ISO
hosts: assisted_installer
roles:
- okd.assisted_installer.validations
- okd.assisted_installer.setup_repository
- okd.assisted_installer.create_iso
- okd.assisted_installer.host_iso
- okd.assisted_installer.boot_iso
playbook_assisted_installer_with_os.yml
---
- name: Creating,Hosting the Assisted Installer Discovery ISO
hosts: assisted_installer
roles:
- okd.assisted_installer.validations
- okd.assisted_installer.setup_repository
- okd.assisted_installer.create_iso
- okd.assisted_installer.host_iso
- name: Mounting, Booting the Assited Installer Discovery ISO
hosts: masters:workers
roles:
- okd.assisted_installer.boot_iso_existing_os
With each playbook in-place, install the required collections and run the appropriate playbook for your environment.
playbook_assisted_installer_without_os.yml
$ ansible-galaxy collection install -r requirements.yml
$ ansible-playbook -i inventory/hosts_without_os playbook_assisted_installer_without_os.yml
playbook_assisted_installer_with_os.yml
$ ansible-galaxy collection install -r requirements.yml
$ ansible-playbook -i inventory/hosts_with_os playbook_assisted_installer_with_os.yml