-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(PE-31696) Require bolt gem before running local tasks #99
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Supersedes #96 |
lucywyman
force-pushed
the
hack-puppet-7
branch
from
October 11, 2021 16:31
2503212
to
2732570
Compare
donoghuc
reviewed
Oct 11, 2021
lucywyman
force-pushed
the
hack-puppet-7
branch
2 times, most recently
from
October 14, 2021 16:53
5c15fb1
to
9545835
Compare
lucywyman
force-pushed
the
hack-puppet-7
branch
2 times, most recently
from
October 22, 2021 23:06
9a941ee
to
8ab52f1
Compare
lucywyman
changed the title
(hack) Unset GEM_PATH and GEM_HOME when running local tasks
(PE-31696) Require bolt gem before running local tasks
Oct 22, 2021
In PE we use the Ruby interpreter shipped with the Puppet Agent to run the ace server. The ace server is responsible for executing remote tasks. Remote tasks will often use the puppet library, and run in ACE using the local transport. Now that puppet has moved to using require_relative there is a bug where `require 'puppet'` in the task will load Puppet from the Ruby vendor path instead of the Puppet gem. The vendor Puppet will then try to autoload gems from the Gem path including Puppet, causing a `UniqueFile` error when the same file is loaded from different locations. This updates ACE to run `-r bolt` before executing tasks on localhost, which will add Bolt and it's dependencies to the `$LOAD_PATH` including Puppet, so that the Gem puppet is prefered over the vendor Puppet.
lucywyman
force-pushed
the
hack-puppet-7
branch
from
October 22, 2021 23:07
8ab52f1
to
1b23624
Compare
lucywyman
force-pushed
the
hack-puppet-7
branch
4 times, most recently
from
October 26, 2021 23:35
7a75385
to
a141f29
Compare
lucywyman
force-pushed
the
hack-puppet-7
branch
4 times, most recently
from
October 27, 2021 17:33
619e5ca
to
1b23624
Compare
beechtom
reviewed
Oct 27, 2021
target_data = { | ||
'name' => body['target']['host'] || body['target']['name'] || 'remote', | ||
'config' => { | ||
'transport' => 'remote', | ||
'remote' => body['target'] | ||
} | ||
} | ||
target = [Bolt::Target.from_hash(target_data, inventory)] | ||
target = [Bolt::Target.from_hash(target_data, local_target.inventory)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
target = [Bolt::Target.from_hash(target_data, local_target.inventory)] | |
target = [Bolt::Target.from_hash(target_data, inventory)] |
local_target.inventory
should be equivalent to inventory
, no?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In PE we use the Ruby interpreter shipped with the Puppet Agent to run the
ace server. The ace server is responsible for executing remote tasks.
Remote tasks will often use the puppet library, and run in ACE using the
local transport. Now that puppet has moved to using require_relative
there is a bug where
require 'puppet'
in the task will load Puppetfrom the Ruby vendor path instead of the Puppet gem. The vendor Puppet
will then try to autoload gems from the Gem path including Puppet,
causing a
UniqueFile
error when the same file is loaded from differentlocations.
This updates ACE to run
-r bolt
before executing tasks on localhost,which will add Bolt and it's dependencies to the
$LOAD_PATH
includingPuppet, so that the Gem puppet is prefered over the vendor Puppet.