community.vmware.vmware_vcenter_settings (4.2.0) — module

Configures general settings on a vCenter server

Authors: Christian Kotte (@ckotte)

Install collection

Install with ansible-galaxy collection install community.vmware:==4.2.0


Add to requirements.yml

  collections:
    - name: community.vmware
      version: 4.2.0

Description

This module can be used to configure the vCenter server general settings (except the statistics).

The statistics can be configured with the module M(community.vmware.vmware_vcenter_statistics).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure vCenter general settings
  community.vmware.vmware_vcenter_settings:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    database:
      max_connections: 50
      task_cleanup: true
      task_retention: 30
      event_cleanup: true
      event_retention: 30
    runtime_settings:
      unique_id: 1
      managed_address: "{{ lookup('dig', inventory_hostname) }}"
      vcenter_server_name: "{{ inventory_hostname }}"
    user_directory:
      timeout: 60
      query_limit: true
      query_limit_size: 5000
      validation: true
      validation_period: 1440
    mail:
      server: mail.example.com
      sender: vcenter@{{ inventory_hostname }}
    snmp_receivers:
      snmp_receiver_1_url: localhost
      snmp_receiver_1_enabled: true
      snmp_receiver_1_port: 162
      snmp_receiver_1_community: public
    timeout_settings:
      normal_operations: 30
      long_operations: 120
    logging_options: info
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable Retreat Mode for cluster with MOID domain-c8 (https://kb.vmware.com/kb/80472)
  community.vmware.vmware_vcenter_settings:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    advanced_settings:
      'config.vcls.clusters.domain-c8.enabled': 'false'
  delegate_to: localhost

Inputs

    
mail:
    default:
      sender: ''
      server: ''
    description:
    - The settings vCenter server uses to send email alerts.
    suboptions:
      sender:
        description: Mail sender address.
        type: str
      server:
        description: Mail server.
        type: str
    type: dict

port:
    default: 443
    description:
    - The port number of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PORT)
      will be used instead.
    type: int

database:
    default:
      event_cleanup: true
      event_retention: 30
      max_connections: 50
      task_cleanup: true
      task_retention: 30
    description:
    - The database settings for vCenter server.
    suboptions:
      event_cleanup:
        default: true
        description: Event cleanup.
        type: bool
      event_retention:
        default: 30
        description: Event retention in days.
        type: int
      max_connections:
        default: 50
        description: Maximum connections.
        type: int
      task_cleanup:
        default: true
        description: Task cleanup.
        type: bool
      task_retention:
        default: 30
        description: Task retention in days.
        type: int
    type: dict

hostname:
    description:
    - The hostname or IP address of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_HOST)
      will be used instead.
    type: str

password:
    aliases:
    - pass
    - pwd
    description:
    - The password of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PASSWORD)
      will be used instead.
    type: str

username:
    aliases:
    - admin
    - user
    description:
    - The username of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_USER)
      will be used instead.
    type: str

proxy_host:
    description:
    - Address of a proxy that will receive all HTTPS requests and relay them.
    - The format is a hostname or a IP.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PROXY_HOST)
      will be used instead.
    required: false
    type: str

proxy_port:
    description:
    - Port of the HTTP proxy that will receive all HTTPS requests and relay them.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PROXY_PORT)
      will be used instead.
    required: false
    type: int

snmp_receivers:
    default:
      snmp_receiver_1_community: public
      snmp_receiver_1_enabled: true
      snmp_receiver_1_port: 162
      snmp_receiver_1_url: localhost
      snmp_receiver_2_community: ''
      snmp_receiver_2_enabled: false
      snmp_receiver_2_port: 162
      snmp_receiver_2_url: ''
      snmp_receiver_3_community: ''
      snmp_receiver_3_enabled: false
      snmp_receiver_3_port: 162
      snmp_receiver_3_url: ''
      snmp_receiver_4_community: ''
      snmp_receiver_4_enabled: false
      snmp_receiver_4_port: 162
      snmp_receiver_4_url: ''
    description:
    - SNMP trap destinations for vCenter server alerts.
    suboptions:
      snmp_receiver_1_community:
        default: public
        description: Community string.
        type: str
      snmp_receiver_1_enabled:
        default: true
        description: Enable receiver.
        type: bool
      snmp_receiver_1_port:
        default: 162
        description: Receiver port.
        type: int
      snmp_receiver_1_url:
        default: localhost
        description: Primary Receiver ULR.
        type: str
      snmp_receiver_2_community:
        default: ''
        description: Community string.
        type: str
      snmp_receiver_2_enabled:
        default: false
        description: Enable receiver.
        type: bool
      snmp_receiver_2_port:
        default: 162
        description: Receiver port.
        type: int
      snmp_receiver_2_url:
        default: ''
        description: Receiver 2 ULR.
        type: str
      snmp_receiver_3_community:
        default: ''
        description: Community string.
        type: str
      snmp_receiver_3_enabled:
        default: false
        description: Enable receiver.
        type: bool
      snmp_receiver_3_port:
        default: 162
        description: Receiver port.
        type: int
      snmp_receiver_3_url:
        default: ''
        description: Receiver 3 ULR.
        type: str
      snmp_receiver_4_community:
        default: ''
        description: Community string.
        type: str
      snmp_receiver_4_enabled:
        default: false
        description: Enable receiver.
        type: bool
      snmp_receiver_4_port:
        default: 162
        description: Receiver port.
        type: int
      snmp_receiver_4_url:
        default: ''
        description: Receiver 4 ULR.
        type: str
    type: dict

