{"action":"created","issue":{"url":"https://api.github.com/repos/mayflower/puppet-php/issues/133","labels_url":"https://api.github.com/repos/mayflower/puppet-php/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/mayflower/puppet-php/issues/133/comments","events_url":"https://api.github.com/repos/mayflower/puppet-php/issues/133/events","html_url":"https://github.com/mayflower/puppet-php/issues/133","id":118056698,"number":133,"title":"Switch to use \"ensure_packages\" to avoid duplicate declarations","user":{"login":"minorOffense","id":871728,"avatar_url":"https://avatars.githubusercontent.com/u/871728?v=3","gravatar_id":"","url":"https://api.github.com/users/minorOffense","html_url":"https://github.com/minorOffense","followers_url":"https://api.github.com/users/minorOffense/followers","following_url":"https://api.github.com/users/minorOffense/following{/other_user}","gists_url":"https://api.github.com/users/minorOffense/gists{/gist_id}","starred_url":"https://api.github.com/users/minorOffense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minorOffense/subscriptions","organizations_url":"https://api.github.com/users/minorOffense/orgs","repos_url":"https://api.github.com/users/minorOffense/repos","events_url":"https://api.github.com/users/minorOffense/events{/privacy}","received_events_url":"https://api.github.com/users/minorOffense/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mayflower/puppet-php/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"fpletz","id":114159,"avatar_url":"https://avatars.githubusercontent.com/u/114159?v=3","gravatar_id":"","url":"https://api.github.com/users/fpletz","html_url":"https://github.com/fpletz","followers_url":"https://api.github.com/users/fpletz/followers","following_url":"https://api.github.com/users/fpletz/following{/other_user}","gists_url":"https://api.github.com/users/fpletz/gists{/gist_id}","starred_url":"https://api.github.com/users/fpletz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpletz/subscriptions","organizations_url":"https://api.github.com/users/fpletz/orgs","repos_url":"https://api.github.com/users/fpletz/repos","events_url":"https://api.github.com/users/fpletz/events{/privacy}","received_events_url":"https://api.github.com/users/fpletz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mayflower/puppet-php/milestones/13","html_url":"https://github.com/mayflower/puppet-php/milestones/4.0.0","labels_url":"https://api.github.com/repos/mayflower/puppet-php/milestones/13/labels","id":1213284,"number":13,"title":"4.0.0","description":"","creator":{"login":"fpletz","id":114159,"avatar_url":"https://avatars.githubusercontent.com/u/114159?v=3","gravatar_id":"","url":"https://api.github.com/users/fpletz","html_url":"https://github.com/fpletz","followers_url":"https://api.github.com/users/fpletz/followers","following_url":"https://api.github.com/users/fpletz/following{/other_user}","gists_url":"https://api.github.com/users/fpletz/gists{/gist_id}","starred_url":"https://api.github.com/users/fpletz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpletz/subscriptions","organizations_url":"https://api.github.com/users/fpletz/orgs","repos_url":"https://api.github.com/users/fpletz/repos","events_url":"https://api.github.com/users/fpletz/events{/privacy}","received_events_url":"https://api.github.com/users/fpletz/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":18,"state":"open","created_at":"2015-07-17T17:36:31Z","updated_at":"2015-12-10T17:20:59Z","due_on":"2015-12-23T23:00:00Z","closed_at":null},"comments":3,"created_at":"2015-11-20T14:52:23Z","updated_at":"2015-12-10T21:05:02Z","closed_at":null,"body":"Some modules declare dependencies which this module is using as well. Using the puppetlabs stdlib function 'ensure_packages' reduces the chance of duplicate declarations. \r\n\r\nEx:\r\n````puppet\r\n      package { $real_package:\r\n       \tensure   => $ensure,\r\n       \tprovider => $provider,\r\n       \tsource   => $real_source,\r\n       \trequire  => [\r\n          Class['::php::pear'],\r\n          Class['::php::dev'],\r\n       \t],\r\n      }\r\n````\r\nand instead\r\n````puppet\r\nensure_packages($real_package, {ensure=> $ensure, provider => $provider ...})\r\n````\r\n\r\nSomething like that."},"comment":{"url":"https://api.github.com/repos/mayflower/puppet-php/issues/comments/163748974","html_url":"https://github.com/mayflower/puppet-php/issues/133#issuecomment-163748974","issue_url":"https://api.github.com/repos/mayflower/puppet-php/issues/133","id":163748974,"user":{"login":"minorOffense","id":871728,"avatar_url":"https://avatars.githubusercontent.com/u/871728?v=3","gravatar_id":"","url":"https://api.github.com/users/minorOffense","html_url":"https://github.com/minorOffense","followers_url":"https://api.github.com/users/minorOffense/followers","following_url":"https://api.github.com/users/minorOffense/following{/other_user}","gists_url":"https://api.github.com/users/minorOffense/gists{/gist_id}","starred_url":"https://api.github.com/users/minorOffense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minorOffense/subscriptions","organizations_url":"https://api.github.com/users/minorOffense/orgs","repos_url":"https://api.github.com/users/minorOffense/repos","events_url":"https://api.github.com/users/minorOffense/events{/privacy}","received_events_url":"https://api.github.com/users/minorOffense/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T21:05:02Z","updated_at":"2015-12-10T21:05:02Z","body":"But there are instances where another module may also declare that dependency. Whether it *should* be managed by this or not. Other modules may say \"I need this and I'm going to ensure it's there\". Which will cause the duplicate declaration.\r\n\r\nThis doesn't change the php module from managing the library, it just makes sure that if another module is present that doesn't strictly depend on mayflower/php and wants to ensure the same package is present that you don't get a conflict."}}