diff --git a/README.md b/README.md index 1f40e92..f9baeaf 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,18 @@ configuration format has been created Role Variables -------------- +General configuration +===================== +Review the [defaults](defaults/main.yml) for a full set of configurable parameters. Here are the most interesting ones: + +`bind9_backup_config: [true, false]`: Backup each named.conf.* file or not. Default is 'true'. This setting is useful for testing out configuration changes but can clutter up the destination directory quite a bit if used across many updates. + +`bind9_debug_config: [true, false]`: Print the resulting YAML configuration tree that was sent to the configuration template. Default is 'false'. Useful for comparing with the resulting named.conf files and comparing values. + +`bind9_config_indent: [integer]`: Indentation level for the configuration template. Default is '4'. Set this value to suit your style. Tabs are not supported. + +named.conf +========== bind configuration is set through the various bind9_*_config parameters. These are, in order of precedence: 1. bind9_default_config 2. bind9_group_config @@ -138,6 +150,7 @@ bind9_config: - name: named.conf.options options: recursion: false + notify: primary-only - name: named.conf.local zone: - name: "." @@ -147,6 +160,84 @@ bind9_config: The `named.conf.options` block in `bind9_default_config` got completely overwritten by the `bind9_group_config`, and the `bind9_leaf_config` completely overwrote `named.conf.local`, however, `named.conf.options` was left intact after merging with `bind9_leaf_config`. +Configuration Grammar +--------------------- +The bind9 role tries to replicate the official ISC bind9 configuration format as close as possible, +only re-implementing them in YAML format. This means that for the most part, +section names are the same as in named.conf but kebab-case ('var-name') is replaced with snake_case ('var_name') +If you are missing some statements in your resulting config, it is most likely because of this. + +The main configuration variable used are a series of bind_*_config variables (See [Role Variables]) that have the following syntax + +Every config starts by defining the file name. Each file can contain any amount of top-level statements, +as permitted by named.conf + +``` +bind9_host_config: + - name: FILENAME # The filename of your desired config file. + # You also need to specify a corresponding `include:` for the file + SECTION_NAME: # The section name of the bind config you want to define. + # Can be 'acl', 'options', 'zone', etc. + # See: https://bind9.readthedocs.io/en/v9_18_4/reference.html#configuration-file-grammar + SECTION_2_NAME: # Every file can have as many sections as needed. Generally, try to keep + # all definitions and references together in a file. +``` + +Any option that can be defined multiple times in a named.conf, must be defined as a list +``` +bind9_host_config: + - name: named.conf.local + acl: + - name: ELEMENT_NAME + addresses: + - 127.0.0.1 + - 127.0.0.2 + - name: ELEMENT_2_NAME + addresses: + - 127.0.0.3 +``` + +Simple options are defined just as that. +``` + SIMPLE_OPTION: string, boolean or integer value +``` + +Some options have several optional parameters. For those, a somewhat flexible +configuration format has been created +``` + IP_PORT_DSCP_OPTION: # Any option that is defined as one of: + #