IBM / ibm-spectrum-scale-install-infra

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

Trying to pass in a user-defined profile failed validation of filename #183

Open whowutwut opened 4 years ago

whowutwut commented 4 years ago

I set the following variables: mmfs_profile_path: "/var/mmfs/etc/scalecore.profile" and call the role as follows:

- hosts: scale_cluster
  gather_facts: false
  vars:
    scale_cluster_profile_dir_path: "{{ mmfs_profile_path | dirname }}"
    scale_cluster_profile_name: "scalecore"
  collections:
    - ibm_spectrum_scale.install_infra
  roles:
    - core/cluster

On the nodes, this file exists:

# ./showdir /var/mmfs/etc/scalecore.profile
ibm-spectrum-scale-core-jnx7v ---
-rw-r--r--. 1 root root 40 Jul 10 15:12 /var/mmfs/etc/scalecore.profile
ibm-spectrum-scale-core-m8qth ---
-rw-r--r--. 1 root root 40 Jul 10 15:12 /var/mmfs/etc/scalecore.profile
ibm-spectrum-scale-core-n6cns ---
-rw-r--r--. 1 root root 40 Jul 10 15:12 /var/mmfs/etc/scalecore.profile
ibm-spectrum-scale-core-xhwcd ---
-rw-r--r--. 1 root root 40 Jul 10 15:12 /var/mmfs/etc/scalecore.profile

But during the validation step, it fails because of the .profile not in the name.

2020-07-10 11:13:01,582 p=70086 u=vhu n=ansible | TASK [core/cluster : check | Stat GPFS profile file] ***************************
2020-07-10 11:13:01,583 p=70086 u=vhu n=ansible | task path: /Users/vhu/.ansible/collections/ansible_collections/ibm_spectrum_scale/install_infra/roles/core/cluster/tasks/cluster.yml:86
2020-07-10 11:13:07,386 p=70086 u=vhu n=ansible | ok: [ibm-spectrum-scale-core-xhwcd -> ibm-spectrum-scale-core-xhwcd] => {"changed": false, "examined": 1, "files": [{"atime": 1594393954.5360131, "ctime": 1594393954.540013, "dev": 159, "gid": 0, "gr_name": "root", "inode": 1008731239, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mode": "0644", "mtime": 1594393950.3190215, "nlink": 1, "path": "/var/mmfs/etc/scalecore.profile", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 40, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}], "matched": 1, "msg": ""}
2020-07-10 11:13:07,418 p=70086 u=vhu n=ansible | TASK [core/cluster : check | cluster profile name validation] ******************
2020-07-10 11:13:07,418 p=70086 u=vhu n=ansible | task path: /Users/vhu/.ansible/collections/ansible_collections/ibm_spectrum_scale/install_infra/roles/core/cluster/tasks/cluster.yml:93
2020-07-10 11:13:07,459 p=70086 u=vhu n=ansible | ok: [ibm-spectrum-scale-core-xhwcd -> ibm-spectrum-scale-core-xhwcd] => {
    "changed": false,
    "msg": "All assertions passed"
}
2020-07-10 11:13:07,488 p=70086 u=vhu n=ansible | TASK [core/cluster : check | cluster profile format validation] ****************
2020-07-10 11:13:07,488 p=70086 u=vhu n=ansible | task path: /Users/vhu/.ansible/collections/ansible_collections/ibm_spectrum_scale/install_infra/roles/core/cluster/tasks/cluster.yml:100
2020-07-10 11:13:07,531 p=70086 u=vhu n=ansible | fatal: [ibm-spectrum-scale-core-xhwcd -> ibm-spectrum-scale-core-xhwcd]: FAILED! => {
    "assertion": "stat_user_profile_result.matched == 1",
    "changed": false,
    "evaluated_to": false,
    "msg": "A user-defined profile must have the .profile suffix"
}
whowutwut commented 4 years ago

@rajan-mis should this check be deleted at https://github.com/IBM/ibm-spectrum-scale-install-infra/blob/dev/roles/core/cluster/tasks/cluster.yml#L100 , because the stat command at https://github.com/IBM/ibm-spectrum-scale-install-infra/blob/dev/roles/core/cluster/tasks/cluster.yml#L66 is checking pattern {{ var }}.profile. So if it does not have the .profile in the name, it should not get any results at all....

I think we should remove this test block, I can create a PR

whowutwut commented 4 years ago

I'm going to make the file wrong, and run it again and see... I think we would get an undefined, not sure we handle that correctly.

whowutwut commented 4 years ago

Setting to scalecluster.pro ... hit the same issue, but the stat didn't find any file...

2020-07-10 11:29:36,724 p=71539 u=vhu n=ansible | TASK [core/cluster : check | Stat GPFS profile file] ***************************
2020-07-10 11:29:36,724 p=71539 u=vhu n=ansible | task path: /Users/vhu/.ansible/collections/ansible_collections/ibm_spectrum_scale/install_infra/roles/core/cluster/tasks/cluster.yml:86
2020-07-10 11:29:42,387 p=71539 u=vhu n=ansible | ok: [ibm-spectrum-scale-core-tmlv6 -> ibm-spectrum-scale-core-tmlv6] => {"changed": false, "examined": 1, "files": [], "matched": 0, "msg": ""}
2020-07-10 11:29:42,413 p=71539 u=vhu n=ansible | TASK [core/cluster : check | cluster profile name validation] ******************
2020-07-10 11:29:42,413 p=71539 u=vhu n=ansible | task path: /Users/vhu/.ansible/collections/ansible_collections/ibm_spectrum_scale/install_infra/roles/core/cluster/tasks/cluster.yml:93
2020-07-10 11:29:42,451 p=71539 u=vhu n=ansible | ok: [ibm-spectrum-scale-core-tmlv6 -> ibm-spectrum-scale-core-tmlv6] => {
    "changed": false,
    "msg": "All assertions passed"
}
2020-07-10 11:29:42,478 p=71539 u=vhu n=ansible | TASK [core/cluster : check | cluster profile format validation] ****************
2020-07-10 11:29:42,479 p=71539 u=vhu n=ansible | task path: /Users/vhu/.ansible/collections/ansible_collections/ibm_spectrum_scale/install_infra/roles/core/cluster/tasks/cluster.yml:100
2020-07-10 11:29:42,521 p=71539 u=vhu n=ansible | fatal: [ibm-spectrum-scale-core-tmlv6 -> ibm-spectrum-scale-core-tmlv6]: FAILED! => {
    "assertion": "stat_user_profile_result.matched == 1",
    "changed": false,
    "evaluated_to": false,
    "msg": "A user-defined profile must have the .profile suffix"
}

ok will make some changes here..

rajan-mis commented 4 years ago

@whowutwut Sure will do . i have made some code changes in same profile code for cloud deployment enhancement .

https://github.com/IBM/ibm-spectrum-scale-install-infra/compare/dev...rajan-mis:admin_flag

https://github.com/IBM/ibm-spectrum-scale-install-infra/compare/dev...rajan-mis:admin_flag#diff-a99e6d556e80cb3e32fcf68bbb368cc6

Muthu is validating this code using container then we are planning to merge this code .

whowutwut commented 4 years ago

@rajan-mis I have some comments on that diff that you are showing me above, could you create a PR so I have a chance to make some comments inline for those changes?