Coder Social home page Coder Social logo

ansible-isc-dhcp's Introduction

ansible-isc-dhcp

An Ansible role to install/configure ISC-DHCP server(s)

  • Configurable options
  • Failover and load balancing ready

Requirements

Scopes

Define your DHCP Scopes

isc_dhcp_scopes:
  - subnet: 192.168.250.0
    default_lease_time: "{{ isc_dhcp_default_lease_time }}"
    max_lease_time: "{{ isc_dhcp_max_lease_time }}"
    netmask: 255.255.255.0
    # Define scope specific options to configure
    options:
      - name: routers
        value: 192.168.250.1
      - name: subnet-mask
        value: 255.255.255.0
      - name: broadcast-address
        value: 192.168.250.255
      - name: domain-name-servers
        value: "{{ isc_dhcp_name_servers|join (', ') }}"
    range_start: 192.168.250.128
    range_end: 192.168.250.224

Failover scopes

For failover define the following vars to fit your deployment...

isc_dhcp_failover_info:
  # ansible_default_ipv4.address|ansible_enp0s8.ipv4.address
  # Defines failover address for dhcp failover setup
  failover_address: "{{ ansible_default_ipv4.address }}"
  # Define Ansible inventory group that nodes belong to
  failover_group: dhcp-nodes
  # Define the node in which should be considered the primary
  primary: "{{ groups['dhcp-nodes'][0] }}"
  # Define the port to be used on primary node
  primary_port: "519"
  # Define the node in which should be considered the secondary
  secondary: "{{ groups['dhcp-nodes'][1] }}"
  # Define the port to be used on secondary node
  secondary_port: "520"

Role Variables

defaults/main.yml

Dependencies

None

Example Playbook

---
- hosts: dhcp-nodes
  vars:
    isc_dhcp_scopes:
      - subnet: 192.168.250.0
        default_lease_time: "{{ isc_dhcp_default_lease_time }}"
        max_lease_time: "{{ isc_dhcp_max_lease_time }}"
        netmask: 255.255.255.0
        # Define scope specific options to configure
        options:
          - name: routers
            value: 192.168.250.1
          - name: subnet-mask
            value: 255.255.255.0
          - name: broadcast-address
            value: 192.168.250.255
          - name: domain-name-servers
            value: "{{ isc_dhcp_name_servers|join (', ') }}"
        range_start: 192.168.250.128
        range_end: 192.168.250.224
  roles:
    - role: ansible-isc-dhcp

License

MIT

Author Information

Larry Smith Jr.

ansible-isc-dhcp's People

Contributors

mejo- avatar mrlesmithjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-isc-dhcp's Issues

Ability to pass variables to playbooks from CSV at commandline

I am looking for a way to pass all IP and host information from a variable file which would be loaded at run time. This file would be loaded when the playbook is run. so the command would be "ansible-playbook buildPi.yml PiList.csv" The buildPi.yml is the playbook which has the individual playbooks to install the various packages needed on the Raspberry Pi. The PiList.csv would be a CSV variable list of the hostnames, IP addresses and Networks for each item needed in the playbooks. That way we don't have to go in and change any of the playlists and run the risk of breaking them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.