ansible-collections / vmware.vmware_rest

Ansible Collection for VMWare (REST modules)
https://ansible-collections.github.io/vmware.vmware_rest/
GNU General Public License v3.0
130 stars 63 forks source link

vmware.vmware_rest.vcenter_vm_guest_customization module Documentation #527

Open mgamboa opened 1 week ago

mgamboa commented 1 week ago

Summary

I was trying the module and when running with the example fail the reason was missing the 3 variables that are required, they come documented but in the example is no show how to use it

Issue Type

Documentation Report

Component Name

vmware.vmware_rest.vcenter_vm_guest_customization module

Ansible Version

$ ansible --version
2.15

Collection Versions

$ ansible-galaxy collection list

Configuration

$ ansible-config dump --only-changed

OS / Environment

AWX

Additional Information

No response

Code of Conduct

mikemorency commented 1 week ago

hi @mgamboa

Are you talking about the parameters vcenter_hostname, vcenter_username, and vcenter_password? Those parameters are used for authentication to your vCenter cluster. You need to specify some values, but you can set them as environment variables (as described here) or as parameters when using the module.

Ill wait for you to confirm that is what your talking about, but in the meantime here is an example where they are defined as parameters while using the module.

- name: Customize the VM
  vmware.vmware_rest.vcenter_vm_guest_customization:
    vcenter_hostname: my-vcenter.domain.local
    vcenter_username: administrator@vsphere.local
    vcenter_password: SuperSecretPass
    vm: "{{ lookup('vmware.vmware_rest.vm_moid', '/my_dc/vm/test_vm1') }}"
    configuration_spec:
      linux_config:
        domain: mydomain
        hostname:
          fixed_name: foobar
          type: FIXED
    interfaces:
    - adapter:
        ipv4:
          type: STATIC
          gateways:
          - 192.168.123.1
          ip_address: 192.168.123.50
          prefix: 24
    global_DNS_settings:
      dns_suffix_list: []
      dns_servers:
      - 1.1.1.1
mgamboa commented 1 week ago

What i talking about the example is missing about the use for example of cloudinit I already defeat to try to figure out how to deploy the machine with customization on it because the documentation is not acure compare with other modules that explain the use of it , can we possible to expand the example a little further to understand better how the syntax works on the module i try to make something with cloud init but was terrible impossible even try just to put the hostname can't do i decide just create the vm the only thing that works for me on vsphere 8 the reason i change to rest api is because all my code works ok with vsphere 7 but with 8 doesn't accept tnow the legacy vmware.guest module at all

On Tue, Sep 10, 2024 at 3:02 AM mikemorency @.***> wrote:

hi @mgamboa https://github.com/mgamboa

Are you talking about the parameters vcenter_hostname, vcenter_username, and vcenter_password? Those parameters are used for authentication to your vCenter cluster. You need to specify some values, but you can set them as environment variables (as described here https://docs.ansible.com/ansible/latest/collections/vmware/vmware_rest/vcenter_vm_guest_customization_module.html#parameter-vcenter_hostname) or as parameters when using the module.

Ill wait for you to confirm that is what your talking about, but in the meantime here is an example where they are defined as parameters while using the module.

  • name: Customize the VM vmware.vmware_rest.vcenter_vm_guest_customization: vcenter_hostname: my-vcenter.domain.local vcenter_username: @.*** vcenter_password: SuperSecretPass vm: "{{ lookup('vmware.vmware_rest.vm_moid', '/my_dc/vm/test_vm1') }}" configuration_spec: linux_config: domain: mydomain hostname: fixed_name: foobar type: FIXED interfaces:
    • adapter: ipv4: type: STATIC gateways:
      • 192.168.123.1 ip_address: 192.168.123.50 prefix: 24 global_DNS_settings: dns_suffix_list: [] dns_servers:
        • 1.1.1.1

— Reply to this email directly, view it on GitHub https://github.com/ansible-collections/vmware.vmware_rest/issues/527#issuecomment-2338627693, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC7SAYZAVNOBBVWZCPNT4TZVXIDTAVCNFSM6AAAAABN4EZCAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZYGYZDONRZGM . You are receiving this because you were mentioned.Message ID: @.***>