test-kitchen / kitchen-vra

A Test Kitchen driver for VMware vRealize Automation
Apache License 2.0
13 stars 22 forks source link

deep merging of extra parameters #22

Closed logicminds closed 5 years ago

logicminds commented 7 years ago

If I supply a list of extra parameters in the driver section (global) will the platform section perform a deep merge with the extram parameters supplied for each node entry in the platform section?

stuartpreston commented 5 years ago

I know this is a very old issue but I had occasion to test this manually today using the latest vra gem (2.7.0) and yes, parameters will deep merge from the driver: to the platform: section

i.e. the following yaml

---
driver:
  name: vra
  username: stuart@vsphere.local
  password: 
  tenant: vsphere.local
  base_url: https://vra.domain.corp
  verify_ssl: false
  subtenant_name: business-group-1
  cpus: 1
  memory: 2048
  private_key_path: ~/.ssh/vagrant.pem
  extra_parameters:
        My.Custom.Property4:
          type: string
          value: newvalue3

transport:
  username: vagrant

provisioner:
  name: chef_zero

verifier:
  name: inspec

platforms:
  - name: centos76
    driver:
      catalog_name: centos76
      extra_parameters:
        My.Custom.Property1:
          type: string
          value: overriddenvalue1
        My.Custom.Property2:
          type: string
          value: overriddenvalue2
        My.Custom.Property3:
          type: string
          value: newvalue3

Results in 4 merged parameters:

image

Closing this out now.