forked from redhatci/ansible-collection-redhatci-ocp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding sushy tools to the ocp-on-libvirt solution
Currently ocp-on-libvirt installs the conserver service along with the VMs to allow for IPMI remote management of the hosts, which in turn allows for PXE image boot up. In order to support ZTP deployments, virtual media image boot up is needed, and to manage it remotely, the target server BMCs must suport the redfish protocol. Sushy tools provides support for the redfish protocol for libvirt VMs. This change installs sushy tools, as implemented in the assisted-installer ansible project, when running the ocp-on-libvirt role. Depends-On: dci-labs/bos2-ci-config#72 Depends-On: openshift-kni/baremetal-deploy#975 Depends-On: redhat-partner-solutions/crucible#272 Test-Args-Hints: -e enable_redfish=true -e enable_virtualmedia=true
- Loading branch information
Showing
5 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
--- | ||
libvirt_image_path: /var/lib/libvirt/images | ||
bootmode: uefi | ||
enable_conserver: false | ||
enable_legacy_vga_mode: false | ||
do_dns_config: true | ||
apps_ip_address: 192.168.123.10 | ||
api_ip_address: 192.168.123.5 | ||
dns_vip_address: 192.168.123.6 | ||
|
||
# REDFISH | ||
enable_redfish: false | ||
enable_virtualmedia: false | ||
redfish_cache_dir: /var/lib/dci-openshift-agent | ||
redfish_assisted_deploy_repo: https://github.com/redhat-partner-solutions/crucible.git | ||
redfish_assisted_deploy_version: 92864fc8be3f83a80666d3c1e98d1740f17dfc30 | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
- name: "Get Ansible roles path" | ||
shell: "set -o pipefail && ansible-config dump|grep DEFAULT_ROLES_PATH|sed -e 's/.*=\\s*//'" | ||
register: roles_path_cmd | ||
delegate_to: localhost | ||
|
||
- name: "Set roles_path" | ||
set_fact: | ||
roles_path: "{{ roles_path_cmd.stdout }}" | ||
|
||
- name: "Clone/update assisted-deploy repo" | ||
vars: | ||
git_repo: "{{ redfish_assisted_deploy_repo }}" | ||
git_ref: "{{ redfish_assisted_deploy_version }}" | ||
git: | ||
version: "{{ git_ref }}" | ||
repo: "{{ git_repo }}" | ||
dest: "{{ redfish_cache_dir }}/assisted_deploy_repo" | ||
#force: true | ||
# On RHEL8 git clone can sporadically fail with OpenSSL SSL_read: | ||
# SSL_ERROR_SYSCALL, errno 104. | ||
delegate_to: localhost | ||
register: git_clone | ||
retries: 3 | ||
delay: 10 | ||
until: not git_clone.failed | ||
when: | ||
- "redfish_cache_dir + '/assisted_deploy_repo/roles' in roles_path" | ||
tags: | ||
- clone_upstream_repos | ||
|
||
- name: Install sushy-tools | ||
vars: | ||
repo_root_path: "{{ playbook_dir | dirname }}" | ||
cert_country: US | ||
cert_state: MA | ||
cert_locality: Westford | ||
cert_organization: DCI | ||
cert_organizational_unit: Lab | ||
sushy_ignore_boot_device: false | ||
include_role: | ||
name: setup_sushy_tools | ||
|
||
- name: Get KVM hosts UUID | ||
shell: > | ||
virsh list --all --name --uuid | | ||
sed -e 's/^\([^ ]*\) \([^ ]*\)$/"\2": "\1",/g' | | ||
tr -d '\n' | | ||
sed -e 's/^\(.*\),$/{\1}/g' | ||
register: all_vms | ||
become: yes | ||
|
||
- name: Store KVM hosts UUID | ||
set_fact: | ||
redfish_kvm_uuid: "{{ all_vms.stdout | from_json }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters