{"action":"created","issue":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/277","labels_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/277/labels{/name}","comments_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/277/comments","events_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/277/events","html_url":"https://github.com/theforeman/puppet-foreman/pull/277","id":55587755,"number":277,"title":"fixes #9101 - refresh db:migrate if DB class changes or settings are missing","user":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-27T08:11:46Z","updated_at":"2015-02-02T16:16:29Z","closed_at":"2015-02-02T16:16:29Z","pull_request":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/277","html_url":"https://github.com/theforeman/puppet-foreman/pull/277","diff_url":"https://github.com/theforeman/puppet-foreman/pull/277.diff","patch_url":"https://github.com/theforeman/puppet-foreman/pull/277.patch"},"body":"When the DB is missing, the foreman::database::${type} class will refresh as\r\nit recreates it, and now triggers the migration.  On a clean install, this was\r\nworking mostly by luck as foreman::config refreshed everything.\r\n\r\nforeman_config_entry didn't cause a refresh due to ignore_missing, which meant\r\nit would only help when Foreman settings had been initialised, but before the\r\nmigration had completed.  With an empty DB, it wouldn't work.\r\n\r\nRemoving ignore_missing means foreman_config_entry will also continue to\r\nrefresh the db:migrate until the setting is populated, and the migration\r\ncompletes.\r\n\r\nOnly compatible with Foreman 1.7+ as it'll cause continuous refreshes on older\r\nversions without the setting.\r\n\r\n(cc @ehelms, @iNecas)\r\n\r\n---\r\n\r\nI was going to just add the refreshes in at first, but removing ignore_missing is better as then the foreman_config_entry will refresh the db:migrate too when the DB is present but empty."},"comment":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/comments/72484645","html_url":"https://github.com/theforeman/puppet-foreman/pull/277#issuecomment-72484645","issue_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/277","id":72484645,"user":{"login":"mmoll","id":1434927,"avatar_url":"https://avatars.githubusercontent.com/u/1434927?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoll","html_url":"https://github.com/mmoll","followers_url":"https://api.github.com/users/mmoll/followers","following_url":"https://api.github.com/users/mmoll/following{/other_user}","gists_url":"https://api.github.com/users/mmoll/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoll/subscriptions","organizations_url":"https://api.github.com/users/mmoll/orgs","repos_url":"https://api.github.com/users/mmoll/repos","events_url":"https://api.github.com/users/mmoll/events{/privacy}","received_events_url":"https://api.github.com/users/mmoll/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T16:16:29Z","updated_at":"2015-02-02T16:16:29Z","body":"tested on my system also now and merged as a32b663, thanks @domcleal :balloon: "}}