{"action":"created","issue":{"url":"https://api.github.com/repos/voxpupuli/puppet-archive/issues/118","repository_url":"https://api.github.com/repos/voxpupuli/puppet-archive","labels_url":"https://api.github.com/repos/voxpupuli/puppet-archive/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/voxpupuli/puppet-archive/issues/118/comments","events_url":"https://api.github.com/repos/voxpupuli/puppet-archive/issues/118/events","html_url":"https://github.com/voxpupuli/puppet-archive/issues/118","id":134186204,"number":118,"title":"embed gems and install locally","user":{"login":"logicminds","id":563900,"avatar_url":"https://avatars.githubusercontent.com/u/563900?v=3","gravatar_id":"","url":"https://api.github.com/users/logicminds","html_url":"https://github.com/logicminds","followers_url":"https://api.github.com/users/logicminds/followers","following_url":"https://api.github.com/users/logicminds/following{/other_user}","gists_url":"https://api.github.com/users/logicminds/gists{/gist_id}","starred_url":"https://api.github.com/users/logicminds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logicminds/subscriptions","organizations_url":"https://api.github.com/users/logicminds/orgs","repos_url":"https://api.github.com/users/logicminds/repos","events_url":"https://api.github.com/users/logicminds/events{/privacy}","received_events_url":"https://api.github.com/users/logicminds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-17T05:49:23Z","updated_at":"2016-02-17T23:40:12Z","closed_at":null,"body":"Not sure if anybody else can appreciate doing this, but my current situation limits me from installing anything directly off the internet.  So to make things easier I ended up putting the gems inside the module and installing locally. \r\n\r\nIf this kind of addition is welcomed, I'll make a PR for it. \r\n\r\nBut it looks something like:\r\n\r\n```puppet\r\n  $archive::params::path               = 'C:/Windows/Temp'  # for context only\r\n  $faraday_source            = \"${archive::params::path}/faraday-0.9.1.gem\"\r\n  $faraday_middleware_source = \"${archive::params::path}/faraday_middleware-0.10.0.gem\"\r\n  $multipart_post_source     = \"${archive::params::path}/multipart-post-2.0.0.gem\"\r\n\r\n  file{$faraday_source:\r\n    ensure => present,\r\n    source => 'puppet:///modules/archive/faraday-0.9.1.gem',\r\n    before => Package['faraday']\r\n  }\r\n  file{$faraday_middleware_source:\r\n    ensure => present,\r\n    source => 'puppet:///modules/archive/faraday_middleware-0.10.0.gem',\r\n    before => Package['faraday_middleware']\r\n  }\r\n  file{$multipart_post_source:\r\n    ensure => present,\r\n    source => 'puppet:///modules/archive/multipart-post-2.0.0.gem',\r\n    before => Package['multipart-post']\r\n  }\r\n  package{ 'multipart-post':\r\n    ensure   => present,\r\n    provider => $archive::params::gem_provider,\r\n    install_options => '--local',\r\n    source   => $multipart_post_source,\r\n  }\r\n  package { 'faraday':\r\n    ensure   => present,\r\n    provider => $archive::params::gem_provider,\r\n    install_options => '--local',\r\n    source   => $faraday_source,\r\n    require  => Package['multipart-post'],\r\n  }\r\n  package { 'faraday_middleware':\r\n    ensure   => present,\r\n    provider => $archive::params::gem_provider,\r\n    install_options => '--local',\r\n    source   => $faraday_middleware_source,\r\n    require  => Package['faraday'],\r\n  }\r\n\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/voxpupuli/puppet-archive/issues/comments/185460816","html_url":"https://github.com/voxpupuli/puppet-archive/issues/118#issuecomment-185460816","issue_url":"https://api.github.com/repos/voxpupuli/puppet-archive/issues/118","id":185460816,"user":{"login":"rnelson0","id":1898351,"avatar_url":"https://avatars.githubusercontent.com/u/1898351?v=3","gravatar_id":"","url":"https://api.github.com/users/rnelson0","html_url":"https://github.com/rnelson0","followers_url":"https://api.github.com/users/rnelson0/followers","following_url":"https://api.github.com/users/rnelson0/following{/other_user}","gists_url":"https://api.github.com/users/rnelson0/gists{/gist_id}","starred_url":"https://api.github.com/users/rnelson0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnelson0/subscriptions","organizations_url":"https://api.github.com/users/rnelson0/orgs","repos_url":"https://api.github.com/users/rnelson0/repos","events_url":"https://api.github.com/users/rnelson0/events{/privacy}","received_events_url":"https://api.github.com/users/rnelson0/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T23:40:12Z","updated_at":"2016-02-17T23:40:12Z","body":"This module shouldn't really care how the gems get there and whether or not you have internet access. You could put the package installation into a subclass `archive::install` and add a `$manage_gems` parameter to control whether `archive::install` is even called. Then, you could use your roles and profiles classes to load the gems however you need. Flexibility all around.\r\n\r\nWhether this is actually needed remains a question, but it seems like a more graceful way to handle such concerns."}}