CiscoDevNet / ansible-ucs

Cisco UCS Ansible Collection
MIT License
15 stars 7 forks source link

Working with managed_objets and children list #27

Closed albertdamien closed 3 years ago

albertdamien commented 3 years ago

Hello, I am working on an example of creating a BIOS policy with ansible and UCS Platform Emulator.

I have a problem with the selection of the characteristics of my BIOS policy.

The selections I made are not taken into account by UCS Manager.

Here is the playbook I use :

- name: UCS managed_objets module test
  hosts: localhost
  tasks:
  - name: Configure BIOS Policy Using JSON objects list with children
    cisco.ucs.ucs_managed_objects:
      hostname: 192.168.56.132
      username: admin
      password: password
      objects:
      - {
          "module": "ucsmsdk.mometa.bios.BiosVProfile",
          "class": "BiosVProfile",
          "properties": {
              "parent_mo_or_dn": "org-root",
              "name": "Virtu-MX",
              "descr": "BIOS Policy for Virtualization on Cisco UCS MX Servers",
          },
          "children": [
            {
                "module": "ucsmsdk.mometa.bios.BiosVfCPUPerformance",
                "class": "BiosVfCPUPerformance",
                "properties": {
                    "vp_cpu_performance": "hpc"
                }
            },
            {
                "module": "ucsmsdk.mometa.bios.BiosVfEnhancedIntelSpeedStepTech",
                "class": "BiosVfEnhancedIntelSpeedStepTech",
                "properties": {
                    "vp_enhanced_intel_speed_step_tech": "disabled"
                }
            },
            {
                "module": "ucsmsdk.mometa.bios.BiosVfIntelHyperThreadingTech",
                "class": "BiosVfIntelHyperThreadingTech",
                "properties": {
                    "vp_intel_hyper_threading_tech": "disabled"
                }
            }
          ]
        }

When I launch the playbook, the ansible status reflects the changes I make to my configuration unfortunately this is not the case in the UCS Manager interface. In fact, the parent object is created but the children doesn't follow my configuration choices.

dalbert@ubuntu:~/UCS$ ansible-playbook ucs_bios_policy.yaml 
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match
'all'

PLAY [UCS managed_objets module test] ***********************************************************************************

TASK [Gathering Facts] **************************************************************************************************
ok: [localhost]

TASK [Configure BIOS Policy Using JSON objects list with children] ******************************************************
changed: [localhost]

PLAY RECAP **************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

bios_policy

Am I using the children property of manages_objects module correctly ?

Best Regards, Damien ALBERT

bakrir commented 3 years ago

Hi @albertdamien,

I just tested your playbook using the exact json you provided (copy & paste) in your example against a lab system and it worked as expected so your data structure is fine:

image

I am not sure if this might be a UCSPE limitation; don't have one readily available to test against.

I hope that helps.

Cheers, Rami

albertdamien commented 3 years ago

Hello @bakrir,

thank you for your quick response. It makes me feel better to know that it may be a UCSPE limitation, I should have a physical lab very soon. I could confirm your results. In the meantime I will close the issue

Regards, Damien

albertdamien commented 3 years ago

Problem not reproduced on UCS physical platform