All of lore.kernel.org
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH 2/4] playbooks: Add a playbook to set up rxe on target nodes
Date: Mon,  3 Jun 2024 12:06:56 -0400	[thread overview]
Message-ID: <20240603160658.4073204-3-cel@kernel.org> (raw)
In-Reply-To: <20240603160658.4073204-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

The playbook adds a udev rule to provision an rxe device when the
node is booted.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/rxe/tasks/main.yml         | 29 ++++++++++++++++++++++
 playbooks/roles/rxe/templates/udev-rule.j2 |  2 ++
 playbooks/rxe.yml                          |  4 +++
 3 files changed, 35 insertions(+)
 create mode 100644 playbooks/roles/rxe/tasks/main.yml
 create mode 100644 playbooks/roles/rxe/templates/udev-rule.j2
 create mode 100644 playbooks/rxe.yml

diff --git a/playbooks/roles/rxe/tasks/main.yml b/playbooks/roles/rxe/tasks/main.yml
new file mode 100644
index 000000000000..88e655981f7f
--- /dev/null
+++ b/playbooks/roles/rxe/tasks/main.yml
@@ -0,0 +1,29 @@
+---
+- name: Include optional extra_vars
+  ansible.builtin.include_vars:
+    file: "{{ item }}"
+  with_first_found:
+    - files:
+        - "../extra_vars.yml"
+        - "../extra_vars.yaml"
+        - "../extra_vars.json"
+      skip: true
+  failed_when: false
+  tags: vars
+
+- name: Insert a udev rule to create an rxe device
+  become: true
+  become_method: ansible.builtin.sudo
+  ansible.builtin.template:
+    src: "udev-rule.j2"
+    dest: "/usr/lib/udev/rules.d/99-rxe.rules"
+    owner: "root"
+    group: "root"
+    mode: "0644"
+    force: false
+
+- name: Reload the udev ruleset
+  become: true
+  become_method: ansible.builtin.sudo
+  ansible.builtin.shell: "udevadm control --reload && udevadm trigger"
+  changed_when: true
diff --git a/playbooks/roles/rxe/templates/udev-rule.j2 b/playbooks/roles/rxe/templates/udev-rule.j2
new file mode 100644
index 000000000000..9f5b5e4a68f3
--- /dev/null
+++ b/playbooks/roles/rxe/templates/udev-rule.j2
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", KERNEL=="{{ ansible_default_ipv4.interface }}", \
+   PROGRAM="/usr/sbin/rdma link add rxe0 type rxe netdev {{ ansible_default_ipv4.interface }}"
diff --git a/playbooks/rxe.yml b/playbooks/rxe.yml
new file mode 100644
index 000000000000..dc51c0347628
--- /dev/null
+++ b/playbooks/rxe.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+  roles:
+    - role: rxe
-- 
2.45.1


  parent reply	other threads:[~2024-06-03 16:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 16:06 [PATCH 0/4] Add rxe as a second software RDMA option cel
2024-06-03 16:06 ` [PATCH 1/4] bringup.goals: Make siw settings more generic cel
2024-06-03 16:06 ` cel [this message]
2024-06-03 16:06 ` [PATCH 3/4] Kconfig: Add support for testing RDMA with software RoCE cel
2024-06-03 16:54   ` Zhu Yanjun
2024-06-07 13:10   ` Zhu Yanjun
2024-06-03 16:06 ` [PATCH 4/4] Update help text that mentions SIW cel
2024-06-05 17:50 ` [PATCH 0/4] Add rxe as a second software RDMA option Chuck Lever III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240603160658.4073204-3-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.