File: bind9.pp

package info (click to toggle)
puppet-module-designate 27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: ruby: 3,199; python: 33; sh: 10; makefile: 10
file content (98 lines) | stat: -rw-r--r-- 2,952 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# == Class designate::backend::bind9
#
# Configure bind9 as backend
#
# == Parameters
#
# [*rndc_config_file*]
#  (Optional) Location of the rndc configuration file.
#  Defaults to undef
#
# [*rndc_key_file*]
#  (Optional) Location of the rndc key file.
#  Defaults to undef
#
# [*rndc_port*]
#  (Optional) RNDC Port.
#  Defaults to 953.
#
# [*rndc_controls*]
#  (Optional) Hash defining controls configuration for rndc.
#  Defaults to undef, which uses the puppet-dns default
#
# [*ns_records*]
#  (Optional) List of the NS records for zones hosted within this pool. This
#  parameter takes hash value of <priority>:<host> mapping.
#  Defaults to {1 => 'ns1.example.org.'}
#
# [*nameservers*]
#  (Optional) List out the nameservers for this pool.
#  Defaults to ['127.0.0,1'].
#
# [*bind9_hosts*]
#  (Optional) Host running DNS service.
#  Defaults to ['127.0.0,1'].
#
# [*dns_port*]
#  (Optional) TCP port to connect to DNS service.
#  Defaults to 53.
#
# [*mdns_hosts*]
#  (Optional) Array of hosts where designate-mdns service is running.
#  Defaults to ['127.0.0.1'].
#
# [*mdns_port*]
#  (Optional) TCP Port to connect to designate-mdns service.
#  Defaults to 5354.
#
# [*clean_zonefile*]
#  (Optional) Removes zone files when a zone is deleted.
#  Defaults to false
#
# [*also_notifies*]
#  (Optional) Array of hosts for which designate-mdns will send DNS notify
#  packets to.
#  Defaults to [].
#
# [*attributes*]
#  (Optional) Pool attribtes used by scheduling.
#  Defaults to {}
#
class designate::backend::bind9 (
  $rndc_config_file                      = undef,
  $rndc_key_file                         = undef,
  $rndc_controls                         = undef,
  $rndc_port                             = undef,
  Hash[Integer, String] $ns_records      = { 1 => 'ns1.example.org.' },
  Array[String[1], 1] $nameservers       = ['127.0.0.1'],
  Array[String[1], 1] $bind9_hosts       = ['127.0.0.1'],
  $dns_port                              = 53,
  Array[String[1], 1] $mdns_hosts        = ['127.0.0.1'],
  $mdns_port                             = 5354,
  Boolean $clean_zonefile                = false,
  Array[String[1]] $also_notifies        = [],
  Hash[String[1], String[1]] $attributes = {},
) {
  include designate::deps
  include designate::params

  file { '/etc/designate/pools.yaml':
    ensure  => file,
    path    => '/etc/designate/pools.yaml',
    owner   => $designate::params::user,
    group   => $designate::params::group,
    mode    => '0640',
    content => template('designate/bind9-pools.yaml.erb'),
    require => Anchor['designate::config::begin'],
    before  => Anchor['designate::config::end'],
  }

  exec { 'designate-manage pool update':
    command     => 'designate-manage pool update',
    path        => '/usr/bin',
    user        => $designate::params::user,
    refreshonly => true,
    require     => Anchor['designate::service::end'],
    subscribe   => File['/etc/designate/pools.yaml'],
  }
}