Commit cdd27f7f authored by Michele Tartara's avatar Michele Tartara

Add tool for creating users and groups

When executed in split user mode, Ganeti requires a specific set of users
and groups to be created in the appropriate way.

This commit introduces a tool that takes care of that automatically.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 3cecd73c
......@@ -99,6 +99,7 @@
/tools/kvm-ifup
/tools/burnin
/tools/ensure-dirs
/tools/users-setup
/tools/vcluster-setup
/tools/node-cleanup
/tools/node-daemon-setup
......
......@@ -181,6 +181,7 @@ CLEANFILES = \
$(man_MANS) \
$(manhtml) \
tools/kvm-ifup \
tools/users-setup \
tools/vcluster-setup \
stamp-directories \
stamp-srclinks \
......@@ -832,6 +833,7 @@ nodist_tools_python_scripts = \
nodist_tools_SCRIPTS = \
$(nodist_tools_python_scripts) \
tools/users-setup \
tools/vcluster-setup
pkglib_python_scripts = \
......@@ -882,6 +884,7 @@ EXTRA_DIST = \
devel/upload \
devel/webserver \
tools/kvm-ifup.in \
tools/users-setup.in \
tools/vcluster-setup.in \
$(docinput) \
doc/html \
......@@ -1254,6 +1257,10 @@ tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod +x $@
tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod +x $@
tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod +x $@
......
#!/bin/sh
#Create common groups
addgroup --system @GNTDAEMONSGROUP@
addgroup --system @GNTADMINGROUP@
#Create user-specific groups
addgroup --system @GNTMASTERUSER@
addgroup --system @GNTRAPIUSER@
addgroup --system @GNTCONFDUSER@
#Create users
adduser --system --ingroup @GNTMASTERDGROUP@ @GNTMASTERUSER@
adduser --system --ingroup @GNTRAPIGROUP@ @GNTRAPIUSER@
adduser --system --ingroup @GNTCONFDGROUP@ @GNTCONFDUSER@
adduser --system @GNTNODEDUSER@
#Add users to extra groups
for u in @GNTMASTERUSER@ @GNTCONFDUSER@ @GNTRAPIUSER@
do
adduser $u @GNTDAEMONSGROUP@
done
for u in @GNTMASTERUSER@ @GNTRAPIUSER@
do
adduser $u @GNTADMINGROUP@
done
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