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

System Resources/System Services Informations #5

Open
fabianoflorentino opened this issue Mar 19, 2021 · 6 comments
Open

System Resources/System Services Informations #5

fabianoflorentino opened this issue Mar 19, 2021 · 6 comments
Assignees

Comments

@fabianoflorentino
Copy link

I have some trouble when tasks get node info, you can help me?

image

@fabianoflorentino fabianoflorentino changed the title Node Info System Info Mar 19, 2021
@fabianoflorentino fabianoflorentino changed the title System Info System Resources/System Services Informations Mar 19, 2021
@kxr
Copy link
Owner

kxr commented Mar 19, 2021

@fabianoflorentino Sure. Once the playbook finishes, you will find a hidden directory in the playbook directory called .localtmphc with a bunch of files. One of those files should be hostvars.json. Is it possible to share that file here?

@fabianoflorentino
Copy link
Author

Hi Khizer,

Attach file.

Thanks for your attention :)

hostvars.json.zip

@fabianoflorentino
Copy link
Author

Hi Khizer,

Attach file.

Thanks for your attention :)

hostvars.json.zip

Hi Khizer,

did you receive the file?

@kxr
Copy link
Owner

kxr commented Mar 24, 2021

@fabianoflorentino Yes I did receive the file, but unfortunately I got very busy this week. I will check it asap.

@kxr
Copy link
Owner

kxr commented Mar 30, 2021

@fabianoflorentino Sorry for the long delay. I checked the file that you attached. The problem seems to be that Ansible for some reason is missing the core/default hostvars that we are relying on.

So before I explain more I will like to give you a short summary of how this playbook works. The first three blocks in ocpcr/cluster-report.yaml collect information from nodes/cluster.

Then, in the fourth block "# Process Cluster Info Locally", the ansible hostvars are dumped. This is what I requested and you shared. Next values from the dumped hostvars.json file are used to populate the jinja2 templates that make up final the html report.

For example, see here we pickup the ansible_architecture value from hostvars.json and populate it in the template. This seems to be working fine, the variable is present in the hostvars.json dump and it is populated in the screenshot that you shared (Arch column).

To my surprise, some hostvars are missing for example ansible_processor_vcpus, which is used to populate the vCPU column. I am not sure why these variables are missing.

May be you are using a newer version of ansible and things have changed. Can you tell me what version of ansible you used to run this playbook. And if possible can you try this playbook with ansible version 2.6?

@kxr
Copy link
Owner

kxr commented Mar 30, 2021

Also, try the following from the bastion host (pick any one node):

ansible -i /path/to/inventory <node-name> -m setup | grep "ansible_processor_vcpus\|ansible_mem"

Do you see these default ansible variables? For example I see:

# ansible -i /etc/ansible/hosts ocp311-m1.local -m setup | grep "ansible_processor_vcpus\|ansible_mem"
        "ansible_memfree_mb": 1036, 
        "ansible_memory_mb": {
        "ansible_memtotal_mb": 2870, 
        "ansible_processor_vcpus": 4,

@kxr kxr self-assigned this Mar 30, 2021
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

2 participants