Since the apt package doesn't force apt-get update when notified, but instead schedules it for somewhere in the run, this change forces apt-get update after adding the repository.
Without this change you sometimes need to run puppet twice, once to add the source and update (usually at end of puppet run) and again to actually install the packages.
Our internal hosts have no access to the internet, hence no option to download GPG-KEY-elasticsearch. This tiny patch adds the option to specify the download location for the GPG file.
If you are interested I can also add documentation and spec tests. We have the problem, that for some of our customers the repo url format is of the following form, which isn't supported by this module:
For a completely internal deployment, downloading the repository key directly
from the internet is not an option. This change makes the $keysource and
$keyid variables configurable so an internal mirror can be used.
This allows to set the apt architecture.