Commit 1ae0c2fa authored by Niklas Hambuechen's avatar Niklas Hambuechen

Build confd by default

The only reason why it was optional was its dependency on regex-pcre,
which was an optional Ganeti dependency.

Job filter rules require rexex-pcre unconditionally, so now confd
requires no additional depdendencies and can be built by default.
Signed-off-by: default avatarNiklas Hambuechen <niklash@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent a846579a
......@@ -349,10 +349,8 @@ GENERATED_FILES = \
clean-local:
rm -rf tools/shebang
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
if ENABLE_CONFD
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
endif
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid \
src/hconfd src/ganeti-confd
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
......@@ -714,12 +712,10 @@ endif
HS_COMPILE_PROGS = \
src/ganeti-kvmd \
src/ganeti-wconfd \
src/hconfd \
src/hluxid \
src/hs2py \
src/rpc-test
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
......@@ -1325,6 +1321,7 @@ nodist_sbin_SCRIPTS = \
daemons/ganeti-cleaner \
src/ganeti-kvmd \
src/ganeti-luxid \
src/ganeti-confd \
src/ganeti-wconfd
src/ganeti-luxid: src/hluxid
......@@ -1335,13 +1332,9 @@ all_sbin_scripts = \
$(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst scripts/%,%,\
$(patsubst src/%,%,$(dist_sbin_SCRIPTS) $(nodist_sbin_SCRIPTS)))))
if ENABLE_CONFD
src/ganeti-confd: src/hconfd
cp -f $< $@
nodist_sbin_SCRIPTS += src/ganeti-confd
endif
if ENABLE_MOND
nodist_sbin_SCRIPTS += src/ganeti-mond
endif
......@@ -2207,7 +2200,6 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
-DMOND_GROUP="$(MOND_GROUP)" \
-DDISK_SEPARATOR="$(DISK_SEPARATOR)" \
-DQEMUIMG_PATH="$(QEMUIMG_PATH)" \
-DENABLE_CONFD="$(ENABLE_CONFD)" \
-DXEN_CMD="$(XEN_CMD)" \
-DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
-DENABLE_METADATA="$(ENABLE_METADATA)" \
......@@ -2301,7 +2293,6 @@ $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
......
......@@ -47,6 +47,8 @@ New dependencies
- The monitoring daemon uses the PSQueue library. Be sure to install it
if you use Mond.
- The formerly optional regex-pcre is now an unconditional dependency because
the new job filter rules have regular expressions as a core feature.
Version 2.12.0
......
......@@ -900,9 +900,8 @@ def main():
WriteHaskellCompletion(sw, script, htools=True, debug=debug)
# ganeti-confd, if enabled
if _constants.ENABLE_CONFD:
WriteHaskellCompletion(sw, "src/ganeti-confd", htools=False,
debug=debug)
WriteHaskellCompletion(sw, "src/ganeti-confd", htools=False,
debug=debug)
# mon-collector, if monitoring is enabled
if _constants.ENABLE_MOND:
......
......@@ -607,14 +607,6 @@ then
AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
fi
# --enable-confd
ENABLE_CONFD=
AC_ARG_ENABLE([confd],
[AS_HELP_STRING([--enable-confd],
[enable the ganeti-confd daemon (default: check)])],
[],
[enable_confd=check])
ENABLE_MOND=
AC_ARG_ENABLE([monitoring],
[AS_HELP_STRING([--enable-monitoring],
......@@ -680,35 +672,7 @@ AC_GHC_PKG_REQUIRE(hinotify)
AC_GHC_PKG_REQUIRE(Crypto)
AC_GHC_PKG_REQUIRE(lifted-base)
AC_GHC_PKG_REQUIRE(lens)
# extra modules for confd functionality; also needed for tests
HS_NODEV=
CONFD_PKG=
# if a new confd dependency is needed, add it here like:
# AC_GHC_PKG_CHECK([somepkg], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG somepkg"])
HS_REGEX_PCRE=-DNO_REGEX_PCRE
AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
[HS_NODEV=1; CONFD_PKG="$CONFD_PKG regex-pcre"])
has_confd=False
if test "$enable_confd" != no; then
if test -z "$CONFD_PKG"; then
has_confd=True
elif test "$enable_confd" = check; then
AC_MSG_WARN(m4_normalize([The required extra libraries for confd were
not found ($CONFD_PKG), confd disabled]))
else
AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but
required libraries were not found:
$CONFD_PKG]))
fi
fi
AC_SUBST(HS_REGEX_PCRE)
if test "$has_confd" = True; then
AC_MSG_NOTICE([Enabling confd usage])
fi
AC_SUBST(ENABLE_CONFD, $has_confd)
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
AC_GHC_PKG_REQUIRE(regex-pcre)
#extra modules for monitoring daemon functionality; also needed for tests
MONITORING_PKG=
......@@ -720,9 +684,6 @@ AC_GHC_PKG_CHECK([PSQueue], [],
has_monitoring=False
if test "$enable_monitoring" != no; then
MONITORING_DEP=
if test "$has_confd" = False; then
MONITORING_DEP="$MONITORING_DEP confd"
fi
has_monitoring_pkg=False
if test -z "$MONITORING_PKG"; then
has_monitoring_pkg=True
......
......@@ -38,6 +38,7 @@ readonly defaults_file="$SYSCONFDIR/default/ganeti"
# they're stopped in reverse order.
DAEMONS=(
ganeti-noded
ganeti-confd
ganeti-wconfd
ganeti-rapi
ganeti-luxid
......@@ -50,14 +51,6 @@ ON_DEMAND_DAEMONS=(
ganeti-metad
)
_confd_enabled() {
[[ "@CUSTOM_ENABLE_CONFD@" == True ]]
}
if _confd_enabled; then
DAEMONS+=( ganeti-confd )
fi
_mond_enabled() {
[[ "@CUSTOM_ENABLE_MOND@" == True ]]
}
......@@ -277,12 +270,6 @@ start() {
local usergroup=$(_daemon_usergroup $plain_name)
local daemonexec=$(_daemon_executable $name)
if [[ "$name" == ganeti-confd ]] \
&& ! _confd_enabled; then
echo 'ganeti-confd disabled at build time' >&2
return 1
fi
if use_systemctl; then
systemctl start "${name}.service"
return $?
......
......@@ -1059,11 +1059,6 @@ def ListDrbd(opts, args):
ToStderr("Please give one (and only one) node.")
return constants.EXIT_FAILURE
if not constants.ENABLE_CONFD:
ToStderr("Error: this command requires confd support, but it has not"
" been enabled at build time.")
return constants.EXIT_FAILURE
status = ReplyStatus()
def ListDrbdConfdCallback(reply):
......
......@@ -1676,9 +1676,6 @@ class LUClusterSetParams(LogicalUnit):
self.cluster.max_tracked_jobs = self.op.max_tracked_jobs
if self.op.maintain_node_health is not None:
if self.op.maintain_node_health and not constants.ENABLE_CONFD:
feedback_fn("Note: CONFD was disabled at build time, node health"
" maintenance is not useful (still enabling it)")
self.cluster.maintain_node_health = self.op.maintain_node_health
if self.op.modify_etc_hosts is not None:
......
......@@ -230,7 +230,7 @@ OPTIONS = [
const=[], default=[{}]),
cli.cli_option("--no-confd", dest="do_confd_tests",
help="Skip confd queries",
action="store_false", default=constants.ENABLE_CONFD),
action="store_false", default=True),
cli.cli_option("--rename", dest="rename", default=None,
help=("Give one unused instance name which is taken"
" to start the renaming sequence"),
......@@ -1076,9 +1076,6 @@ class Burner(object):
Err("When one node is available/selected the disk template must"
" be one of %s" % utils.CommaJoin(_SINGLE_NODE_DISK_TEMPLATES))
if self.opts.do_confd_tests and not constants.ENABLE_CONFD:
Err("You selected confd tests but confd was disabled at configure time")
has_err = True
try:
self.BurnCreateInstances()
......
......@@ -103,8 +103,7 @@ def StartNodeDaemons():
# on master or not, try to start the node daemon
utils.EnsureDaemon(constants.NODED)
# start confd as well. On non candidates it will be in disabled mode.
if constants.ENABLE_CONFD:
utils.EnsureDaemon(constants.CONFD)
utils.EnsureDaemon(constants.CONFD)
# start mond as well: all nodes need monitoring
if constants.ENABLE_MOND:
utils.EnsureDaemon(constants.MOND)
......
......@@ -137,10 +137,6 @@ class NodeMaintenance(object):
"""Check node status versus cluster desired state.
"""
if not constants.ENABLE_CONFD:
logging.warning("Confd use not enabled, cannot do maintenance")
return
my_name = netutils.Hostname.GetSysName()
req = \
confd.client.ConfdClientRequest(type=constants.CONFD_REQ_NODE_ROLE_BYNAME,
......
......@@ -235,9 +235,6 @@ qemuimgPath = "QEMUIMG_PATH"
htools :: Bool
htools = True
enableConfd :: Bool
enableConfd = ENABLE_CONFD
xenCmd :: String
xenCmd = "XEN_CMD"
......
......@@ -334,9 +334,6 @@ adoptableBlockdevRoot = "/dev/disk/"
-- * 'autoconf' enable/disable
enableConfd :: Bool
enableConfd = AutoConf.enableConfd
enableMond :: Bool
enableMond = AutoConf.enableMond
......
......@@ -37,21 +37,12 @@ err() {
exit 1
}
if ! grep -q '^ENABLE_CONFD = ' lib/_constants.py; then
err "Please update $0, confd enable feature is missing"
fi
if ! grep -q '^ENABLE_MOND = ' lib/_constants.py; then
err "Please update $0, mond enable feature is missing"
fi
DAEMONS_LIST="noded wconfd rapi luxid kvmd"
STOPDAEMONS_LIST="kvmd luxid rapi wconfd noded"
if grep -q '^ENABLE_CONFD = True' lib/_constants.py; then
DAEMONS_LIST="$DAEMONS_LIST confd"
STOPDAEMONS_LIST="confd $STOPDAEMONS_LIST"
fi
DAEMONS_LIST="noded confd wconfd rapi luxid kvmd"
STOPDAEMONS_LIST="kvmd luxid rapi wconfd confd noded"
if grep -q '^ENABLE_MOND = True' lib/_constants.py; then
DAEMONS_LIST="$DAEMONS_LIST mond"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment