Browse Source

Replaced external generic dhcp role with specialiced internal role

Till Klocke 9 years ago
parent
commit
98bdc90c00

+ 0 - 27
roles/external/pdellaert.dhcp_server/LICENSE.md

@@ -1,27 +0,0 @@
-Copyright (c) 2013, Philippe Dellaert
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-   This product includes software developed by Philippe Dellaert.
-4. Neither the name of Philippe Dellaert nor the
-   names of its contributors may be used to endorse or promote products
-   derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY PHILIPPE DELLAERT ''AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL PHILIPPE DELLAERT BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 0 - 250
roles/external/pdellaert.dhcp_server/README.md

@@ -1,250 +0,0 @@
-dhcp_server
-===========
-
-This role installs and configures a DHCP server.
-
-Requirements
-------------
-
-This role requires Ansible 1.4 or higher and platform requirements are listed in the metadata file.
-
-Ubuntu AppArmor
----------------
-Since Ubuntu 14.04, AppArmor is configured to not allow dhcpd to access files outside a certain list of paths.
-This prevents Ansible from running the check command on the template. The check is used to validate the correctness of the config file generated.
-
-To prevent this, you can either disable AppArmor, manually configure it in such a way that it allows access to `/root/.ansible/tmp` for dhcpd or you can let this role do that for you:
-
-If you specify the `configure_apparmor: true` variable for your host. This role will overwrite the `/etc/apparmor.d/local/usr.bin.dhcpd` file and specifically allow read-only access to `/root/.ansible/tmp`. It will first check if this file exists, if it does not, it will not do anything.
-
-Difference between global and subnet interface options
--------------------------------------------------------
-Global dhcp_interfaces option makes listen on defined interfaces all subnets. Interface per subnet definition allows listen as much subnets as you want.
-Global dhcp_interfaces option does not work on systemd distros (ArchLinux, CentOS 7, Fedora), listen by default on interface with declared subnet. You cat rewrite systemd service, but is dirty. Instead this, describe interfaces in configuration. Is modern and properly.
-
-Role Variables
---------------
-
-The variables that can be passed to this role and a brief description about
-them are as follows. These are all based on the configuration variables of the
-DHCP server configuration.
-
-    # AppArmor configuration - important for Ubuntu 14.04
-    configure_apparmor: true
-
-    # Basic configuration information
-    dhcp_use_ansible_managed: true|false (default is true)
-    dhcp_interfaces: eth0
-    dhcp_common_domain: example.org
-    dhcp_common_nameservers: ns1.example.org, ns2.example.org
-    dhcp_common_default_lease_time: 600
-    dhcp_common_max_lease_time: 7200
-    dhcp_common_ddns_update_style: none
-    dhcp_common_authoritative: true
-    dhcp_common_log_facility: local7
-    dhcp_common_options:
-    - opt66 code 66 = string
-    dhcp_common_parameters:
-    - filename "pxelinux.0"
-
-    # DDNS configuration
-    dhcp_ddns_client_updates: true|false (default is false)
-    dhcp_ddns_updates: true|false (default is true)
-    dhcp_ddns_unknown_clients: true|false (default is false)
-    dhcp_ddns_update_static_leases: true|false (default is false)
-    dhcp_ddns_update_style: interim
-    dhcp_ddns_keys:
-      - the_key_name: the_key_value
-    dhcp_ddns_zones:
-      -
-        name:example.org
-        primary: 192.168.0.1
-        key: a_key_name_from_dhcp_ddns_keys_list
-
-    # Subnet configuration
-    dhcp_subnets:
-    # Required variables example
-    - base: 192.168.1.0
-      netmask: 255.255.255.0
-    # Full list of possibilities
-    - base: 192.168.10.0
-      netmask: 255.255.255.0
-      interface: vlan100
-      range_start: 192.168.10.150
-      range_end: 192.168.10.200
-      routers: 192.168.10.1
-      broadcast_address: 192.168.10.255
-      domain_nameservers: 192.168.10.1, 192.168.10.2
-      domain_name: example.org
-      ntp_servers: pool.ntp.org
-      default_lease_time: 3600
-      max_lease_time: 7200
-      pools:
-      - range_start: 192.168.100.10
-        range_end: 192.168.100.20
-        rule: 'allow members of "foo"'
-        parameters:
-        - filename "pxelinux.0"
-      - range_start: 192.168.110.10
-        range_end: 192.168.110.20
-        rule: 'deny members of "foo"'
-      parameters:
-      - filename "pxelinux.0"
-
-    # Fixed lease configuration
-    dhcp_hosts:
-    - name: local-server
-      mac_address: "00:11:22:33:44:55"
-      fixed_address: 192.168.10.10
-      default_lease_time: 43200
-      max_lease_time: 86400
-      parameters:
-      - filename "pxelinux.0"
-
-    # Class configuration
-    dhcp_classes:
-    - name: foo
-      rule: 'match if substring (option vendor-class-identifier, 0, 4) = "SUNW"'
-    - name: CiscoSPA
-      rule: 'match if (( substring (option vendor-class-identifier,0,13) = "Cisco SPA504G" ) or
-             ( substring (option vendor-class-identifier,0,12) = "Cisco SPA303" ))'
-      options:
-      - opt: 'opt66 "http://distrib.local/cisco.php?mac=$MAU"'
-      - opt: 'time-offset 21600'
-
-    # Shared network configurations
-    dhcp_shared_networks:
-    - name: shared-net
-      interface: vlan100
-      subnets:
-      - base: 192.168.100.0
-        netmask: 255.255.255.0
-        routers: 192.168.10.1
-      parameters:
-      - filename "pxelinux.0"
-      pools:
-      - range_start: 192.168.100.10
-        range_end: 192.168.100.20
-        rule: 'allow members of "foo"'
-        parameters:
-        - filename "pxelinux.0"
-      - range_start: 192.168.110.10
-        range_end: 192.168.110.20
-        rule: 'deny members of "foo"'
-
-    # Custom if else clause
-      dhcp_ifelse:
-      - condition: 'exists user-class and option user-class = "iPXE"'
-        val: 'filename "http://my.web.server/real_boot_script.php";'
-        else:
-          - val: 'filename "pxeboot.0";'
-          - val: 'filename "pxeboot.1";'
-
-Examples
-========
-
-1) Install DHCP server on interface eth0 with one simple subnet:
-
-    - hosts: all
-      roles:
-      - role: dhcp_server
-        dhcp_interfaces: eth0
-        dhcp_common_domain: example.org
-        dhcp_common_nameservers: ns1.example.org, ns2.example.org
-        dhcp_common_default_lease_time: 600
-        dhcp_common_max_lease_time: 7200
-        dhcp_common_ddns_update_style: none
-        dhcp_common_authoritative: true
-        dhcp_common_log_facility: local7
-        dhcp_subnets:
-        - base: 192.168.10.0
-          netmask: 255.255.255.0
-          range_start: 192.168.10.150
-          range_end: 192.168.10.200
-          routers: 192.168.10.1
-
-
-2) Install DHCP server with subnet per interface:
-
-    - hosts: all
-      roles:
-      - role: dhcp_server
-        dhcp_common_domain: example.org
-        dhcp_common_nameservers: ns1.example.org, ns2.example.org
-        dhcp_common_default_lease_time: 600
-        dhcp_common_max_lease_time: 7200
-        dhcp_common_ddns_update_style: none
-        dhcp_common_authoritative: true
-        dhcp_common_log_facility: local7
-        dhcp_subnets:
-        - base: 192.168.10.0
-          netmask: 255.255.255.0
-          interface: vlan10
-          range_start: 192.168.10.150
-          range_end: 192.168.10.200
-          routers: 192.168.10.1
-        - base: 192.168.20.0
-          netmask: 255.255.255.0
-          interface: vlan20
-          range_start: 192.168.20.150
-          range_end: 192.168.20.200
-          routers: 192.168.20.1
-
-
-3) Install DHCP server with one subnet on interface vlan10 and with shared network on interface vlan20
-
-    - hosts: all
-      roles:
-      - role: dhcp_server
-        dhcp_common_default_lease_time: 600
-        dhcp_common_max_lease_time: 7200
-        dhcp_common_ddns_update_style: none
-        dhcp_common_authoritative: true
-        dhcp_common_log_facility: local7
-        dhcp_subnets:
-        - base: 192.168.10.0
-          netmask: 255.255.255.0
-          interface: vlan10
-          domain_nameserver: 192.168.10.1
-          domain_name: example.local
-          range_start: 192.168.10.150
-          range_end: 192.168.10.200
-          routers: 192.168.10.1
-        dhcp_shared_networks:
-        - name: sharednet
-          interface: vlan20
-          subnets:
-          - base: 10.7.0.0
-            netmask: 255.255.255.0
-            routers: 10.7.0.1
-            domain_nameserver: 10.7.0.1
-            domain_name: example.public0
-            ntp_servers: 10.7.0.1
-            pools:
-            - range_start: 10.7.0.2
-              range_end: 10.7.0.254
-          - base: 10.8.0.0
-            netmask: 255.255.255.0
-            routers: 10.8.0.1
-            domain_nameserver: 10.8.0.1
-            domain_name: example.public1
-            ntp_servers: 10.8.0.1
-            pools:
-            - range_start: 10.8.0.2
-              range_end: 10.8.0.254
-
-
-Dependencies
-------------
-
-None
-
-License
--------
-
-BSD
-
-Author Information
-------------------
-
-Philippe Dellaert

