Tip

Check out the repository on GitHub

DHCRelay - Destinations

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

name

string

true

-

Unique name for this relay destination

server

list of strings

true

-

-

List of server IP addresses to relay DHCP requests to

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 destinations. A destination can contain multiple IP addresses.

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

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_destination'

  tasks:
    - name: Example
      ansibleguy.opnsense.dhcrelay_destination:
        name: 'mydhcp'
        server:
          - '192.168.0.1'
        # state: 'present'
        # reload: true
        # debug: false

    - name: Adding
      ansibleguy.opnsense.dhcrelay_destination:
        name: 'mydhcp'
        server:
          - '192.168.0.1'

    - name: Removing
      ansibleguy.opnsense.dhcrelay_destination:
        name: 'mydhcp'
        server:
          - '192.168.0.1'
        state: 'absent'

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

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