Run syncdb and nailgun_fixtures only on initial deploy

nailgun_syncdb and nailgun_fixtures tasks are run only
when nailgun settings.yaml is updated now, removing the
chances of creating errors when the DB structure has
changed since the initial deployment.

Change-Id: I041ef2391e709b4963ad05c6a63ce2780aae2f74
Closes-Bug: #1526917
This commit is contained in:
Matthew Mosesohn 2016-02-05 12:30:13 +04:00
parent 8fd4bb08ff
commit 291759df22
2 changed files with 21 additions and 17 deletions

View File

@ -111,15 +111,20 @@ class fuel::nailgun::server (
}
exec {"nailgun_syncdb":
command => "/usr/bin/nailgun_syncdb",
require => [
File["/etc/nailgun/settings.yaml"],
],
command => "/usr/bin/nailgun_syncdb",
refreshonly => true,
subscribe => File["/etc/nailgun/settings.yaml"],
tries => 50,
try_sleep => 5,
}
exec {"nailgun_upload_fixtures":
command => "/usr/bin/nailgun_fixtures",
require => Exec["nailgun_syncdb"],
command => '/usr/bin/nailgun_fixtures',
refreshonly => true,
subscribe => File["/etc/nailgun/settings.yaml"],
require => Exec['nailgun_syncdb'],
tries => 50,
try_sleep => 5,
}
file {"/etc/cron.daily/capacity":

View File

@ -86,22 +86,21 @@ class nailgun::venv(
ensure => link,
target => "/opt/nailgun/bin/fuel",
}
case $production {
'docker': {
exec {"nailgun_syncdb":
command => "${venv}/bin/nailgun_syncdb",
require => [
File["/etc/nailgun/settings.yaml"],
],
tries => 50,
try_sleep => 5,
command => "${venv}/bin/nailgun_syncdb",
refreshonly => true,
subscribe => File["/etc/nailgun/settings.yaml"],
tries => 50,
try_sleep => 5,
}
exec {"nailgun_upload_fixtures":
command => "${venv}/bin/nailgun_fixtures",
require => Exec["nailgun_syncdb"],
tries => 50,
try_sleep => 5,
command => "${venv}/bin/nailgun_fixtures",
refreshonly => true,
subscribe => Exec["nailgun_syncdb"],
tries => 50,
try_sleep => 5,
}
}
'prod': {