Skip to content

Commit

Permalink
ansible-scylla-node: Allow auto-detecting nvme cards
Browse files Browse the repository at this point in the history
This patch adds a detect_nvmes field, which when set to True will use 'nvme list' command
for getting the list of nvme devices in the machine and pass all of them to scylla_raid_setup.
  • Loading branch information
igorribeiroduarte authored and vladzcloudius committed Jul 22, 2024
1 parent 8009828 commit dab935f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ansible-scylla-node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ scylla_dependencies:
- curl
- wget
- python3-yaml # this will fail on non centos systems
- nvme-cli
#- software-properties-common
#- apt-transport-https
#- gnupg2
Expand Down Expand Up @@ -424,6 +425,10 @@ scylla_manager_agent_config: |
# - /dev/nvme0n3
scylla_raid_online_discard: False

# If scylla_raid_setup is not given and this is set to True, the role will use 'nvme list' for getting the list of nvme devices
# in the machine and pass all of them to scylla_raid_setup
detect_nvmes: False

skip_coredump: False
devmode: False
#below can be dangerous, sysconfig also sets cpuset, so disable both to not do any cpuset.conf changes!
Expand Down
5 changes: 5 additions & 0 deletions ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@
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
12 changes: 12 additions & 0 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
when: cpuset_command is defined and skip_cpuset is defined and skip_cpuset|bool == false
become: true

- name: Detect NVME disks
block:
- name: Get list of NVMEs
shell: |
nvme list | awk '{print $1}' | tail -n +3
register: _detected_nvmes

- set_fact:
scylla_raid_setup: "{{ _detected_nvmes.stdout_lines }}"
become: true
when: detect_nvmes|bool

- name: configure RAID via Scylla-setup
block:
- name: check for current raid
Expand Down

0 comments on commit dab935f

Please sign in to comment.