Skip to content
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

ansible-scylla-node: auto-detect NVMe: only use non-mounted disks. #413

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ansible-scylla-node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ scylla_dependencies:
- curl
- wget
- python3-yaml # this will fail on non centos systems
- nvme-cli
#- software-properties-common
#- apt-transport-https
#- gnupg2
Expand Down
5 changes: 0 additions & 5 deletions ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@
for i in `yum search python3|grep -i pyyaml|awk '{ print $1 }'`; do sudo yum -y install $i; done
become: true

- name: install nvme-cli
shell: |
yum install -y nvme-cli
become: true

- name: install and configure Scylla Manager Agent
block:
- name: add Scylla Manager repo
Expand Down
11 changes: 9 additions & 2 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@

- name: Detect NVME disks
block:
- name: Get list of NVMEs
- name: Get list of NVMEs with no mount points
shell: |
nvme list | awk '{print $1}' | tail -n +3
for nvme_disk in $(lsblk -oNAME -nd | grep nvme)
do
{ echo -n "/dev/$nvme_disk "; lsblk "/dev/$nvme_disk" -o MOUNTPOINT | grep / | wc -l; } | awk '{if ($2=="0") print $1}'
Copy link
Collaborator

@tarzanek tarzanek Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lsblk -n ?
to avoid printing header ?

done
register: _detected_nvmes

- set_fact:
Expand Down Expand Up @@ -80,6 +83,10 @@
_disable_online_discard: "--online-discard {{ scylla_raid_online_discard }}"
when: _scylla_raid_setup_help.stdout is search("--online-discard")

- name: "ansible-scylla-node: common.yml: Setting raid setup with disks"
debug:
msg: "Using the following disk devices: {{ scylla_raid_setup | join(',') }}"

- name: run raid setup if there is no scylla mount yet
shell: "scylla_raid_setup --disks {{ scylla_raid_setup | join(',') }} --update-fstab {{ _disable_online_discard }}"
become: true
Expand Down