On Thu, Jul 11, 2013 at 1:42 PM, harryxiyou <[email protected]> wrote:
> On Thu, Jul 11, 2013 at 7:03 PM, Michele Tartara <[email protected]> > wrote: > > The example has the second aim of documenting how to automatically set > the > > user passwords at instance creation. > > > > Signed-off-by: Michele Tartara <[email protected]> > > --- > > README | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/README b/README > > index 85c65e5..1b7eeb2 100644 > > --- a/README > > +++ b/README > > @@ -167,6 +167,21 @@ daemons using this directory, otherwise the > installation will fail because it > > won't be able to umount the filesystem from the directory, and hand the > > instance back to Ganeti. > > > > +Example > > ++++++++ > > + > > +The root password can be automatically set when the instance is > created. In > > +order to do this, the ``examples/defaultpasswords`` file has to be > copied to > > There is no ``examples/defaultpasswords`` file. > > s/ examples/defaultpasswords / examples/hooks/defaultpasswords / > Right, thanks. > > > +``$sysconfdir/ganeti/instance-debootstrap/hooks/``, and its data file > > +``examples/confdata/defaultpasswords`` has to be copied to > > +``$sysconfdir/ganeti/instance-debootstrap/hooks/confdata/`` and modified > > +accordingly to one's own need. The file syntax is such that each line > represent > > +a user, with the format:: > > + > > + username:password > > + > > +After copying the two files, just running the instance creation as > usual will > > +automatically cause their execution. > > > > Actually, I cannot understand above description. For Debian, we install > instance-debootstrap by following commands. > > $ ./configure --with-os-dir=/srv/ganeti/os > $ make > $ make install > > Instance-debootstrap is installed under /srv/ganeti/os directory so I think > we just need copy ``examples/hooks`` dir under /srv/ganeti/os dir, right? > No. As stated by the README, the os dir (set by --with-os-dir) is just one of the directories where the various parts of instance-debootstrap are installed. Some of them will end up in $sysconfdir. Usually, when ganeti is installed compiling it from sources, this will correspond to /etc, but it depends on how you actually ran ganeti's configure. When running instance-debootstrap's configure, you should use the same --sysconfdir parameter you used for ganeti. And then, you have to copy the hooks accordingly. That is, usually, to /etc/ganeti/instance-debootstrap/hooks, and to its subdirectory confdata. Cheers, Michele
