-
Notifications
You must be signed in to change notification settings - Fork 497
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
(FACT-1321) Install facter batch files on windows #1263
(FACT-1321) Install facter batch files on windows #1263
Conversation
) else ( | ||
SET PATH=%~dp0;%PATH% | ||
) | ||
elevate.exe "%~dp0facter_interactive.bat" |
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.
facter.bat
and facter_interactive.bat
work fine, but I'm having trouble with run_facter_interactive.bat
. It seems like the call to elevate.exe
isn't right. Any thoughts?
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.
Also, puppetlabs/puppet-agent#515 will install elevate.exe and elevate.exe.config
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.
It's just Cygwin.
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.
This wasn't working in cygwin. Running from not-cygwin worked as expected
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.
Do we know the path to elevate.exe
relative to the directory where run_facter_interactive.bat
is installed?
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.
if it's installed as a part of puppet-agent, it should be in the same directory
7f728df
to
8fe9caf
Compare
8fe9caf
to
2b6202d
Compare
👍 |
cc/ @MikaelSmith @kylog @joshcooper could one of you review this? |
@@ -0,0 +1,8 @@ | |||
@echo off | |||
SETLOCAL | |||
if exist "%~dp0environment.bat" ( |
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.
When will environment.bat
not exist?
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.
See comments on puppetlabs/hiera#340
The interesting part about facter is that these files aren't installed by the system, they have to be purposefully copied over. I figured that since they're in the public facter repo, theoretically they should be able to be used on their own. So, if someone just installs this on their system without environment.bat, it should still work. The other batch scripts assume ruby is in the working directory, so I kept that assumption here if environment.bat doesn't exist.
These look like they need to be installed. We could make them part of the CMake install task on Windows, something like what we do for man pages at https://github.com/puppetlabs/facter/blob/master/CMakeLists.txt#L152. |
@MikaelSmith yeah, that seems totally legit. I wasn't sure how to do that. Thanks for pointing me to that example! |
2b6202d
to
a579af2
Compare
It installs the files as expected on windows
and not on linux
cc/ @MikaelSmith |
A change to puppet-agent that installed these new files before the cmake change was merged, and now needs to be reverted. puppetlabs/puppet-agent#526 |
Fine with this; I think it'd be cleaner to only have the batch files in "C:/Program Files/Puppet Labs/bin" and point to puppet/bin/facter.exe, but we can leave that for later. I'm not sure how you want to deal with that. Making it happen could be done via |
if exist "%~dp0environment.bat" ( | ||
call "%~dp0environment.bat" %0 %* | ||
) else ( | ||
SET PATH=%~dp0;%PATH% |
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.
I think this needs to be quoted. When I try it out and %~dp0
is C:\Program Files\FACTER\bin
I get the error
\FACTER\bin\ was unexpected at this time.
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.
I was almost right, using SET PATH="%~dp0;%PATH%"
creates an invalid PATH
. It needs to be SET "PATH=%~dp0;%PATH%"
.
a579af2
to
b90fd08
Compare
Facter.bat in a stand-alone install doesn't seem to find ruby.exe. Not sure why. Investigating. |
As we switch to building puppet-agent for windows with vanagon, we need access to resources that currently live in puppet_for_the_win. Though these resources depend on resources that are made available in puppet-agent, it makes sense to store these in the project specific repo.
b90fd08
to
a1b734c
Compare
Looks good in stand-alone install and a puppet-agent build. 👍 |
…batch-files (FACT-1321) Install facter batch files on windows
As we switch to building puppet-agent for windows with vanagon, we need
access to resources that currently live in puppet_for_the_win. Though
these resources depend on resources that are made available in
puppet-agent, it makes sense to store these in the project specific
repo.
This takes advantage of
environment.bat
in puppet-agent installed with puppetlabs/puppet-agent#512