"clean_zonefile" option in "targets" section of "pools.yaml" file should be exposed as a charm option

Bug #1870344 reported by David Bott
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Designate Charm
Triaged
Wishlist
Unassigned

Bug Description

"clean_zonefile" in the "targets" section of the "/etc/designate/pools.yaml" file should be exposed as a configurable option.

At the moment when a zone is deleted from Designate, the designate-bind containers don't delete the zone file in /var/cache/bind for that zone.

Designate has code to get designate-bind to delete files for deleted zones. This was found in /usr/lib/python3/dist-packages/designate/backend/impl_bind9.py on the designate containers:

self._clean_zonefile = strutils.bool_from_string(
                          self.options.get('clean_zonefile', 'false'))

if self._clean_zonefile:
    rndc_op.insert(1, '-clean')

I was able to get Designate to clean the zone files for deleted zones by making the following changes in templates/mitaka/pools.yaml and templates/rocky/pools.yaml:

$ diff designate/templates/mitaka/pools.yaml designate_orig/templates/mitaka/pools.yaml
40d39
< clean_zonefile: true
55d53
< clean_zonefile: true

The updated pools.yaml looks like the following (hostnames and IP addresses have been changed):

ubuntu@juju-a55f84-0-lxd-7:~$ sudo cat /etc/designate/pools.yaml
- id: 794ccc2c-d751-44fe-b57f-8894c9f5c842
  name: default
  description: Pool genergated by Juju

  ns_records:

    - hostname: designate1.example.com.
      priority: 10

    - hostname: designate2.example.com.
      priority: 10

    - hostname: designate3.example.com.
      priority: 10

  nameservers:

    - host: 100.86.0.211
      port: 53

    - host: 100.86.0.212
      port: 53

    - host: 100.86.0.213
      port: 53

  targets:

    - type: bind9
      masters:

        - host: 100.86.0.216
          port: 5354

        - host: 100.86.0.214
          port: 5354

        - host: 100.86.0.215
          port: 5354

      options:
        host: 100.86.0.211
        rndc_host: 100.86.0.211
        rndc_key_file: /etc/designate/rndc.key
        port: 53
        clean_zonefile: true

    - type: bind9
      masters:

        - host: 100.86.0.216
          port: 5354

        - host: 100.86.0.214
          port: 5354

        - host: 100.86.0.215
          port: 5354

      options:
        host: 100.86.0.212
        rndc_host: 100.86.0.212
        rndc_key_file: /etc/designate/rndc.key
        port: 53
        clean_zonefile: true

    - type: bind9
      masters:

        - host: 100.86.0.216
          port: 5354

        - host: 100.86.0.214
          port: 5354

        - host: 100.86.0.215
          port: 5354

      options:
        host: 100.86.0.213
        rndc_host: 100.86.0.213
        rndc_key_file: /etc/designate/rndc.key
        port: 53
        clean_zonefile: true

  also_notifies: []

The goal of this change will be to add this as a configurable option to allow end-users to decide whether or not to delete a zone file when the zone is deleted.

Changed in charm-designate:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.