-
Notifications
You must be signed in to change notification settings - Fork 46
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
Update packer-provisioner-goss.go #7
Update packer-provisioner-goss.go #7
Conversation
Custom Gossfile suport (the --gossfile flag) Tests now supports uploading directories - ignore support disabled (for now) Username and Password for auth to download goss from custom authed locations Ssl cert check disable option - for internal services using self-signed certs modified: README.md modified: packer-provisioner-goss.go
Hi @fishnix, Sorry about this, this should be much cleaner. |
Thanks @vamegh, I'll try to have a look today and get it merged up. Cheers! |
Cleaned up the code, trying to make it DRY, now using functions with switch statements to deal with curl / wget cases. Added an extra UseSudo / use_sudo flag which will run goss with sudo enabled, passwordless sudo access must be provided for this to work.
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.
Looks pretty good! Sorry for the delay!
README.md
Outdated
"use_sudo": false, | ||
"goss_file": "", | ||
"Username": "", | ||
"Password": "", |
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 should be username
and password
packer-provisioner-goss.go
Outdated
@@ -144,6 +159,12 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { | |||
if err := p.uploadFile(ui, comm, dst, src); err != nil { | |||
return fmt.Errorf("Error uploading goss test: %s", err) | |||
} | |||
} else if s.Mode().IsDir() == true { |
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.
} else if s.Mode().IsDir() {
also, you can fix the one above it too :)
packer-provisioner-goss.go
Outdated
@@ -211,6 +234,49 @@ func (p *Provisioner) debug() string { | |||
return "" | |||
} | |||
|
|||
func (p *Provisioner) sslFlag(cmdType string) string { | |||
if p.config.SkipSSLChk == true { |
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 p.config.SkipSSLChk {
packer-provisioner-goss.go
Outdated
|
||
// enable sudo if required | ||
func (p *Provisioner) enableSudo() string { | ||
if p.config.UseSudo == true { |
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 p.config.UseSudo {
Removed all unneccessary comparison to true operators. fixed case for username and password in readme.md modified: README.md modified: packer-provisioner-goss.go
Hi @fishnix should be fixed now, I've cleaned up all of the equal to true comparisons and fixed the readme as requested. |
Just for information: I merged the PR and created a new release here: https://github.com/widdix/packer-provisioner-goss/releases/tag/v0.1.1 I would prefer if we could have the release in this project instead of a fork. |
Thanks for the ping @michaelwittig I didn't notice the update |
Custom Gossfile suport (the --gossfile flag)
Tests now supports uploading directories - ignore support disabled (for now)
Username and Password for auth to download goss from custom authed locations
Ssl cert check disable option - for internal services using self-signed certs