damhau.infoblox
Infoblox
This guide explains how to use the Infoblox REST API.
Requirements
You need access to the Infoblox REST API.
Role Variables
Default settings are found in
defaults/main.yml
for these variables:infoblox_url
: The URL of your Infoblox appliance.infoblox_action
: The action to perform with the API (options: create, delete, read, update).infoblox_recordtype
: The type of Infoblox record (options: A, PTR, host, CNAME).infoblox_view
: The Infoblox view to use.
You will also need these variables for your Infoblox credentials:
infoblox_username
infoblox_password
Variables for API request fields (detailed in this document):
- Each field is prefixed with
infoblox_
:infoblox_ipv4addr
infoblox_comment
infoblox_canonical
infoblox_name
- Each field is prefixed with
How to run the tests
- Navigate to the tests directory:
cd tests/roles ln -s ../../../infoblox/ damhau.infoblox cd ../.. # Go back to the tests directory
- Run the Ansible playbook:
ansible-playbook -i inventory test.yml -t a # Replace 'a' with your desired record type: a, cname, ptr, host
Example Playbook
- hosts: localhost
connection: local
gather_facts: false
vars:
infoblox_username: 'user' # Your Infoblox username
infoblox_password: 'pass' # Your Infoblox password
infoblox_hostname: 'infobloxfqdn' # The FQDN of your Infoblox
infoblox_view: 'default' # The Infoblox view
tasks:
- include_role:
name: damhau.infoblox
vars:
infoblox_name: 'newhost.dhconsulting.ch' # Hostname you want to create
infoblox_ipv4addr: '1.1.1.1' # IP address
infoblox_recordtype: 'host' # Record type
infoblox_action: 'create' # Action to take
- include_role:
name: damhau.infoblox
vars:
infoblox_name: 'newhost.dhconsulting.ch' # Hostname you want to delete
infoblox_recordtype: 'host' # Record type
infoblox_action: 'delete' # Action to take
License
BSD
Informazioni sul progetto
Role to consume Infoblox Rest API
Installa
ansible-galaxy install damhau.infoblox
Licenza
Unknown
Download
88
Proprietario