-
Notifications
You must be signed in to change notification settings - Fork 13
playbooks: Added Initial Ansible Playbooks #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,21 @@ | ||
# Intel Technology Enabling Ansible Playbooks | ||
|
||
## Overview | ||
This directory contains Ansible playbooks designed to automate the deployment and configuration of Intel technologies on Red Hat OpenShift clusters. These playbooks streamline the Intel feature provisioning and validation process on OpenShift environments. | ||
|
||
## Prerequisites | ||
Before running the playbook, ensure the following prerequisites are met: | ||
- Provisioned RHOCP Cluster | ||
- Red Hat Enterprise Linux (RHEL) system with [Ansible](https://docs.ansible.com/ansible/2.9/installation_guide/intro_installation.html#installing-ansible-on-rhel-centos-or-fedora) installed and configured with a `kubeconfig` to connect to your RHOCP cluster. | ||
|
||
## Run the Playbook | ||
|
||
To run the ansible playbook, clone this repository to your RHEL system. Navigate to the directory containing the playbook. | ||
|
||
```bash | ||
git clone https://github.com/intel/intel-technology-enabling-for-openshift.git | ||
|
||
cd intel-technology-enabling-for-openshift/ | ||
|
||
ansible-playbook playbooks/intel_ocp_provisioning.yaml | ||
``` |
This file contains hidden or 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,17 @@ | ||
- name: NFD - Create NFD discovery CR | ||
k8s: | ||
state: present | ||
definition: '{{ item }}' | ||
wait: yes | ||
wait_condition: | ||
type: Available | ||
status: 'False' | ||
with_items: '{{ lookup("url", "https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/main/nfd/node-feature-discovery-openshift.yaml", split_lines=False) | from_yaml_all | list }}' | ||
when: (item is not none) | ||
- name: NFD - Create NFD rules instance CR | ||
k8s: | ||
state: present | ||
definition: '{{ item }}' | ||
wait: yes | ||
with_items: '{{ lookup("url", "https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/main/nfd/node-feature-rules-openshift.yaml", split_lines=False) | from_yaml_all | list }}' | ||
when: (item is not none) |
This file contains hidden or 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,27 @@ | ||
- name: Create global OperatorGroup in openshift-operators namespace | ||
k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1alpha2 | ||
kind: OperatorGroup | ||
metadata: | ||
name: global-operators | ||
namespace: openshift-operators | ||
|
||
- name: Create Intel Device Plugins Operator Subscription | ||
k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
labels: | ||
operators.coreos.com/intel-device-plugins-operator.openshiftoperators: "" | ||
name: intel-device-plugins-operator | ||
namespace: openshift-operators | ||
spec: | ||
channel: alpha | ||
installPlanApproval: Automatic | ||
name: intel-device-plugins-operator | ||
source: certified-operators | ||
sourceNamespace: openshift-marketplace |
This file contains hidden or 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,38 @@ | ||
- name: Create namespace for Node Feature Discovery | ||
k8s: | ||
state: present | ||
definition: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: openshift-nfd | ||
|
||
- name: Create operator group for Node Feature Discovery | ||
k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
generateName: openshift-nfd- | ||
name: openshift-nfd | ||
namespace: openshift-nfd | ||
spec: | ||
targetNamespaces: | ||
- openshift-nfd | ||
|
||
- name: Subscribe to Node Feature Discovery operator | ||
k8s: | ||
state: present | ||
definition: | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
name: nfd | ||
namespace: openshift-nfd | ||
spec: | ||
channel: "stable" | ||
installPlanApproval: Automatic | ||
name: nfd | ||
source: redhat-operators | ||
sourceNamespace: openshift-marketplace |
This file contains hidden or 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,78 @@ | ||
- hosts: localhost | ||
gather_facts: no | ||
vars: | ||
kubeconfig_path: "~/.kube/mojave-config" | ||
environment: | ||
KUBECONFIG: "{{ kubeconfig_path }}" | ||
vars_prompt: | ||
- name: "install_operators" | ||
prompt: "Do you want to install operators? 'Yes' to install NFD Operator and Intel Device Plugins Operator, or 'No' to skip" | ||
private: no | ||
- name: "validation_feature" | ||
prompt: "Which Intel feature do you want to validate? Enter 1 for Intel SGX, 2 for Intel QAT, 3 for Intel DSA, 4 for Intel GPU" | ||
private: no | ||
|
||
tasks: | ||
- name: Validate Inputs | ||
block: | ||
- name: Invalid Install Operators Input | ||
fail: | ||
msg: "Invalid input for Install Operators. Please enter a valid option for Install Operators (Yes/No)." | ||
when: install_operators not in ["Yes", "No"] | ||
- name: Invalid Validation Feature Input | ||
fail: | ||
msg: "Invalid input for validation feature. Please enter a valid option (1-4)." | ||
when: validation_feature not in ["1", "2", "3", "4"] | ||
chaitanya1731 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Install Operators | ||
block: | ||
chaitanya1731 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: NFD - Install NFD Operator | ||
include_tasks: install_nfd_operator.yaml | ||
- name: IDPO - Install Intel Device Plugins Operator | ||
include_tasks: install_device_plugins_operator.yaml | ||
- name: NFD - Wait until the nfd-operator-controller Deployment is available | ||
k8s_info: | ||
kind: Deployment | ||
wait: yes | ||
name: nfd-controller-manager | ||
label_selectors: | ||
- operators.coreos.com/nfd.openshift-nfd | ||
- control-plane=controller-manager | ||
namespace: openshift-nfd | ||
wait_condition: | ||
type: Available | ||
status: 'True' | ||
- name: NFD - Configure NFD Operator | ||
include_tasks: configure_nfd.yaml | ||
- name: IDPO - Wait until the inteldeviceplugins-controller-manager Deployment is available | ||
k8s_info: | ||
kind: Deployment | ||
name: inteldeviceplugins-controller-manager | ||
namespace: openshift-operators | ||
wait: yes | ||
wait_condition: | ||
type: Available | ||
status: 'True' | ||
reason: MinimumReplicasAvailable | ||
when: install_operators == "Yes" | ||
|
||
- name: Skip Operator Installation | ||
debug: | ||
msg: "Skipping operator installation as per user input." | ||
when: install_operators == "No" | ||
|
||
- name: Validate Intel SGX | ||
include_tasks: validate_sgx.yaml | ||
when: validation_feature == "1" | ||
|
||
- name: Validate Intel QAT | ||
include_tasks: validate_gpu.yaml | ||
when: validation_feature == "2" | ||
|
||
- name: Validate Intel DSA | ||
include_tasks: validate_qat.yaml | ||
when: validation_feature == "3" | ||
|
||
- name: Validate Intel GPU | ||
include_tasks: validate_dsa.yaml | ||
when: validation_feature == "4" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.