################################ # Install and Config Power DNS # ################################ # Install power DNS pdns_authoritative_install 'master' do action :install end # Install mysql backend package 'pdns-backend-mysql' # Remove old config files execute 'disable pdns' do user 'root' command '/etc/init.d/pdns stop' end # Remove old config files execute 'pdns cleanup' do user 'root' command 'rm /etc/powerdns/pdns.d/*.conf' end # Configure Power DNS pdns_authoritative_config 'master' do action :create launch [ 'gmysql' ] variables( slave: false, daemon: true, master: true, allow_axfr_ips: [ '127.0.0.0/8', '::1' ], allow_recursion: '0.0.0.0/0', gmysql_host: node['powerdns']['database']['host'], gmysql_user: node['powerdns']['database']['user'], gmysql_dbname: node['powerdns']['database']['name'], gmysql_password: node['powerdns']['database']['password'], ) end # Activate power DNS pdns_authoritative_service 'master' do action [ :stop, :enable, :start ] end