Skip to content

Commit 7f3cc37

Browse files
committed
Fixes #34161 - Run apipie:cache:index after db:migrate
With Puppet you can write: Class['A'] ~> Class['B'] ~> Class['C'] This implies Class['A'] ~> Class['C'] and rspec-puppet actually will tell you that chaining is there, but it doesn't actually happen. This was reported in rodjek/rspec-puppet#821. In this particular case it means that if DB seeding doesn't happen then the apipie caches indexes aren't refreshed. By chaining it to db:migrate there's a much bigger chance it actually happens. Normally apipie:cache:index needs to run after a package is updated so ideally this would actually be done in packaging, but this is the workaround we've been using for a long time.
1 parent b169b5c commit 7f3cc37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

manifests/database.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@
2727
foreman::rake { 'db:migrate':
2828
timeout => $timeout,
2929
unless => '/usr/sbin/foreman-rake db:abort_if_pending_migrations',
30+
notify => Foreman::Rake['apipie:cache:index', 'apipie_dsl:cache'],
3031
}
3132
~> foreman_config_entry { 'db_pending_seed':
3233
value => false,
3334
dry => true,
3435
}
3536
~> foreman::rake { 'db:seed':
3637
environment => delete_undef_values($seed_env),
38+
notify => Foreman::Rake['apipie:cache:index', 'apipie_dsl:cache'],
3739
}
38-
~> Foreman::Rake['apipie:cache:index', 'apipie_dsl:cache']
3940
}
4041
}

0 commit comments

Comments
 (0)