vmware.vmware_rest.appliance_infraprofile_configs module – Export, import, or validate infrastructure profile configurations on the vCenter Server Appliance.

Note

This module is part of the vmware.vmware_rest collection (version 5.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install vmware.vmware_rest.

To use it in a playbook, specify: vmware.vmware_rest.appliance_infraprofile_configs.

New in vmware.vmware_rest 5.0.0

Synopsis

  • Export, import, or validate infrastructure profile (infraprofile) configurations on the vCenter Server Appliance.

  • Infrastructure profiles capture the configuration of appliance components (such as Authentication Management or Appliance Management) so they can be backed up and applied to other appliances.

  • Use state=export to retrieve the current configuration of one or more profiles as a JSON specification.

  • Use state=import to apply a previously exported configuration specification to the appliance.

  • Use state=validate to check whether a configuration specification can be applied without actually importing it.

  • These are non-idempotent actions that are executed each time the module runs.

Parameters

Parameter

Comments

config_spec

string

This property is deprecated as of __vSphere API 9.0.0.0__.

The JSON string representing the desired config specification.

This property was added in __vSphere API 7.0.0.0__.

description

string

This property is deprecated as of __vSphere API 9.0.0.0__.

Custom description provided by the user.

This property was added in __vSphere API 7.0.0.0__.

If missing or ‘null’ description will be empty.

encryption_key

string

This property is deprecated as of __vSphere API 9.0.0.0__.

Encryption Key to encrypt/decrypt profiles.

This property was added in __vSphere API 7.0.0.0__.

If missing or ‘null’ encryption will not be used for the profile.

profile_spec

dictionary

This property is deprecated as of __vSphere API 9.0.0.0__.

The profile specification, if any

This property was added in __vSphere API 7.0.0.0__.

Only set if there is a profilespec avaliable for this import profilespec.

description

string

This property is deprecated as of __vSphere API 9.0.0.0__.

Custom description provided by the user.

This property was added in __vSphere API 7.0.0.0__.

If missing or ‘null’ description will be empty.

encryption_key

string

This property is deprecated as of __vSphere API 9.0.0.0__.

Encryption Key to encrypt/decrypt profiles.

This property was added in __vSphere API 7.0.0.0__.

If missing or ‘null’ encryption will not be used for the profile.

profiles

list / elements=string

This property is deprecated as of __vSphere API 9.0.0.0__.

Profiles to be exported/imported.

This property was added in __vSphere API 7.0.0.0__.

If missing or ‘null’ or empty, all profiles will be returned.

When clients pass a value of this schema as a parameter, the property must contain identifiers (MOIDs) for the resource type ‘com.vmware.infraprofile.profile’. When operations return a value of this schema as a response, the property will contain identifiers (MOIDs) for the resource type ‘com.vmware.infraprofile.profile’.

profiles

list / elements=string

This property is deprecated as of __vSphere API 9.0.0.0__.

Profiles to be exported/imported.

This property was added in __vSphere API 7.0.0.0__.

If missing or ‘null’ or empty, all profiles will be returned.

When clients pass a value of this schema as a parameter, the property must contain identifiers (MOIDs) for the resource type ‘com.vmware.infraprofile.profile’. When operations return a value of this schema as a response, the property will contain identifiers (MOIDs) for the resource type ‘com.vmware.infraprofile.profile’.

session_timeout

float

Timeout in seconds for the whole operation including connection establishment, request sending, and response.

Default: 300.0

state

string / required

The desired state of the resource.

Use export to perform the export action.

Use import to perform the import action.

Use validate to perform the validate action.

Only options present and absent support idempotence.

Choices:

  • "export"

  • "import"

  • "validate"

vcenter_hostname

string / required

The hostname or IP address of the vSphere vCenter.

If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.

vcenter_password

string / required

The vSphere vCenter password.

If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.

vcenter_port

integer

The port number of the vSphere vCenter.

If the value is not specified in the task, the value of environment variable VMWARE_PORT will be used instead.

vcenter_rest_log_file

string

Optional path to a log file for HTTP REST interaction.

If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.

vcenter_username

string / required

The vSphere vCenter username.

If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.

vcenter_validate_certs

boolean

Allows connection when SSL certificates are not valid.

Set to false when certificates are not trusted.

If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.

Choices:

  • false

  • true ← (default)

Notes

Note

  • Generated from vSphere API spec 9.1.0.

  • Compatible with vSphere API 7.0.3.

  • Compatible with vSphere API 8.0.2.

Examples

- name: Export all infrastructure profiles
  vmware.vmware_rest.appliance_infraprofile_configs:
    state: export
  register: exported_profiles

- name: Export a specific profile with a description
  vmware.vmware_rest.appliance_infraprofile_configs:
    state: export
    profiles:
      - ApplianceManagement
    description: Backup taken before upgrade
  register: appliance_mgmt_profile

- name: Validate a configuration specification before importing it
  vmware.vmware_rest.appliance_infraprofile_configs:
    state: validate
    config_spec: "{{ exported_profiles.value }}"

- name: Import a previously exported configuration specification
  vmware.vmware_rest.appliance_infraprofile_configs:
    state: import
    config_spec: "{{ exported_profiles.value }}"
    profile_spec:
      description: Restore appliance configuration
      profiles:
        - ApplianceManagement

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

id

string

Identifier of the infraprofile action performed.

Returned: When state is set to a supported action

Sample: ""

value

any

The raw API response body from the vCenter operation.

For export, this is the JSON configuration specification of the requested profiles.

For import and validate, this contains the result of the operation, including any validation status or messages.

Returned: On success

Sample: {}

Authors

  • Ansible Eco Content Team (@eco-ansible-content)