Tip

Check out the repository on GitHub

DHCRelay - Relay

STATE: unstable

TESTS: Playbook

API Docs: Core - DHCRelay

Service Docs: DHCRelay

Contribution

Thanks to @jiuka for developing this module!

Definition

Definition

Parameter

Type

Required

Default

Aliases

Comment

enabled

boolean

false

false

-

Enable or disable this relay

interface

string

true

i, int

The interface to relay DHCP requests from

destination

string

true

-

dest

The destination server group to relay DHCP requests to

agent_info

boolean

false

false

-

Add the relay agent information option

reload

boolean

false

true

-

If the running config should be reloaded on change - this may take some time. For mass-managing items you might want to reload it ‘manually’ after all changes are done => using the ansibleguy.opnsense.reload module.

For basic parameters see: Basic

Info

This module manages DHCRelay relays. Each interface can be assigned a single relay.

Note: You can also use the shortform module name: ansibleguy.opnsense.dhcrelay

Examples

- hosts: localhost
  gather_facts: no
  module_defaults:
    group/ansibleguy.opnsense.all:
      firewall: 'opnsense.template.ansibleguy.net'
      api_credential_file: '/home/guy/.secret/opn.key'

    ansibleguy.opnsense.list:
      target: 'dhcrelay_relay'

  tasks:
    - name: Example
      ansibleguy.opnsense.dhcrelay_relay:
        interface: 'lan'
        destination: mydhcp
        # enabled: false
        # agent_info: false
        # state: 'present'
        # reload: true
        # debug: false

    - name: Adding
      ansibleguy.opnsense.dhcrelay_relay:
        interface: 'lan'
        destination: mydhcp

    - name: Removing
      ansibleguy.opnsense.dhcrelay_relay:
        interface: 'lan'
        destination: mydhcp
        state: 'absent'

    - name: Listing
      ansibleguy.opnsense.list:
      #  target: 'dhcrelay_relay'
      register: existing_entries

    - name: Printing dhcrelay relays
      ansible.builtin.debug:
        var: existing_entries.data