freeipa.ansible_freeipa.ipahostgroup (1.11.1) — module

Manage FreeIPA hostgroups

Authors: Thomas Woerner (@t-woerner)

preview | supported by community

Install collection

Install with ansible-galaxy collection install freeipa.ansible_freeipa:==1.11.1


Add to requirements.yml

  collections:
    - name: freeipa.ansible_freeipa
      version: 1.11.1

Description

Manage FreeIPA hostgroups

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure host-group databases is present
- freeipa.ansible_freeipa.ipahostgroup:
    ipaadmin_password: SomeADMINpassword
    name: databases
    host:
    - db.example.com
    hostgroup:
    - mysql-server
    - oracle-server
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure hosts and hostgroups are present in existing databases hostgroup
- freeipa.ansible_freeipa.ipahostgroup:
    ipaadmin_password: SomeADMINpassword
    name: databases
    host:
    - db.example.com
    hostgroup:
    - mysql-server
    - oracle-server
    action: member
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure hosts and hostgroups are absent in databases hostgroup
- freeipa.ansible_freeipa.ipahostgroup:
    ipaadmin_password: SomeADMINpassword
    name: databases
    host:
    - db.example.com
    hostgroup:
    - mysql-server
    - oracle-server
    action: member
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Rename hostgroup
- freeipa.ansible_freeipa.ipahostgroup:
    ipaadmin_password: SomeADMINpassword
    name: databases
    rename: datalake
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure host-group databases is absent
- freeipa.ansible_freeipa.ipahostgroup:
    ipaadmin_password: SomeADMINpassword
    name: databases
    state: absent

Inputs

    
host:
    description: List of host names assigned to this hostgroup.
    elements: str
    required: false
    type: list

name:
    aliases:
    - cn
    description: The hostgroup name
    elements: str
    required: true
    type: list

state:
    choices:
    - present
    - absent
    - renamed
    default: present
    description: State to ensure
    type: str

action:
    choices:
    - member
    - hostgroup
    default: hostgroup
    description: Work on hostgroup or member level
    type: str

rename:
    aliases:
    - new_name
    description:
    - Rename hostgroup to the given name.
    - Only usable with IPA versions 4.8.7 and up.
    required: false
    type: str

hostgroup:
    description: List of hostgroup names assigned to this hostgroup.
    elements: str
    required: false
    type: list

nomembers:
    description: Suppress processing of membership attributes
    required: false
    type: bool

description:
    description: The hostgroup description
    required: false
    type: str

ipaapi_context:
    choices:
    - server
    - client
    description: 'The context in which the module will execute. Executing in a

      server context is preferred. If not provided context will be

      determined by the execution environment.

      '
    required: false
    type: str

ipaadmin_password:
    description: The admin password.
    required: false
    type: str

ipaapi_ldap_cache:
    default: true
    description: Use LDAP cache for IPA connection.
    type: bool

ipaadmin_principal:
    default: admin
    description: The admin principal.
    type: str

membermanager_user:
    description:
    - List of member manager users assigned to this hostgroup.
    - Only usable with IPA versions 4.8.4 and up.
    elements: str
    required: false
    type: list

membermanager_group:
    description:
    - List of member manager groups assigned to this hostgroup.
    - Only usable with IPA versions 4.8.4 and up.
    elements: str
    required: false
    type: list