# Configure the powerdns backend # Enable with: # DESIGNATE_BACKEND_DRIVER=powerdns # Dependencies: # ``functions`` file # ``designate`` configuration # install_designate_backend - install any external requirements # configure_designate_backend - make configuration changes, including those to other services # init_designate_backend - initialize databases, etc. # start_designate_backend - start any external services # stop_designate_backend - stop any external services # cleanup_designate_backend - remove transient data and cache # Save trace setting DP_PDNS_XTRACE=$(set +o | grep xtrace) set +o xtrace # Defaults # -------- if is_fedora; then POWERDNS_CFG_DIR=/etc/pdns else POWERDNS_CFG_DIR=/etc/powerdns fi # Entry Points # ------------ # install_designate_backend - install any external requirements function install_designate_backend { if is_ubuntu; then PDNS=pdns-server else die $LINENO "PDNS4 Backend plugin backend only supports Ubuntu" fi if is_service_enabled mysql; then PDNS+=" pdns-backend-mysql" elif is_service_enabled postgresql; then PDNS+=" pdns-backend-pgsql" else die $LINENO "PDNS4 backend only supports MySQL / pgSQL" fi install_package $PDNS # We need to wait for the configuration and database to be in place # before we can start up pdns4. Otherwise it will just crash in a loop. stop_designate_backend } # configure_designate_backend - make configuration changes, including those to other services function configure_designate_backend { # Generate Designate pool.yaml file sudo tee $DESIGNATE_CONF_DIR/pools.yaml > /dev/null < /dev/null < /dev/null < /dev/null <