dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
339 stars 163 forks source link

ansible-playbook dellemc_get_system_inventory.yml --Where is the result #22

Closed liweibenz closed 4 years ago

liweibenz commented 5 years ago

ansible-playbook dellemc_get_system_inventory.yml --Where is the result

felixs88 commented 5 years ago

@liweibenz, verbose mode is required to add in the command line options, that gets the more output from the successful shown.

ansible-playbook dellemc_get_system_inventory.yml -vvv

liweibenz commented 5 years ago

thanks

Felix Stephen notifications@github.com 于2018年12月5日周三 下午7:04写道:

@liweibenz https://github.com/liweibenz, verbose mode is required to add in the command line options, that gets the more output from the successful shown.

ansible-playbook dellemc_get_system_inventory.yml -vvv

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dell/Dell-EMC-Ansible-Modules-for-iDRAC/issues/22#issuecomment-444447023, or mute the thread https://github.com/notifications/unsubscribe-auth/AGoYaqsvxEg6JsP6WRLAFKh0gn9GR7Pzks5u16g8gaJpZM4ZCcD5 .

anupamaloke commented 5 years ago

@liweibenz, you need to turn on the verbosity option (-vvv or higher) to see the returned data. Alternatively, you can use the debug module to print the return value:

anupam@ubuntu:~/workspace/virtualenvs/ansible-om-devel/Dell-EMC-Ansible-Modules-for-iDRAC$ cat getinventory.yml
---
- hosts: all
  connection: local
  name: Get PowerEdge server system inventory
  gather_facts: False

  vars:
    ansible_python_interpreter: python

  tasks:
    - name: Get system inventory
      dellemc_get_system_inventory:
        idrac_ip:   "{{ idrac_ip }}"
        idrac_user: "root"
        idrac_pwd:  "calvin"
      register: result

    # Set system inventory to a fact variable
    - set_fact:
        idrac_facts: “{{result.ansible_facts[idrac_ip].SystemInventory}}”

    # Print the complete system inventory
    - debug:
        var: idrac_facts

    # Print only iDRAC attributes from the idrac_fact variable
    - debug:
        var: idrac_facts[“iDRAC”]
rajeevarakkal commented 4 years ago

I hope this issue is closed with appropriate verbose level while invoking the playbook. Closing the defect now