community.vmware.vcenter_domain_user_group_info (4.2.0) — module

Gather user or group information of a domain

Authors: sky-joker (@sky-joker)

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 gather information about user or group of a domain.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather all domain user and group of vsphere.local
  community.vmware.vcenter_domain_user_group_info:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    domain: vsphere.local
    search_string: ''
  register: gather_all_domain_user_group_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather all domain user and group included the administrator string
  community.vmware.vcenter_domain_user_group_info:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    domain: vsphere.local
    search_string: administrator
  register: gather_domain_user_group_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather all domain user of vsphere.local
  community.vmware.vcenter_domain_user_group_info:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    domain: vsphere.local
    search_string: ''
    find_users: true
    find_groups: false
  register: gather_all_domain_user_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather administrator user by exact match condition
  community.vmware.vcenter_domain_user_group_info:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    domain: vsphere.local
    search_string: "vsphere.local\\administrator"
    exact_match: true
  register: gather_administrator_user_exact_match_result

Inputs

    
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

domain:
    default: vsphere.local
    description:
    - The I(domain) to be specified searching.
    type: str

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

find_users:
    default: true
    description:
    - If V(true), domain users will be included in the result.
    type: bool

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

exact_match:
    default: false
    description:
    - If V(true), it indicates the O(search_string) passed should match a user or group
      name exactly.
    type: bool

find_groups:
    default: true
    description:
    - If V(true), domain groups will be included in the result.
    type: bool

search_string:
    description:
    - The I(search_string) is a string to be specified searching.
    - Specify the domain user or group name to be searched.
    required: true
    type: str

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

belongs_to_user:
    description:
    - If a user existing, returned contains only groups that directly contain the specified
      user.
    type: str

belongs_to_group:
    description:
    - If a group existing, returned contains only users or groups that directly belong
      to the specified group.
    type: str

Outputs

domain_user_groups:
  description: list of domain user and group information
  returned: success
  sample: "[\n    {\n        \"fullName\": \"Administrator vsphere.local\",\n    \
    \    \"group\": false,\n        \"principal\": \"Administrator\"\n    }\n]"
  type: list