salt.states.infoblox_host_record

Infoblox host record management.

functions accept api_opts:

api_verifyssl: verify SSL [default to True or pillar value] api_url: server to connect to [default to pillar value] api_username: [default to pillar value] api_password: [default to pillar value]

salt.states.infoblox_host_record.absent(name=None, ipv4addr=None, mac=None, **api_opts)

Ensure the host with the given Name ipv4addr or mac is removed.

State example:

infoblox_host_record.absent:
    - name: hostname.of.record.to.remove

infoblox_host_record.absent:
    - name:
    - ipv4addr: 192.168.0.1

infoblox_host_record.absent:
    - name:
    - mac: 12:02:12:31:23:43

salt.states.infoblox_host_record.present(name=None, data=None, ensure_data=True, **api_opts)

This will ensure that a host with the provided name exists. This will try to ensure that the state of the host matches the given data If the host is not found then one will be created.

When trying to update a hostname ensure name is set to the hostname of the current record. You can give a new name in the data.name.

Avoid race conditions, use func:nextavailableip:
  • func:nextavailableip:network/ZG54dfgsrDFEFfsfsLzA:10.0.0.0/8/default

  • func:nextavailableip:10.0.0.0/8

  • func:nextavailableip:10.0.0.0/8,externalconfigure_for_dns

  • func:nextavailableip:10.0.0.3-10.0.0.10

State Example:

# this would update `original_hostname.example.ca` to changed `data`.
infoblox_host_record.present:
    - name: original_hostname.example.ca
    - data: {'namhostname.example.cae': 'hostname.example.ca',
        'aliases': ['hostname.math.example.ca'],
        'extattrs': [{'Business Contact': {'value': '[email protected]'}}],
        'ipv4addrs': [{'configure_for_dhcp': True,
            'ipv4addr': 'func:nextavailableip:129.97.139.0/24',
            'mac': '00:50:56:84:6e:ae'}],
        'ipv6addrs': [], }

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/states/all/salt.states.infoblox_host_record.html