provizanta.bind

Ansible 角色:bind

主构建状态

安装和配置一个 bind9 DNS 服务器。

要求

角色变量

这些变量在 defaults/main.yml 中定义:

dns_use_rfc1918_zones: true

dns_zones: {}

dns_options:
  directory: "/var/cache/bind"
  forwarders: []
  allow-query:
    - any
  dnssec-validation: auto
  zone-statistics: none
  max-cache-size: 100m
  listen-on-v6:
    - any
  version: none

依赖关系

示例剧本

示例剧本包含一个程序,用于提取所有清单主机(不包括 localhost),并将其直接输入到 dns_zones 变量中进行部署。

- name: 汇聚
  hosts: all
  roles:
    - role: ansible-role-bind
      vars:
        dns_use_rfc1918_zones: true
        dns_zones:
          test.example.com:
            records: |-
              {%- set hosts=dict() -%}
              {%- for host in (groups['all'] | difference('localhost') | unique) -%}
              {%-   set _ = hosts.update({ host : { 'host': hostvars[host]['ansible_host'], 'type': 'A'}}) -%}
              {%- endfor -%}{{ hosts }}
            config:
              type: master
              # allow_transfer: []
              also-notify: []
              allow-update:
                - key rndc-key
        dns_options:
          directory: "/var/cache/bind"
          forwarders: []
          allow-query:
            - any
          dnssec-validation: auto
          zone-statistics: none
          max-cache-size: 100m
          listen-on-v6:
            - any
          version: none

许可证

MIT

作者信息

Tibor Csóka

关于项目

"Install and configure bind9 DNS server."

安装
ansible-galaxy install provizanta.bind
许可证
mit
下载
1.4k
拥有者