IBM / ibm-spectrum-scale-install-infra

Spectrum Scale Installation and Configuration
Apache License 2.0
64 stars 67 forks source link

Add support to mmcrcluster to be allow passing in a config file: `-c configFile` #180

Open whowutwut opened 4 years ago

whowutwut commented 4 years ago

I wanted to open this issue to request a small enhancement for the -c configFile option for mmcrcluster that would allow us to pass in a spectrum scale config file

Suggesting one potential way to implement this for review/comments

Add default in defaults/main.yml, could be overridden in group_vars/all

spectum_scale_configfile: "/etc/mmfs/mmfs.cfg"

Then before the call for mmcrcluster we could stat this file and see if it exists, if it DOES exist, then we set facts "-c {{ spectum_scale_configfile }}" Something like this:

$ git diff roles/core/cluster/tasks/cluster.yml
diff --git a/roles/core/cluster/tasks/cluster.yml b/roles/core/cluster/tasks/cluster.yml
index 81f153b..00f7109 100644
--- a/roles/core/cluster/tasks/cluster.yml
+++ b/roles/core/cluster/tasks/cluster.yml
@@ -116,6 +116,7 @@
     - name: install | Initialize gpfs profile
       set_fact:
          profile_type: ""
+         config_file_option: ""

     - name: install | Set gpfs profile if it is defined
       set_fact:
@@ -124,8 +125,18 @@
         - scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None'
         - (stat_profile_result.matched) == 1 or (stat_user_profile_result is defined and stat_user_profile_result.matched == 1)

+    - name: cluster | check if spectrum scale config file is requested to be used
+      stat:
+         path: "{{ spectrum_scale_configfile }}"
+      register: configfile_result
+
+    - name: cluster | set config file option
+      set_fact:
+          config_file_option: "-c {{ spectrum_scale_configfile }}"
+      when: configfile_result.stat.exists
+
     - name: cluster | Create new cluster
-      command: /usr/lpp/mmfs/bin/mmcrcluster -N /var/tmp/NodeFile -C {{ scale_cluster_clustername }} {{ profile_type }}
+      command: /usr/lpp/mmfs/bin/mmcrcluster -N /var/tmp/NodeFile -C {{ scale_cluster_clustername }} {{ config_file_option }} {{ profile_type }}
       notify: accept-licenses
       register: mmcrcluster_results

I'm going to try this out...

@rajan-mis any thoughts/comments?

rajan-mis commented 3 years ago

@whowutwut Do we still need this issue because we are achieving though profile. please let us know if we need this. thanks