Skip to content
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 #100

Merged
merged 1 commit into from
Oct 29, 2021
Merged

Conversation

lucywyman
Copy link
Contributor

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 lucywyman requested a review from a team as a code owner October 27, 2021 18:06
@lucywyman lucywyman force-pushed the hack-puppet-7 branch 2 times, most recently from c9e7ed1 to 3cda97f Compare October 27, 2021 18:23
@donoghuc
Copy link
Member

you could pull in my commits here #96 and put the new interpreters bit on top

@lucywyman
Copy link
Contributor Author

Hm, well, these are passing for me now locally 😡

@lucywyman lucywyman force-pushed the hack-puppet-7 branch 13 times, most recently from 2982390 to 88cc152 Compare October 27, 2021 23:14
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.
Copy link
Contributor

@steveax steveax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@donoghuc
Copy link
Member

Should the travis stuff land in 2019.8.x?

@lucywyman
Copy link
Contributor Author

lucywyman commented Oct 28, 2021

It can, but I don't think it matters since we're not bumping Puppet (or Bolt) in 2019.8.x. I'm reasonably sure CI only breaks with those bumps. And if not maybe it's a problem for another PR 😁

@donoghuc
Copy link
Member

cool. lets just do that later if we need.

@beechtom beechtom merged commit 8c1453a into main Oct 29, 2021
@jonathannewman jonathannewman deleted the hack-puppet-7 branch August 31, 2022 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants