Add Ubuntu 22.04 CI support

Change-Id: I04a3a48c7e72797092fd1c3bdc6252085eff04df
This commit is contained in:
Erik Olof Gunnar Andersson 2022-10-14 21:11:38 -07:00
parent 06b297eaf3
commit 0b162a4c48
3 changed files with 43 additions and 31 deletions

View File

@ -46,7 +46,10 @@ function install_designate_backend {
fi
install_package $PDNS
sudo rm -rf $POWERDNS_CFG_DIR/pdns.d
# 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
@ -88,12 +91,12 @@ EOF
setgid=pdns
setuid=pdns
config-dir=$POWERDNS_CFG_DIR
socket-dir=/var/run
guardian=yes
daemon=yes
disable-axfr=no
local-address=$HOST_IP
local-ipv6=$HOST_IPV6
# local-address should always be set, we temporarily
# commented it out due to compatibility issues with pdns 4.3.
# local-address=$HOST_IP $HOST_IPV6
local-port=$DESIGNATE_SERVICE_PORT_DNS
master=no
slave=yes
@ -134,17 +137,10 @@ EOF
else
die $LINENO "PDNS4 backend only supports MySQL / pgSQL"
fi
restart_service pdns
}
# init_designate_backend - initialize databases, etc.
function init_designate_backend {
# Stop pdns so that the migration succeeds, if not you get a error
# that the schema is still in use.
if is_service_enabled postgresql; then
stop_designate_backend
fi
# (Re)create designate_pdns database
recreate_database designate_pdns utf8
if is_service_enabled mysql; then
@ -154,6 +150,8 @@ function init_designate_backend {
else
die $LINENO "PDNS4 backend only supports MySQL"
fi
restart_service pdns
}
# create_designate_pool_configuration_backend - Perform post-pool config tasks

View File

@ -1,27 +1,31 @@
-- Based on https://docs.powerdns.com/authoritative/backends/generic-mysql.html#default-schema
CREATE TABLE domains (
id INT AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
type VARCHAR(8) NOT NULL,
notified_serial INT UNSIGNED DEFAULT NULL,
account VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
options TEXT DEFAULT NULL,
catalog VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (id)
) Engine=InnoDB;
CREATE UNIQUE INDEX name_index ON domains(name);
CREATE INDEX catalog_idx ON domains(catalog);
CREATE TABLE records (
id INT AUTO_INCREMENT,
id BIGINT AUTO_INCREMENT,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(10) DEFAULT NULL,
-- Changed to "TEXT", as VARCHAR(65000) is too big for most MySQL installs
-- Changed to "TEXT", as VARCHAR(64000) is too big for most MySQL installs
content TEXT DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
disabled TINYINT(1) DEFAULT 0,
ordername VARCHAR(255) BINARY DEFAULT NULL,
auth TINYINT(1) DEFAULT 1,
@ -30,13 +34,13 @@ CREATE TABLE records (
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX recordorder ON records (domain_id, ordername);
CREATE INDEX ordername ON records (ordername);
CREATE TABLE supermasters (
ip VARCHAR(64) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) NOT NULL,
account VARCHAR(40) CHARACTER SET 'utf8' NOT NULL,
PRIMARY KEY (ip, nameserver)
) Engine=InnoDB;
@ -47,9 +51,9 @@ CREATE TABLE comments (
name VARCHAR(255) NOT NULL,
type VARCHAR(10) NOT NULL,
modified_at INT NOT NULL,
account VARCHAR(40) NOT NULL,
-- Changed to "TEXT", as VARCHAR(65000) is too big for most MySQL installs
comment TEXT NOT NULL,
account VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
-- Changed to "TEXT", as VARCHAR(64000) is too big for most MySQL installs
comment TEXT CHARACTER SET 'utf8' NOT NULL,
PRIMARY KEY (id)
) Engine=InnoDB;
@ -74,6 +78,7 @@ CREATE TABLE cryptokeys (
domain_id INT NOT NULL,
flags INT NOT NULL,
active BOOL,
published BOOL DEFAULT 1,
content TEXT,
PRIMARY KEY(id)
) Engine=InnoDB;
@ -89,4 +94,4 @@ CREATE TABLE tsigkeys (
PRIMARY KEY (id)
) Engine=InnoDB;
CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);

View File

@ -1,31 +1,37 @@
-- Based on https://docs.powerdns.com/authoritative/backends/generic-postgresql.html#default-schema
CREATE TABLE domains (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL
type TEXT NOT NULL,
notified_serial BIGINT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
options TEXT DEFAULT NULL,
catalog TEXT DEFAULT NULL,
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
);
CREATE UNIQUE INDEX name_index ON domains(name);
CREATE INDEX catalog_idx ON domains(catalog);
CREATE TABLE records (
id SERIAL PRIMARY KEY,
id BIGSERIAL PRIMARY KEY,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(10) DEFAULT NULL,
content VARCHAR(65535) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
disabled BOOL DEFAULT 'f',
ordername VARCHAR(255),
auth BOOL DEFAULT 't',
CONSTRAINT domain_exists
FOREIGN KEY(domain_id) REFERENCES domains(id)
ON DELETE CASCADE
ON DELETE CASCADE,
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
);
CREATE INDEX rec_name_index ON records(name);
@ -52,7 +58,8 @@ CREATE TABLE comments (
comment VARCHAR(65535) NOT NULL,
CONSTRAINT domain_exists
FOREIGN KEY(domain_id) REFERENCES domains(id)
ON DELETE CASCADE
ON DELETE CASCADE,
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
);
CREATE INDEX comments_domain_id_idx ON comments (domain_id);
@ -75,6 +82,7 @@ CREATE TABLE cryptokeys (
domain_id INT REFERENCES domains(id) ON DELETE CASCADE,
flags INT NOT NULL,
active BOOL,
published BOOL DEFAULT TRUE,
content TEXT
);
@ -85,7 +93,8 @@ CREATE TABLE tsigkeys (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
algorithm VARCHAR(50),
secret VARCHAR(255)
secret VARCHAR(255),
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
);
CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);