Giter VIP home page Giter VIP logo

ansible-role-bind's Introduction

#######################################################################################################

❗ DEPRECATION ❗

This repository and the role associated are deprecated in favor of the Manala Ansible Collection

You will find informations on its usage on the collection repository

#######################################################################################################

Ansible Role: Bind Build Status

Report issues and send Pull Requests in the main Ansible Role repository

This role will deal with the setup of Bind.

It's part of the Manala Ansible stack but can be used as a stand alone component.

Requirements

None.

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install manala.bind

Using ansible galaxy requirements file:

- src: manala.bind

Role Filters

Name Description
manala_bind_zone_file Standardize zone file names

Role Variables

Name Default Type Description
manala_bind_install_packages ~ Array Dependency packages to install
manala_bind_install_packages_default ['bind9'] Array Default dependency packages to install
manala_bind_user 'bind' String User
manala_bind_group 'bind' String Group
manala_bind_options ['-u {{ manala_bind_user }}'] Array Options
manala_bind_log_dir '/var/log/bind' String Log dir
manala_bind_configs [] Array List of config files
manala_bind_configs_dir '/etc/bind' String Config files directory
manala_bind_zones_dir '/var/cache/bind' String Zone files directory
manala_bind_zones [] Array List of zone files

Configuration example

Options

See: https://linux.die.net/man/8/named

manala_bind_options:
  - -u {{ manala_bind_user }}
  - -4 # IPv4 only

Configs

file path is relative to manala_bind_configs_dir parameter.

Configs contents could be specified as jinja2 template or raw content.

Config entries also supports a state (present|absent) and a omit (false|true) parameter.

manala_bind_configs:
  - file: named.conf.options
    template: bind/configs/named.conf.options.j2
  - file: named.conf.local
    content: |
      // Consider adding the 1918 zones here, if they are not used in your
      // organization
      include "{{ manala_bind_configs_dir }}/zones.rfc1918";
  - file: named.conf.foo
    state: absent
  - file: named.conf.bar
    omit: true

Zones - Static

Either zone or file parameter is mandatory. If not defined, file parameter is computed from zone.

file path is relative to manala_bind_zones_dir parameter.

Configs contents could be specified as jinja2 template or raw content.

Config entries also supports a state (present|absent) and a omit (false|true) parameter.

manala_bind_zones:
  - zone: foo.local
    template: bind/zones/db.foo.local.j2
  - zone: bar.local
    content: |
      @  IN SOA ns.bar.local. contact.bar.local. (
                  1       ; serial
                  604800  ; refresh (1 week)
                  86400   ; retry (1 day)
                  2419200 ; expire (4 weeks)
                  86400   ; minimum (1 day)
                  )
      @  IN NS  ns.bar.local.
      ns IN A   172.16.1.1";
  - zone: baz.local
    state: absent
  - zone: qux.local
    omit: true

Zones - Dynamic

zone parameter is mandatory, and dynamic parameter must be se to true.

The zone configuration must allow update from (at least) localhost.

Considering the dynamic nature of the zone file, content or template parameters are only taken into account when the file does not exists yet. One can see this as a zone bootstraping.

manala_bind_configs:
  - file: named.conf.local
    content: |
      zone "foo.local" {
          type master;
          file "{{ 'foo.local'|manala_bind_zone_file }}";
          allow-update { localhost; };
      };

manala_bind_zones:
  - zone: foo.local
    dynamic: true
    content: |
      @  IN SOA ns.foo.local. contact.foo.local. (
                  1       ; serial
                  604800  ; refresh (1 week)
                  86400   ; retry (1 day)
                  2419200 ; expire (4 weeks)
                  86400   ; minimum (1 day)
                  )
      @  IN NS  ns.foo.local.
      ns IN A   172.16.1.1";
    records:
      - { record: bar, value: 172.16.1.123 }

Example playbook

- hosts: servers
  roles:
    - { role: manala.bind }

Licence

MIT

Author information

Manala (http://www.manala.io/)

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.