Commit graph

142 commits

Author SHA1 Message Date
sylvainfaivre
2d069544f6 feat(config.sls): allow to not manage zone file 2021-09-13 14:32:35 +02:00
Imran Iqbal
3cb26c0a71
test: standardise use of share suite & _mapdata state [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/302
2021-03-23 21:25:12 +00:00
Ted Strzalkowski
b5efc0b9bd fix(debian): align Debian log directory with apparmor profile
Debian ships with an apparmor profile that specifies /var/log/named as
the permissible log directory.
2020-03-22 18:14:27 -07:00
Mark Gomersbach
7415a9b0ce feat(map.jinja): add Gentoo support 2019-12-21 11:37:59 +00:00
Imran Iqbal
f220886584
fix(named.conf.logging.jinja): fix salt-lint errors
```bash
Examining bind/files/named.conf.logging.jinja of type state
[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/files/named.conf.logging.jinja:6
        channel {{channel}} {

[201] Trailing whitespace
bind/files/named.conf.logging.jinja:8
                file "{{ map.log_dir }}/{{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':file')}}" versions {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':versions', '3')}} size {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':size', '20m')}};

[204] Lines should be no longer that 160 chars
bind/files/named.conf.logging.jinja:8
                file "{{ map.log_dir }}/{{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':file')}}" versions {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':versions', '3')}} size {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':size', '20m')}};

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/files/named.conf.logging.jinja:8
                file "{{ map.log_dir }}/{{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':file')}}" versions {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':versions', '3')}} size {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':size', '20m')}};

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/files/named.conf.logging.jinja:20
                severity {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':severity')}};

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/files/named.conf.logging.jinja:23
                syslog {{salt['pillar.get']('bind:config:use_extensive_logging:channel:'+channel+':syslog')}};

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/files/named.conf.logging.jinja:29
        category {{category}} { {{ salt['pillar.get']('bind:config:use_extensive_logging:category:'+category, []) | join('; ') }}; };
```
2019-10-09 04:14:00 +01:00
Imran Iqbal
67736a2fed
fix(named.conf.local.jinja): fix salt-lint errors
```bash
Examining bind/files/named.conf.local.jinja of type state
[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/files/named.conf.local.jinja:49
  allow-update { {{args['allow-update']}}; };
```
2019-10-09 04:13:59 +01:00
Imran Iqbal
920615a067
fix(config.sls): fix salt-lint errors
```bash
Examining bind/config.sls of type state
[204] Lines should be no longer that 160 chars
bind/config.sls:217
{%-       do generate_reverse(zone_records, salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse:net'), salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse:for_zones'), salt['pillar.get']('bind:available_zones', {})) %}

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/config.sls:225
zones{{ dash_view }}-{{ zone }}{{ '.include' if serial_auto else ''}}:

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/config.sls:227
    - name: {{ zones_directory }}/{{ file }}{{ '.include' if serial_auto else ''}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/config.sls:295
    - unless: "grep {{ key_flags.zsk }} {{ key_directory }}/K{{zone}}.+{{ key_algorithm_field }}+*.key"

[206] Jinja variables should have spaces before and after: {{ var_name }}
bind/config.sls:304
    - unless: "grep {{ key_flags.ksk }} {{ key_directory }}/K{{zone}}.+{{ key_algorithm_field }}+*.key"
```
2019-10-09 04:13:59 +01:00
Eric Veiras Galisson
120c2d1370 fix: corrected indentation on context in file.managed states 2019-04-11 14:57:51 +02:00
Alexander Weidinger
7fbe60c949 Fix bind/config.sls; use json() 2019-03-08 16:01:34 +01:00
Alexander Weidinger
56dc5da024 FreeBSD: support extensive logging 2018-11-30 02:11:05 +01:00
crux-capacitor
7e47c7658f Squash commits
Update named.conf.local.jinja

Some reorganization of the format.

In the for-loop that handles configured_views:
  - Add if-block on lines 124-128 to allow specifying a file for your view, rather than defaulting to the name of the specified zone. This allows multiple views to serve the same zone, but use a different file.

Update pillar.example

Add documentation and an example on specifying the file to be used for a view, as well as documented that you should not define the top-level 'configured_zones' key when using views.

Small comment update.

Add comment about using ACLs and views.

Create pillar-with-views.example

An example of the bind pillar that defines multiple views for internal and external record sets.

This doesn't include the other portion of the pillar the defines the bind config - this is zones, views and ACLs only. The config portion is not affected by this.

Add more comment clarification.

Add comment explaining file name requirements.

The filename must match the corresponding zone name (without the .txt extension) because the config.sls jinja logic uses the filename to match to the zone when setting zone_records. It also is hardcoded to replace ".txt" with "" in order to make this match work, and so .txt extension is required for the logic to work.

Update config.sls

Add logic to detect a file specified in a view, and match it to a zone under available_zones to enable creating that zone file.

Revert back

Made a bad commit.

Update with the required logic.

Added an if-block to test for the file argument in the zone_data, and if found, use that view and update the zone variable to match the zone defined under available_zones.

Fix variable set.

Set zone based on file with the .txt extension removed.

Update README.rst

Add paragraph about using views.

Update pillar-with-views.example

Add some more comments for explanation.
2018-11-16 16:28:41 -05:00
Javier Bértoli
038e6535d3
Merge pull request #111 from aanriot/master
db.root is now outdated
2018-09-10 08:57:07 -03:00
Alexandre Anriot
db0681ef4e db.root is now outdated 2018-09-10 09:10:14 +02:00
Bernhard M. Wiedemann
7f500766e0 Use dictsort instead of iteritems
to process entries in deterministic order
2018-09-04 21:10:24 +02:00
Bernhard M. Wiedemann
353a8dfc15 Sort hashes
To process hash entries in deterministic order.

Without this patch, config entries were different for every run
and required a service restart when nothing actually changed.

Doing it similar to
0fe2f7e66b
2018-08-31 15:03:48 +02:00
Bernhard M. Wiedemann
993b7d339d Fix named_directory usage
similar to e573baf26d
was broken by 019e1e4a58
2018-08-31 14:20:13 +02:00
Brian Sidebotham
1da26c7a2d Move Redhat family logging location to satisfy selinux requirements 2018-08-30 12:25:02 +01:00
Ryan Walder
819126ed50 Make zones_directory compatible with all distros
As all but Debian based distros seem to put the zonefiles in
`named_directory` itself it's been removed from `map.jinja` for all but
debian.

Within `bind.config` we set `zones_directory` to `named_directory` if
not defined in `map.jinja`/pillar.

All zonefile actions then write using the `zones_directory` variable.
2018-07-27 13:30:14 +01:00
Ryan Walder
2e8643fef4 Change zonefile include to use absolute path 2018-07-26 13:00:51 +01:00
Ryan Walder
ccbcd2a31c Add zones_directory variable to map
This allows the `named_directory` to be the base bind directory as it should so it can be used as a base variable for other directories. Then use the `zones_directory` for placing the zone files in.
2018-07-26 13:00:51 +01:00
Joe Bowman
d51c30c896 replace hardcoded /var/named with variable from map.jinja throughout redhat/named.conf 2018-07-25 16:58:47 +01:00
Joe Bowman
e573baf26d fix incorrect variable reference causing all RedHat os_family tests to fail 2018-07-13 11:43:11 +01:00
Joe Bowman
019e1e4a58 fix named_directory bug in Debian/Ubuntu by using the map value instead of hardcoding 2018-07-13 11:40:50 +01:00
Joe Bowman
a8b703f877 remove superfluous signed-<zone> block, as the per-view block negates the need for this (as default view is still treated as a view); fixes #100 2018-07-09 14:24:15 +01:00
Javier Bértoli
72ea4cf544
Merge pull request #98 from aanriot/master
Add support for inline-signing, see #64 for details
2018-06-21 08:37:51 -03:00
Javier Bértoli
aeeafc329a
Merge pull request #97 from nadvornik/reverse
Autogenerate reverse zones
2018-06-21 08:35:07 -03:00
Vladimir Nadvornik
5039e09dad Optionally include generated forwarders.conf 2018-06-18 16:23:05 +02:00
Vladimir Nadvornik
449597241c Generate reverse records for 'any' zone 2018-06-15 16:46:06 +02:00
Alexandre Anriot
82726fdb48 Add support for inline-signing, see #64 for details 2018-06-07 14:34:27 +02:00
Vladimir Nadvornik
4623fb5e60 Autogenerate reverse zones 2018-06-05 15:46:48 +02:00
Javier Bértoli
6e8652dcb3
Merge pull request #84 from nadvornik/serial
Auto-update zone file serial
2018-06-05 08:39:31 -03:00
Vladimir Nadvornik
2b99362435 Handle log file in chroot 2018-06-04 16:43:10 +02:00
Vladimir Nadvornik
59502abac3 Do not modify configured_views dict
the pillar dict is passed by reference so we should not update it,
update a newly created dict instead
2018-06-01 16:19:59 +02:00
Vladimir Nadvornik
3310f90bb2 De-duplicate views and non-views zone configuration 2018-06-01 15:39:22 +02:00
Vladimir Nadvornik
5d8a666b83 Use watch_in consistently on all files 2018-06-01 15:25:19 +02:00
Vladimir Nadvornik
30a42dbebd Auto-update zone file serial
use https://github.com/saltstack/salt/pull/15828
2018-06-01 15:25:19 +02:00
Alexandre Anriot
40d4be4f8f Fix misplaced parenthesis introduced in #92 2018-05-31 14:43:00 +02:00
Alexandre Anriot
32459c7604
Merge pull request #94 from netmanagers/refactor-named.conf.local_and_logging
Refactor named.conf.local & logging
2018-05-31 13:22:26 +02:00
Javier Bértoli
45e8128487 Refactor named.conf.local & logging across platforms 2018-05-26 19:57:58 -03:00
Alexandre Anriot
4ab7ca3580 Allow to use external zone files 2018-05-04 14:18:12 +02:00
Alexander Weidinger
6dfbfdf7ba FreeBSD: 9.11 is the current stable version (#91) 2018-04-27 22:35:57 +02:00
Alexander Weidinger
c809a1cc2c FreeBSD: bind99 will be deprecated soon
https://www.freshports.org/dns/bind99/:
Going out of support, please migrate to dns/bind911
2018-04-19 23:31:24 +02:00
Alexandre Anriot
faef15a034 With use_extensive_logging, there is more logs 2018-03-30 14:57:00 +02:00
Pascal Liehne
2c8de7bf24 use file mode from pillar or map for logrotate 2018-03-30 00:53:20 +02:00
Pascal Liehne
4278bca7ab use user and group from pillar or map for logrotate 2018-03-30 00:46:00 +02:00
Javier Bértoli
3cbc53e207
Merge pull request #87 from bmwiedemann/master
1 fix for SUSE and 2 commits to nicify
2018-03-26 10:03:43 -03:00
Malte Starostik
72c65db5bc Add support for custom includes on RedHat
Now in named.conf instead of named.conf.local
2018-02-16 13:04:23 +01:00
Bernhard M. Wiedemann
1c725851b8 drop duplicate entry 2018-01-24 15:59:16 +01:00
Bernhard M. Wiedemann
8549b637ba [suse] nicer template
- add salt warning
- drop blank line to reduce diff to original file
2018-01-24 15:48:50 +01:00
Bernhard M. Wiedemann
ae9415c3e7 [suse]: fix passing map.local_config into template
avoids hard to debug messages about undefined Jinja variable 'map'
2018-01-24 15:48:15 +01:00