-
Notifications
You must be signed in to change notification settings - Fork 264
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
Proxy support for Initial install and shell provisioners #229
base: main
Are you sure you want to change the base?
Conversation
@arizvisa Proxy support added. |
@arizvisa Still working on adding authenticated proxy. |
@arizvisa This is ready to go. Please ask if you have any questions. |
Thanks for doing this work. My bad on merging the other ones before reading this. :-/ I just relocated, so I don't have all my equipment setup to simulate this properly. It's likely I'll be able to deploy a quick proxy and build more than a single VM sometime next week, though. However, I'll see what I can do over the weekend so you aren't stuck waiting too long. |
@arizvisa no worries. I oriiginally wrote a less capable version of the proxy support for this I think 3 years ago so I have been waiting for a while. |
As semi-discussed in #83, the addition of allowing users to customize the configuration during the floppy step (which includes the update to all of the templates) is different from the consolidation of the download methods that you did to implement proxy support. Can you isolate the configuration (along with the relevant paragraph of documentation) and all of the modifications to the templates into its own PR? |
@arizvisa It was done because it is absolutely required to configure proxy support during floppy step. So it is indeed part of the proxy support PR. Edit: Let me explain. You don't want someone editing a file that is a part of this repo to add optional configuration. They should be able to add a file that is ignored by git as optional configuration. |
Is it though? What's wrong with the pre-existing methodology of editing |
If you want to protect users and make it easy to use without making bad commits else its REALLY easy to mess up.
I just don't see the features as a separate thing. In my opinion Maybe |
Ok. No worries then. I'll do it for you. |
@arizvisa You'll leave it in or take it out? I am not trying to be difficult, just curious. I mean, I am just pleading my case and trying to convince you. You are the maintainer and have the ultimate say. I just disagree it is a mixed feature PR because the scripts have always had the ability to run multiple I can make it a separate PR if that is what you really want. Just let me know. |
Added support for specifying additional floppy/_packer_config*.cmd files as part of PR #229.
Can you re-base this? The differences should be a lot smaller as a result of PR #235. |
@arizvisa Rebased |
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.
Good work on consolidating all the logic through _download.cmd
. As mentioned in my review, I think if you're going to remove the else-case you might as well remove the entire conditional.
However, if you prefer to keep it, then at least let the user know that the download is actually being skipped due to the missing download script.
@@ -18,4 +18,3 @@ floppy/_packer_config_*.cmd | |||
*.*.json | |||
floppy/*.*.* | |||
script/*.*.* | |||
|
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 stray new-line is unnecessary.
@@ -1,3 +1,4 @@ | |||
|
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 newline is also unnecessary.
@@ -31,8 +31,8 @@ echo ==^> Copying "%found%" to "%filename%", skipping download. | |||
copy /y "%found%" "%filename%" && goto exit0 | |||
|
|||
:download | |||
|
|||
echo ==^> Downloading "%url%" to "%filename%" | |||
REM IT IS JUST CLEANER WITH THIS WGET IS REALLY PICKY. POWERSHELL - NOT SO MUCH |
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.
No need to justify this with a comment.. Can be removed as well.
|
||
set filename=%~2 | ||
set "filename=%~2" |
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.
Thanks for properly quoting these. It's good style.
@@ -17,9 +17,6 @@ pushd "%BITVISE_DIR%" | |||
|
|||
if exist "%SystemRoot%\_download.cmd" ( | |||
call "%SystemRoot%\_download.cmd" "%BITVISE_URL%" "%BITVISE_PATH%" | |||
) else ( |
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.
These conditionals are used to detect if there's some kind of issue with the existence of the download script. If you're going to remove the "else" case, you might as well remove the whole conditional.
Ideally, though, you could emit an error and terminate the script if the download.cmd script is not found. However, either way is fine.
@@ -259,8 +253,9 @@ set SALT_URL=http://raw.githubusercontent.com/saltstack/salt-bootstrap/%SALT_REV | |||
set SALT_PATH=%SALT_DIR%\bootstrap-salt.ps1 | |||
set SALT_DOWNLOAD=%SALT_DIR%\bootstrap-salt.download.ps1 | |||
|
|||
echo ==^> Downloading %SALT_URL% to %SALT_DOWNLOAD% | |||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SALT_URL%', '%SALT_DOWNLOAD%')" <NUL | |||
if exist "%SystemRoot%\_download.cmd" ( |
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 prior comment)
@@ -301,7 +296,7 @@ if "%CM_VERSION%" == "latest" ( | |||
set SALT_PATH=%SALT_DIR%\Salt-Minion-Setup.exe | |||
|
|||
echo ==^> Downloading %SALT_URL% to %SALT_PATH% | |||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SALT_URL%', '%SALT_PATH%')" <NUL | |||
call "%SystemRoot%\_download.cmd" %SALT_URL% %SALT_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.
(See prior comment)
@@ -53,9 +53,6 @@ cd /d "%SEVENZIP_DIR%" | |||
|
|||
if exist "%SystemRoot%\_download.cmd" ( | |||
call "%SystemRoot%\_download.cmd" "%SEVENZIP_URL%" "%SEVENZIP_PATH%" | |||
) else ( |
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 comment for floppy/bitvisessh.bat
)
@@ -131,9 +128,6 @@ pushd "%ULTRADEFRAG_DIR%" | |||
|
|||
if exist "%SystemRoot%\_download.cmd" ( | |||
call "%SystemRoot%\_download.cmd" "%ULTRADEFRAG_URL%" "%ULTRADEFRAG_PATH%" | |||
) else ( |
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 comment for floppy/bitvisessh.bat
)
@@ -15,9 +15,6 @@ pushd "%VAGRANT_DIR%" | |||
|
|||
if exist "%SystemRoot%\_download.cmd" ( | |||
call "%SystemRoot%\_download.cmd" "%VAGRANT_PUB_URL%" "%VAGRANT_PATH%" | |||
) else ( |
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 comment for floppy/bitvisessh.bat
)
8d4907d
to
c7296dc
Compare
@arizvisa Merge my PRs in the order they were opened for best results. If merging all it should look like this when done.
They are all based on boxcutter/windows master branch.
The first 4 PRs do everything that was in #179
#229
#230
#232
#233
This is new based on issues encountered with New Packer 1.5.2
#234
Proxy support for Initial install and shell provisioners
http/https/no_proxy
capability to_download.cmd
forwget
andpowershell
README.md
for configuration documentation.wget
throws a lot of red onto the screen when using proxy so if proxy is configured powershell will be used. Note: this could be a configurable preferrence but I saw no need._download.cmd
floppy\_packer_config*.cmd
floppy/_packer_config_*.cmd
to the.gitignore
so users can customize without committing to this repo.