user_directory:
    default:
      query_limit: true
      query_limit_size: 5000
      timeout: 60
      validation: true
      validation_period: 1440
    description:
    - The user directory settings for the vCenter server installation.
    suboptions:
      query_limit:
        default: true
        description: Query limit.
        type: bool
      query_limit_size:
        default: 5000
        description: Query limit size.
        type: int
      timeout:
        default: 60
        description: User directory timeout.
        type: int
      validation:
        default: true
        description: Mail Validation.
        type: bool
      validation_period:
        default: 1440
        description: Validation period.
        type: int
    type: dict

validate_certs:
    default: true
    description:
    - Allows connection when SSL certificates are not valid. Set to V(false) when certificates
      are not trusted.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_VALIDATE_CERTS)
      will be used instead.
    type: bool

logging_options:
    choices:
    - none
    - error
    - warning
    - info
    - verbose
    - trivia
    default: info
    description:
    - The level of detail that vCenter server usesfor log files.
    type: str

runtime_settings:
    description:
    - The unique runtime settings for vCenter server.
    suboptions:
      managed_address:
        description: vCenter server managed address.
        type: str
      unique_id:
        description: vCenter server unique ID.
        type: int
      vcenter_server_name:
        description: vCenter server name. Default is FQDN.
        type: str
    type: dict

timeout_settings:
    default:
      long_operations: 120
      normal_operations: 30
    description:
    - The vCenter server connection timeout for normal and long operations.
    suboptions:
      long_operations:
        default: 120
        description: Long operation timeout.
        type: int
      normal_operations:
        default: 30
        description: Normal operation timeout.
        type: int
    type: dict

advanced_settings:
    default: {}
    description:
    - A dictionary of advanced settings.
    type: dict

Outputs

results:
  description:
  - metadata about vCenter settings
  - supported diff mode from version 1.8.0
  returned: always
  sample:
    changed: false
    db_event_cleanup: true
    db_event_retention: 30
    db_max_connections: 50
    db_task_cleanup: true
    db_task_retention: 30
    diff:
      after:
        db_event_cleanup: true
        db_event_retention: 30
        db_max_connections: 50
        db_task_cleanup: true
        db_task_retention: 30
        directory_query_limit: true
        directory_query_limit_size: 5000
        directory_timeout: 60
        directory_validation: true
        directory_validation_period: 1440
        logging_options: info
        mail_sender: vcenter@vcenter01.example.com
        mail_server: mail.example.com
        runtime_managed_address: 192.168.1.10
        runtime_server_name: vcenter01.example.com
        runtime_unique_id: 1
        snmp_receiver_1_community: public
        snmp_receiver_1_enabled: true
        snmp_receiver_1_port: 162
        snmp_receiver_1_url: localhost
        snmp_receiver_2_community: ''
        snmp_receiver_2_enabled: false
        snmp_receiver_2_port: 162
        snmp_receiver_2_url: ''
        snmp_receiver_3_community: ''
        snmp_receiver_3_enabled: false
        snmp_receiver_3_port: 162
        snmp_receiver_3_url: ''
        snmp_receiver_4_community: ''
        snmp_receiver_4_enabled: false
        snmp_receiver_4_port: 162
        snmp_receiver_4_url: ''
        timeout_long_operations: 120
        timeout_normal_operations: 30
      before:
        db_event_cleanup: true
        db_event_retention: 30
        db_max_connections: 50
        db_task_cleanup: true
        db_task_retention: 30
        directory_query_limit: true
        directory_query_limit_size: 5000
        directory_timeout: 60
        directory_validation: true
        directory_validation_period: 1440
        logging_options: info
        mail_sender: vcenter@vcenter01.example.com
        mail_server: mail.example.com
        runtime_managed_address: 192.168.1.10
        runtime_server_name: vcenter01.example.com
        runtime_unique_id: 1
        snmp_receiver_1_community: public
        snmp_receiver_1_enabled: true
        snmp_receiver_1_port: 162
        snmp_receiver_1_url: localhost
        snmp_receiver_2_community: ''
        snmp_receiver_2_enabled: false
        snmp_receiver_2_port: 162
        snmp_receiver_2_url: ''
        snmp_receiver_3_community: ''
        snmp_receiver_3_enabled: false
        snmp_receiver_3_port: 162
        snmp_receiver_3_url: ''
        snmp_receiver_4_community: ''
        snmp_receiver_4_enabled: false
        snmp_receiver_4_port: 162
        snmp_receiver_4_url: ''
        timeout_long_operations: 120
        timeout_normal_operations: 30
    directory_query_limit: true
    directory_query_limit_size: 5000
    directory_timeout: 60
    directory_validation: true
    directory_validation_period: 1440
    logging_options: info
    mail_sender: vcenter@vcenter01.example.com
    mail_server: mail.example.com
    msg: vCenter settings already configured properly
    runtime_managed_address: 192.168.1.10
    runtime_server_name: vcenter01.example.com
    runtime_unique_id: 1
    timeout_long_operations: 120
    timeout_normal_operations: 30
  type: dict