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

Failed when adding node to cluster #617

Open
pekackif opened this issue Mar 18, 2022 · 7 comments
Open

Failed when adding node to cluster #617

pekackif opened this issue Mar 18, 2022 · 7 comments

Comments

@pekackif
Copy link

Describe the bug
When extending inventory to add new node, first ansible run finish with failed.
Re;ease used is v2.2.0


TASK [ibm.spectrum_scale.core.cluster : configure | check if package upgraded] *******************************************************************
Thursday 17 March 2022  16:08:49 +0100 (0:00:00.084)       0:07:14.594 ******** 
skipping: [n001] => (item=n001) 
skipping: [n001] => (item=n002) 
fatal: [n001]: FAILED! => 
  msg: |-
    The conditional check '(hostvars[item].scale_install_updated is defined and (true in ansible_play_hosts | map('extract', hostvars, 'scale_install_updated') | map('bool') | list))' failed. The error was: error while evaluating conditional ((hostvars[item].scale_install_updated is defined and (true in ansible_play_hosts | map('extract', hostvars, 'scale_install_updated') | map('bool') | list))): 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'scale_install_updated'
  
    The error appears to be in 'xxxxxxx/ansible/ansible_collections/ibm/spectrum_scale/roles/core/cluster/tasks/finalize.yml': line 5, column 7, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
    - block:  ## run_once: true
        - name: configure | check if package upgraded
          ^ here


To Reproduce
Steps to reproduce the behavior:

  1. Add node to inventory
  2. Run ansible for the cluster
  3. first run crashwith error
  4. second one finish succesfully

Expected behavior
First run clear

Environment
Please run the following an paste your output here:

# Developement

$ ansible --version
ansible [core 2.11.8] 
 
  python version = 3.9.6 (default, Aug 25 2021, 16:22:38) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
  jinja version = 3.0.3
  libyaml = True

$ python --version
Python 3.9.6

# Deployment
[root@n001 ~]# rpm -qa | grep gpfs
gpfs.compression-5.1.2-2.x86_64
gpfs.gss.pmsensors-5.1.2-2.el7.x86_64
gpfs.gpl-5.1.2-2.noarch
gpfs.gskit-8.0.55-19.1.x86_64
gpfs.license.da-5.1.2-2.x86_64
gpfs.docs-5.1.2-2.noarch
gpfs.base-5.1.2-2.x86_64
gpfs.msg.en_US-5.1.2-2.noarch

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@rajan-mis
Copy link
Member

rajan-mis commented Mar 18, 2022

Can you please check your installed ansible version.
ansible --version

We are supporting ansible 2.9 but with latest master code, it should work with 2.10 too. Thanks

@rajan-mis
Copy link
Member

@pekackif we will check this with latest ansible version but currently you can try following work around,

Option 1:
You can install ansible 2.9 version and continue with the installation.

Option 2:
Or you can check by defining this variable in the playbook ,
scale_install_updated: false
scale_config_changed: false

@pekackif
Copy link
Author

pekackif commented Mar 22, 2022

$ ansible-lint /home/xxxxx/ibm/spectrum_scale/roles/core/cluster/tasks/finalize.yml
WARNING  Listing 2 violation(s) that are fatal
yaml: wrong indentation: expected 8 but found 7 (indentation)
../ansible/ansible_collections/ibm/spectrum_scale/roles/core/cluster/tasks/finalize.yml:9

yaml: wrong indentation: expected 8 but found 7 (indentation)
../ansible/ansible_collections/ibm/spectrum_scale/roles/core/cluster/tasks/finalize.yml:19

You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - yaml  # Violations reported by yamllint

Finished with 2 failure(s), 0 warning(s) on 1 files.

- (hostvars[item].scale_install_updated is defined and

- (hostvars[item].scale_config_changed is defined and

@rajan-mis
Copy link
Member

@pekackif Thanks for the update. are you executing this through ansible collection ?

@pekackif
Copy link
Author

collections:
    - ibm.spectrum_scale
roles:
    - core.precheck
    - core.common
    - core.node
    - core.cluster
    - gui/precheck
    - gui/node
    - gui/cluster

@rajan-mis
Copy link
Member

Thanks @pekackif for the reply. Can you please check if you are able to execute using roles method without collections.

- hosts: cluster01
  vars:
    - scale_install_localpkg_path: /root/Spectrum_Scale_Standard-5.0.4.0-x86_64-Linux-install
  roles:
    - core/precheck
    - core/node
    - core/cluster
    - core/postcheck
    - gui/precheck
    - gui/node
    - gui/cluster

@sjpb
Copy link

sjpb commented Apr 19, 2023

FWIW I think I hit the same error (was a while ago now) and I added this to work around:

scale_install_needsupdate: false
scale_install_updated: false

Which actually I think is correct default behaviour? As ansible users won't expect a re-run to possibly change the installed packages just because a newer version is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants