W3cubDocs

/Ansible

ipa_hostgroup - Manage FreeIPA host-group

New in version 2.3.

Synopsis

  • Add, modify and delete an IPA host-group using IPA API

Options

parameter required default choices comments
cn
yes
Name of host-group.
Can not be changed as it is the unique identifier.
aliases: name
description
no
Description
host
no
List of hosts that belong to the host-group.
If an empty list is passed all hosts will be removed from the group.
If option is omitted hosts will not be checked or changed.
If option is passed all assigned hosts that are not passed will be unassigned from the group.
hostgroup
no
List of host-groups than belong to that host-group.
If an empty list is passed all host-groups will be removed from the group.
If option is omitted host-groups will not be checked or changed.
If option is passed all assigned hostgroups that are not passed will be unassigned from the group.
ipa_host
no ipa.example.com
IP or hostname of IPA server
ipa_pass
yes
Password of administrative user
ipa_port
no 443
Port of IPA server
ipa_prot
no https
  • http
  • https
Protocol used by IPA server
ipa_user
no admin
Administrative account used on IPA server
state
no present
  • present
  • absent
State to ensure.
validate_certs
no True
This only applies if ipa_prot is https.
If set to no, the SSL certificates will not be validated.
This should only set to no used on personally controlled sites using self-signed certificates.

Examples

# Ensure host-group databases is present
- ipa_hostgroup:
    name: databases
    state: present
    host:
    - db.example.com
    hostgroup:
    - mysql-server
    - oracle-server
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret

# Ensure host-group databases is absent
- ipa_hostgroup:
    name: databases
    state: absent
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret

Return Values

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

name description returned type sample
hostgroup
Hostgroup as returned by IPA API.
always dict

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/ipa_hostgroup_module.html