puppet-gitlab icon indicating copy to clipboard operation
puppet-gitlab copied to clipboard

Don't wipe the database out during installation

Open njm506 opened this issue 10 years ago • 10 comments

I've begun testing this module across a couple of VMs. On setting up the second VM (with a bit of test data in the database), I've found that the database gets reinitialized, wiping out the data.

This is due to Exec['setup gitlab database'] looking at a local file to determine whether the database needs "setting up".

For such a dangerous operation, one might speculate that this functionality should be separate from the main install process (either as a separate class or by setting a parameter).

njm506 avatar Aug 28 '14 10:08 njm506

+1

brianvans avatar Dec 11 '14 17:12 brianvans

+1, funny enough I seem to be missing the local file for whatever reason, and without a sane check it's eating my database on every puppet run...

StrangeWill avatar Apr 13 '15 03:04 StrangeWill

Same issue here with postgresql backend, my database is wiped out on every run.

becosta avatar Apr 13 '15 10:04 becosta

@becosta Logged issue #215, thought it was me doing something dumb (had a failure during install due to a missing Redis server) during my first run but did a fresh clean install and still had that issue.

StrangeWill avatar Apr 13 '15 13:04 StrangeWill

+1

cyberkov avatar May 12 '15 10:05 cyberkov

Hi, I'm not able to reproduce the issue (with debian or centos) https://paste.debian.net/plainh/f09ad8ae

sbadia avatar Aug 05 '15 17:08 sbadia

Hi @sbadia, this issue is related to #215 which was fixed with pull request #217. But I think this issue is not close because the discussion about a flag?

I think you should include a boolean which say yes create (wipeout) database if needed (no .done-file) or never do it. I think about create databases incl. schema with something like cpitman/database_schema - so gitlab must not do it again? Or a mutlinode cluster - which currently mean ever member recreate the database.

toepi avatar Aug 05 '15 18:08 toepi

Yes, to clarify, the original issue was with regards to setting up multiple front-ends which share the same database and filestore (for clustering). Building an additional node wipes the database as the new node doesn't have the local file to say the database has been initialized.

I was expecting it would come down to a new parameter to determine whether the code should ever try to wipe the db, rather than relying on a local file. I haven't retested this recently.

njm506 avatar Aug 12 '15 12:08 njm506

stupid question: It is possible to check if a database has a schema/tables? I know Oracle has some views for this - mysql show tables but postgres? So it is possible to replace file which this check?

toepi avatar Aug 12 '15 16:08 toepi

+1 on this... I currently have this ugly hack in place to safeguard against this:

  exec { 'prevent setup gitlab database':
    command => "touch /home/git/.gitlab_setup_done",
    before  => Exec['setup gitlab database'],
    require => User['git'],
  }

joshuaspence avatar Oct 06 '15 16:10 joshuaspence