ansible.builtin.ipa_host (v2.4.3.0-1) — module

Manage FreeIPA host

| "added in version" 2.3 of ansible.builtin"

Authors: Thomas Krahn (@Nosmoht)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.3.0.post1

Description

Add, modify and delete an IPA host using IPA API

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure host is present
- ipa_host:
    name: host01.example.com
    description: Example host
    ip_address: 192.168.0.123
    ns_host_location: Lab
    ns_os_version: CentOS 7
    ns_hardware_platform: Lenovo T61
    mac_address:
    - "08:00:27:E3:B1:2D"
    - "52:54:00:BD:97:1E"
    state: present
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure host is disabled
- ipa_host:
    name: host01.example.com
    state: disabled
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure that all user certificates are removed
- ipa_host:
    name: host01.example.com
    user_certificate: []
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure host is absent
- ipa_host:
    name: host01.example.com
    state: absent
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret

Inputs

    
fqdn:
    aliases:
    - name
    description:
    - Full qualified domain name.
    - Can not be changed as it is the unique identifier.
    required: true

force:
    description:
    - Force host name even if not in DNS.
    required: false

state:
    choices:
    - present
    - absent
    - disabled
    default: present
    description: State to ensure
    required: false

ipa_host:
    default: ipa.example.com
    description: IP or hostname of IPA server
    required: false

ipa_pass:
    description: Password of administrative user
    required: true

ipa_port:
    default: 443
    description: Port of IPA server
    required: false

ipa_prot:
    choices:
    - http
    - https
    default: https
    description: Protocol used by IPA server
    required: false

ipa_user:
    default: admin
    description: Administrative account used on IPA server
    required: false

ip_address:
    description:
    - Add the host to DNS with this IP address.
    required: false

description:
    description:
    - A description of this host.
    required: false

mac_address:
    aliases:
    - macaddress
    description:
    - List of Hardware MAC address(es) off this host.
    - If option is omitted MAC addresses will not be checked or changed.
    - If an empty list is passed all assigned MAC addresses will be removed.
    - MAC addresses that are already assigned but not passed will be removed.
    required: false

ns_os_version:
    aliases:
    - nsosversion
    description:
    - Host operating system and version (e.g. "Fedora 9")
    required: false

validate_certs:
    default: true
    description:
    - This only applies if C(ipa_prot) is I(https).
    - If set to C(no), the SSL certificates will not be validated.
    - This should only set to C(no) used on personally controlled sites using self-signed
      certificates.
    required: false

ns_host_location:
    aliases:
    - nshostlocation
    description:
    - Host location (e.g. "Lab 2")
    required: false

user_certificate:
    aliases:
    - usercertificate
    description:
    - List of Base-64 encoded server certificates.
    - If option is omitted certificates will not be checked or changed.
    - If an empty list is passed all assigned certificates will be removed.
    - Certificates already assigned but not passed will be removed.
    required: false

ns_hardware_platform:
    aliases:
    - nshardwareplatform
    description:
    - Host hardware platform (e.g. "Lenovo T61")
    required: false

Outputs

host:
  description: Host as returned by IPA API.
  returned: always
  type: dict
host_diff:
  description: List of options that differ and would be changed
  returned: if check mode and a difference is found
  type: list