{"action":"created","issue":{"url":"https://api.github.com/repos/xaque208/puppet-pkgng/issues/77","repository_url":"https://api.github.com/repos/xaque208/puppet-pkgng","labels_url":"https://api.github.com/repos/xaque208/puppet-pkgng/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/xaque208/puppet-pkgng/issues/77/comments","events_url":"https://api.github.com/repos/xaque208/puppet-pkgng/issues/77/events","html_url":"https://github.com/xaque208/puppet-pkgng/issues/77","id":175812764,"number":77,"title":"Order of operations problem with Puppet 4","user":{"login":"mpounsett","id":814371,"avatar_url":"https://avatars.githubusercontent.com/u/814371?v=3","gravatar_id":"","url":"https://api.github.com/users/mpounsett","html_url":"https://github.com/mpounsett","followers_url":"https://api.github.com/users/mpounsett/followers","following_url":"https://api.github.com/users/mpounsett/following{/other_user}","gists_url":"https://api.github.com/users/mpounsett/gists{/gist_id}","starred_url":"https://api.github.com/users/mpounsett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpounsett/subscriptions","organizations_url":"https://api.github.com/users/mpounsett/orgs","repos_url":"https://api.github.com/users/mpounsett/repos","events_url":"https://api.github.com/users/mpounsett/events{/privacy}","received_events_url":"https://api.github.com/users/mpounsett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-08T17:24:57Z","updated_at":"2016-09-19T18:11:48Z","closed_at":null,"body":"In Puppet 4.x after the pkgng provider was incorporated into the core there is an order of operations problem that causes failed, or very long puppet runs.   This is tested with puppet 4.5.1 and zleslie/pkgng 1.1.1.\r\n\r\nIn my setup the pkgng class is included in site.pp like this:\r\n```puppet\r\nclass { 'pkgng':\r\n  purge_repos_d => true,\r\n}\r\n```\r\nI then include a pkgng::repo resource on FreeBSD hosts to define a local repository.\r\n\r\nIn this case, the order of operations appears to be:\r\n  1. purge repositories (purge_repos_d true) \r\n  1. update/install packages\r\n  1. process pkgng::repo objects\r\n\r\nThere are two very painful failure modes with this.\r\n\r\nFirst, on a system where the existing repository is being completely replaced with a local repository (possibly a new system with the default FreeBSD repository), the old repository is deleted, then packages are updated, then the new repository is installed.   The core pkgng provider fails badly if no repository is present (see https://groups.google.com/d/topic/puppet-users/ZtfxbkCEyWc/discussion).  There's no easy way to recover from this within puppet.  Since the agent run fails at the point that the pkgng provider errors out, the repo resource never gets created.  The only fix is to use some other process to create the proper repository config files on all the affected systems.\r\n\r\nIn the second failure mode, if a repository host or path is being updated, the agent run takes a very long time while all of the package version checks individually time out, before the repository is updated at the end of the agent run.\r\n\r\nI'm not sure what the fix is for this.  There at least needs to be a way to swap the order of pkgng::repo handling and package updates.  Preferably the purge of unmanaged repo resources would happen at the same time as the update of managed repo resources.  "},"comment":{"url":"https://api.github.com/repos/xaque208/puppet-pkgng/issues/comments/248074150","html_url":"https://github.com/xaque208/puppet-pkgng/issues/77#issuecomment-248074150","issue_url":"https://api.github.com/repos/xaque208/puppet-pkgng/issues/77","id":248074150,"user":{"login":"xaque208","id":334176,"avatar_url":"https://avatars.githubusercontent.com/u/334176?v=3","gravatar_id":"","url":"https://api.github.com/users/xaque208","html_url":"https://github.com/xaque208","followers_url":"https://api.github.com/users/xaque208/followers","following_url":"https://api.github.com/users/xaque208/following{/other_user}","gists_url":"https://api.github.com/users/xaque208/gists{/gist_id}","starred_url":"https://api.github.com/users/xaque208/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xaque208/subscriptions","organizations_url":"https://api.github.com/users/xaque208/orgs","repos_url":"https://api.github.com/users/xaque208/repos","events_url":"https://api.github.com/users/xaque208/events{/privacy}","received_events_url":"https://api.github.com/users/xaque208/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T18:11:48Z","updated_at":"2016-09-19T18:11:48Z","body":"I've submitted a PR upstream that should resolve the issue of Puppet failing. https://github.com/puppetlabs/puppet/pull/5285"}}
{"actor":{"display_login":"xaque208"}}