+ 0 - 13
roles/external/pdellaert.dhcp_server/defaults/main.yml

@@ -1,13 +0,0 @@
----
-configure_apparmor: false
-dhcp_ddns_client_updates: true
-dhcp_ddns_unknown_clients: false
-dhcp_ddns_update_static_leases: false
-dhcp_ddns_update_style: interim
-dhcp_ddns_updates: false
-dhcp_use_ansible_managed: true
-dhcp_interfaces: eth0
-dhcp_subnets: []
-dhcp_hosts: []
-dhcp_classes: []
-dhcp_shared_networks: []

+ 0 - 3
roles/external/pdellaert.dhcp_server/files/apparmor/usr.sbin.dhcpd

@@ -1,3 +0,0 @@
-# Site-specific additions and overrides for usr.sbin.dhcpd.
-# For more details, please see /etc/apparmor.d/local/README.
-/root/.ansible/tmp/** r,

+ 0 - 6
roles/external/pdellaert.dhcp_server/handlers/main.yml

@@ -1,6 +0,0 @@
----
-- name: restart dhcpd
-  service: name={{ dhcp_service }} state=restarted
-
-- name: restart apparmor
-  service: name={{ apparmor_service }} state=restarted

+ 0 - 1
roles/external/pdellaert.dhcp_server/meta/.galaxy_install_info

@@ -1 +0,0 @@
-{install_date: 'Sat Dec 19 23:08:10 2015', version: master}

+ 0 - 31
roles/external/pdellaert.dhcp_server/meta/main.yml

@@ -1,31 +0,0 @@
----
-galaxy_info:
-  author: "Philippe Dellaert"
-  company: http://dellaert.org
-  license: BSD
-  min_ansible_version: 1.4
-  platforms:
-   - name: EL
-     versions:
-      - 5
-      - 6
-      - 7
-   - name: Fedora
-     versions:
-      - 16
-      - 17
-      - 18
-   - name: Ubuntu
-     versions:
-      - precise
-      - quantal
-      - raring
-      - saucy
-      - trusty
-   - name: Archlinux
-     versions:
-       - all
-  categories:
-   - system
-   - networking
-dependencies: []

+ 0 - 53
roles/external/pdellaert.dhcp_server/tasks/main.yml

@@ -1,53 +0,0 @@
----
-# Loading vars
-- name: Add the OS specific varibles
-  include_vars: "{{ ansible_os_family }}.yml"
-
-# Install DHCP server
-- name: Install the required  packages in Redhat derivatives
-  yum: name={{ dhcp_server_package }} state=installed
-  when: ansible_os_family == 'RedHat'
-
-- name: Install the required packages in Debian derivatives
-  apt: name={{ dhcp_server_package }} state=installed update_cache=yes
-  when: ansible_os_family == 'Debian'
-
-- name: Install the required packages in ArchLinux derivatives
-  pacman: name={{ dhcp_server_package }} state=installed update_cache=yes
-  when: ansible_os_family == 'Archlinux'
-
-# Configuring AppArmor if requested
-- name: Check if the /etc/apparmor.d/local folder exists
-  stat: path=/etc/apparmor.d/local
-  when: configure_apparmor
-  register: apparmor_local
-
-- name: Configure AppArmor to allow dhcpd access to temporary ansible files for configuration checking
-  copy: src=apparmor/usr.sbin.dhcpd dest=/etc/apparmor.d/local/usr.sbin.dhcpd owner=root group=root mode=0644
-  when: configure_apparmor and apparmor_local.stat.exists
-  notify:
-    - restart apparmor
-
-- meta: flush_handlers
-
-# Set desired permissions on /etc/dhcp or use defaults
-- name: Set permissions on /etc/dhcp
-  file: path=/etc/dhcp state=directory mode={{ dhcp_dir_mode | default("0750") }}
-  when: "ansible_os_family == 'Debian' or ansible_os_family == 'RedHat'"
-
-# Generate configuration
-- name: Generate dhcpd.conf
-  template: src=dhcpd.conf.j2 dest={{ dhcp_server_config }} owner=root group=root mode=0644 validate='/usr/sbin/dhcpd -t -cf %s'
-  notify:
-    - restart dhcpd
-
-# Generate service configuration
-- name: Generate DHCP service conf
-  template: src=service.conf.{{ ansible_os_family }}.j2 dest={{ dhcp_service_config }} owner=root group=root
-  when: ansible_os_family == 'Debian' or (ansible_os_family == 'RedHat' and ansible_distribution_major_version < '7')
-  notify:
-    - restart dhcpd
-
-# Enable DHCP server
-- name: Start the dhcp services DHCP
-  service: name={{ dhcp_service }} state=started enabled=yes

+ 0 - 271
roles/external/pdellaert.dhcp_server/templates/dhcpd.conf.j2

@@ -1,271 +0,0 @@
-## dhcpd.conf
-{% if dhcp_use_ansible_managed %}# {{ ansible_managed }}{% endif %}
-# Do not edit manually
-
-{% if dhcp_omapi_port is defined %}
-omapi-port {{ dhcp_omapi_port }};
-{% endif %}
-# option definitions common to all supported networks...
-{% if dhcp_common_domain is defined %}
-
-option domain-name "{{ dhcp_common_domain }}";
-{% endif %}
-{% if dhcp_common_nameservers is defined %}
-option domain-name-servers {{ dhcp_common_nameservers }};
-{% endif %}
-{% if dhcp_common_default_lease_time is defined %}
-default-lease-time {{ dhcp_common_default_lease_time }};
-{% endif %}
-{% if dhcp_common_max_lease_time is defined %}
-max-lease-time {{ dhcp_common_max_lease_time }};
-{% endif %}
-
-# Dynamic DNS
-ddns-updates {{ dhcp_ddns_updates | ternary("on", "off") }};
-ddns-update-style {{ dhcp_ddns_update_style }};
-{{ dhcp_ddns_client_updates | ternary("allow", "ignore") }} client-updates;
-{{ dhcp_ddns_unknown_clients | ternary("allow", "ignore") }} unknown-clients;
-update-static-leases {{ dhcp_ddns_update_static_leases | ternary("on", "off") }};
-
-{% if dhcp_ddns_keys is defined %}
-{% for key in dhcp_ddns_keys %}
-key {{ key.name }} {
-  algorithm hmac-md5;
-  secret {{ key.value }};
-}
-
-{% endfor %}
-{% endif %}
-{% if dhcp_ddns_zones is defined %}
-{% for zone in dhcp_ddns_zones %}
-zone {{ zone.name }}. {
-  primary {{ zone.primary }};
-  key {{ zone.key }};
-}
-
-{% endfor %}
-{% endif %}
-{% if dhcp_common_authoritative is defined %}
-# If this DHCP server is the official DHCP server for the local
-# network, the authoritative directive should be uncommented.
-authoritative;
-{% endif %}
-{% if dhcp_common_log_facility is defined %}
-
-# Use this to send dhcp log messages to a different log file (you also
-# have to hack syslog.conf to complete the redirection).
-log-facility {{ dhcp_common_log_facility }};
-{% endif %}
-{% if dhcp_common_options is defined %}
-
-{% if dhcp_common_enable_pxe_boot %}
-filename "{{ dhcp_common_pxe_boot_file }}";
-next-server {{ dhcp_common_pxe_boot_server }};
-{% endif %}
-
-#DHCP options
-{% for o in dhcp_common_options %}
-option {{ o }};
-{% endfor %}
-{% endif %}
-{% if dhcp_common_parameters is defined %}
-
-#DHCP parameters
-{% for p in dhcp_common_parameters %}
-{{ p }};
-{% endfor %}
-{% endif %}
-{% if dhcp_classes is defined %}
-
-# Classes
-{% for c in dhcp_classes %}
-class "{{ c.name }}" {
-  {{ c.rule }};
-{% if c.options is defined %}
-{% for i in c.options %}
-  option {{ i.opt }};
-{% endfor %}
-{% endif %}
-}
-{% endfor %}
-{% endif %}
-
-{% if dhcp_hosts is defined %}
-# Hosts
-{% for h in dhcp_hosts %}
-host {{ h.name }} {
-  hardware ethernet {{ h.mac_address }};
-  ddns-hostname {{ h.name }};
-{% if h.fixed_address is defined %}
-  fixed-address {{ h.fixed_address }};
-{% endif %}
-{% if h.routers is defined %}
-  option routers {{ h.routers }};
-{% endif %}
-{% if h.broadcast_address is defined %}
-  option broadcast-address {{ h.broadcast_address }};
-{% endif %}
-{% if h.domain_nameservers is defined %}
-  option domain-name-servers {{ h.domain_nameservers }};
-{% endif %}
-{% if h.domain_name is defined %}
-  option domain-name "{{ h.domain_name }}";
-{% endif %}
-{% if h.default_lease_time is defined %}
-  default-lease-time {{ h.default_lease_time }};
-{% endif %}
-{% if h.max_lease_time is defined %}
-  max-lease-time {{ h.max_lease_time }};
-{% endif %}
-{% if h.parameters is defined %}
-{% for p in h.parameters %}
-  {{ p }};
-{% endfor %}
-{% endif %}
-}
-{% endfor %}
-{% endif %}
-
-{% if dhcp_subnets is defined %}
-# Subnets
-{% for s in dhcp_subnets %}
-subnet {{ s.base }} netmask {{ s.netmask }} {
-{% if s.interface is defined %}
-  interface "{{ s.interface }}";
-{% endif %}
-{% if s.range_start is defined %}
-  range {{ s.range_start }} {{ s.range_end }};
-{% endif %}
-{% if s.routers is defined %}
-  option routers {{ s.routers }};
-{% endif %}
-{% if s.broadcast_address is defined %}
-  option broadcast-address {{ s.broadcast_address }};
-{% endif %}
-{% if s.domain_nameservers is defined %}
-  option domain-name-servers {{ s.domain_nameservers }};
-{% endif %}
-{% if s.domain_name is defined %}
-  option domain-name "{{ s.domain_name }}";
-{% endif %}
-{% if s.ntp_servers is defined %}
-  option ntp-servers {{ s.ntp_servers }};
-{% endif %}
-{% if s.default_lease_time is defined %}
-  default-lease-time {{ s.default_lease_time }};
-{% endif %}
-{% if s.max_lease_time is defined %}
-  max-lease-time {{ s.max_lease_time }};
-{% endif %}
-{% if s.pools is defined %}
-{% for p in s.pools %}
-  pool {
-{% if p.rule is defined %}
-    {{ p.rule }};
-{% endif %}
-    range {{ p.range_start }} {{ p.range_end }};
-{% if p.parameters is defined %}
-{% for param in p.parameters %}
-    {{ param }};
-{% endfor %}
-{% endif %}
-  }
-{% endfor %}
-{% endif %}
-{% if s.parameters is defined %}
-{% for p in s.parameters %}
-  {{ p }};
-{% endfor %}
-{% endif %}
-}
-{% endfor %}
-{% endif %}
-
-{% if dhcp_shared_networks is defined %}
-# Shared networks
-{% for n in dhcp_shared_networks %}
-shared-network {{ n.name }} {
-{% if n.interface is defined %}
-  interface "{{ n.interface }}";
-{% endif %}
-{% for s in n.subnets %}
-  subnet {{ s.base }} netmask {{ s.netmask }} {
-{% if s.range_start is defined %}
-    range {{ s.range_start }} {{ s.range_end }};
-{% endif %}
-{% if s.routers is defined %}
-    option routers {{ s.routers }};
-{% endif %}
-{% if s.broadcast_address is defined %}
-    option broadcast-address {{ s.broadcast_address }};
-{% endif %}
-{% if s.domain_nameservers is defined %}
-    option domain-name-servers {{ s.domain_nameservers }};
-{% endif %}
-{% if s.domain_name is defined %}
-    option domain-name "{{ s.domain_name }}";
-{% endif %}
-{% if s.ntp_servers is defined %}
-    option ntp-servers {{ s.ntp_servers }};
-{% endif %}
-{% if s.default_lease_time is defined %}
-    default-lease-time {{ s.default_lease_time }};
-{% endif %}
-{% if s.max_lease_time is defined %}
-    max-lease-time {{ s.max_lease_time }};
-{% endif %}
-{% if s.pools is defined %}
-{% for p in s.pools %}
-    pool {
-{% if p.rule is defined %}
-      {{ p.rule }};
-{% endif %}
-      range {{ p.range_start }} {{ p.range_end }};
-{% if p.parameters is defined %}
-{% for param in p.parameters %}
-      {{ param }};
-{% endfor %}
-{% endif %}
-    }
-{% endfor %}
-{% endif %}
-{% if s.parameters is defined %}
-{% for param in s.parameters %}
-    {{ param }};
-{% endfor %}
-{% endif %}
-  }
-{% endfor %}
-{% if n.pools is defined %}
-{% for p in n.pools %}
-  pool {
-    {{ p.rule }};
-    range {{ p.range_start }} {{ p.range_end }};
-{% if p.parameters is defined %}
-{% for param in p.parameters %}
-    {{ param }};
-{% endfor %}
-{% endif %}
-  }
-{% endfor %}
-{% endif %}
-{% if n.parameters is defined %}
-{% for p in n.parameters %}
-  {{ p }};
-{% endfor %}
-{% endif %}
-}
-{% endfor %}
-{% endif %}
-
-{% if dhcp_ifelse is defined %}
-# If else clauses
-{% for ie in dhcp_ifelse %}
-if {{ ie.condition }} {
-    {{ ie.val }}
-}{% if ie.else is defined %}{% for e in ie.else %} else {
-    {{ e.val }}
-}{% endfor %}
-{% endif %}
-{% endfor %}
-{% endif %}

+ 0 - 3
roles/external/pdellaert.dhcp_server/templates/service.conf.Debian.j2

@@ -1,3 +0,0 @@
-# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
-#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
-INTERFACES="{{ dhcp_interfaces }}"

+ 0 - 2
roles/external/pdellaert.dhcp_server/templates/service.conf.RedHat.j2

@@ -1,2 +0,0 @@
-# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
-DHCPDARGS={{ dhcp_interfaces }}

+ 0 - 6
roles/external/pdellaert.dhcp_server/vars/Archlinux.yml

@@ -1,6 +0,0 @@
----
-dhcp_server_package: dhcp
-dhcp_server_config: /etc/dhcpd.conf
-dhcp_service: dhcpd4
-dhcp_service_config: []
-apparmor_service: apparmor

+ 0 - 6
roles/external/pdellaert.dhcp_server/vars/Debian.yml

@@ -1,6 +0,0 @@
----
-dhcp_server_package: isc-dhcp-server
-dhcp_server_config: /etc/dhcp/dhcpd.conf
-dhcp_service: isc-dhcp-server
-dhcp_service_config: /etc/default/isc-dhcp-server
-apparmor_service: apparmor

+ 0 - 6
roles/external/pdellaert.dhcp_server/vars/RedHat.yml

@@ -1,6 +0,0 @@
----
-dhcp_server_package: dhcp
-dhcp_server_config: /etc/dhcp/dhcpd.conf
-dhcp_service: dhcpd
-dhcp_service_config: /etc/sysconfig/dhcpd
-apparmor_service: apparmor

+ 38 - 0
roles/internal/ffdo.dhcp/README.md

@@ -0,0 +1,38 @@
+Role Name
+=========
+
+A brief description of the role goes here.
+
+Requirements
+------------
+
+Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
+
+Role Variables
+--------------
+
+A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
+
+Dependencies
+------------
+
+A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
+
+Example Playbook
+----------------
+
+Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
+
+    - hosts: servers
+      roles:
+         - { role: username.rolename, x: 42 }
+
+License
+-------
+
+BSD
+
+Author Information
+------------------
+
+An optional section for the role authors to include contact information, or a website (HTML is not allowed).

+ 2 - 0
roles/internal/ffdo.dhcp/defaults/main.yml

@@ -0,0 +1,2 @@
+---
+# defaults file for ffdo-dhcp

+ 5 - 0
roles/internal/ffdo.dhcp/handlers/main.yml

@@ -0,0 +1,5 @@
+---
+# handlers file for ffdo-dhcp
+
+- name: Restart dhcpd
+  service: name=isc-dhcp-server state=restarted

+ 139 - 0
roles/internal/ffdo.dhcp/meta/main.yml

@@ -0,0 +1,139 @@
+---
+galaxy_info:
+  author: your name
+  description: 
+  company: your company (optional)
+  # If the issue tracker for your role is not on github, uncomment the
+  # next line and provide a value
+  # issue_tracker_url: http://example.com/issue/tracker
+  # Some suggested licenses:
+  # - BSD (default)
+  # - MIT
+  # - GPLv2
+  # - GPLv3
+  # - Apache
+  # - CC-BY
+  license: license (GPLv2, CC-BY, etc)
+  min_ansible_version: 1.2
+  #
+  # Below are all platforms currently available. Just uncomment
+  # the ones that apply to your role. If you don't see your 
+  # platform on this list, let us know and we'll get it added!
+  #
+  #platforms:
+  #- name: EL
+  #  versions:
+  #  - all
+  #  - 5
+  #  - 6
+  #  - 7
+  #- name: GenericUNIX
+  #  versions:
+  #  - all
+  #  - any
+  #- name: Fedora
+  #  versions:
+  #  - all
+  #  - 16
+  #  - 17
+  #  - 18
+  #  - 19
+  #  - 20
+  #  - 21
+  #  - 22
+  #- name: Windows
+  #  versions:
+  #  - all
+  #  - 2012R2
+  #- name: SmartOS
+  #  versions:
+  #  - all
+  #  - any
+  #- name: opensuse
+  #  versions:
+  #  - all
+  #  - 12.1
+  #  - 12.2
+  #  - 12.3
+  #  - 13.1
+  #  - 13.2
+  #- name: Amazon
+  #  versions:
+  #  - all
+  #  - 2013.03
+  #  - 2013.09
+  #- name: GenericBSD
+  #  versions:
+  #  - all
+  #  - any
+  #- name: FreeBSD
+  #  versions:
+  #  - all
+  #  - 8.0
+  #  - 8.1
+  #  - 8.2
+  #  - 8.3
+  #  - 8.4
+  #  - 9.0
+  #  - 9.1
+  #  - 9.1
+  #  - 9.2
+  #- name: Ubuntu
+  #  versions:
+  #  - all
+  #  - lucid
+  #  - maverick
+  #  - natty
+  #  - oneiric
+  #  - precise
+  #  - quantal
+  #  - raring
+  #  - saucy
+  #  - trusty
+  #  - utopic
+  #  - vivid
+  #- name: SLES
+  #  versions:
+  #  - all
+  #  - 10SP3
+  #  - 10SP4
+  #  - 11
+  #  - 11SP1
+  #  - 11SP2
+  #  - 11SP3
+  #- name: GenericLinux
+  #  versions:
+  #  - all
+  #  - any
+  #- name: Debian
+  #  versions:
+  #  - all
+  #  - etch
+  #  - jessie
+  #  - lenny
+  #  - squeeze
+  #  - wheezy
+  #
+  # Below are all categories currently available. Just as with
+  # the platforms above, uncomment those that apply to your role.
+  #
+  #categories:
+  #- cloud
+  #- cloud:ec2
+  #- cloud:gce
+  #- cloud:rax
+  #- clustering
+  #- database
+  #- database:nosql
+  #- database:sql
+  #- development
+  #- monitoring
+  #- networking
+  #- packaging
+  #- system
+  #- web
+dependencies: []
+  # List your role dependencies here, one per line.
+  # Be sure to remove the '[]' above if you add dependencies
+  # to this list.
+  

+ 15 - 0
roles/internal/ffdo.dhcp/tasks/main.yml

@@ -0,0 +1,15 @@
+---
+# tasks file for ffdo-dhcp
+
+- name: Ensure ISC DHCPD is installed
+  apt: name=isc-dhcp-server state=present
+
+- name: Install dhcpd.conf
+  template:
+    src: dhcpd.conf.j2
+    dest: /etc/dhcp/dhcpd.conf
+  notify:
+  - Restart dhcpd
+
+- name: Ensure dhcpd is started and enabled
+  service: name=isc-dhcp-server state=started enabled=yes

+ 24 - 0
roles/internal/ffdo.dhcp/templates/dhcpd.conf.j2

@@ -0,0 +1,24 @@
+ddns-update-style none;
+log-facility local7;
+authoritative;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+# suppress wpad DHCPINFORM requests from MSFT devices
+# See https://lists.isc.org/pipermail/dhcp-users/2013-September/017193.html
+option wpad code 252 = text;
+option wpad "\n\000";
+class "MSFT" {
+  match if substring(option vendor-class-identifier, 0, 4) = "MSFT";
+  option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list, fc);
+}
+
+option interface-mtu 1280;
+
+subnet {{mesh_ipv4|ipaddr('network')}} netmask {{mesh_ipv4|ipaddr('netmask')}} {
+  range {{dhcp_range_start}} {{dhcp_range_end}};
+  option routers {{mesh_ipv4|ipaddr('address')}};
+  option domain-name-servers {{mesh_ipv4|ipaddr('address')}};
+  option ntp-servers {{mesh_ipv4|ipaddr('address')}};
+}

+ 2 - 0
roles/internal/ffdo.dhcp/vars/main.yml

@@ -0,0 +1,2 @@
+---
+# vars file for ffdo-dhcp

+ 1 - 1
roles/internal/ffdo.supernode/meta/main.yml

@@ -16,7 +16,7 @@ galaxy_info:
   - networking
 dependencies:
 - dereulenspiegel.fastd
-- pdellaert.dhcp_server
+- ffdo.dhcp
 - debops.radvd
 - dereulenspiegel.alfred
 - ff-unbound

+ 0 - 2
roles/thirdparty_roles.yml

@@ -2,8 +2,6 @@
   version: v1.4.1
   name: usermanage
 
-- src: pdellaert.dhcp_server
-
 - src: debops.radvd
 
 - src: jdauphant.unbound