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

Update packer-provisioner-goss.go #7

Merged

Conversation

vamegh
Copy link
Contributor

@vamegh vamegh commented Jan 25, 2018

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

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
@vamegh
Copy link
Contributor Author

vamegh commented Jan 25, 2018

Hi @fishnix,

Sorry about this, this should be much cleaner.

@fishnix
Copy link
Contributor

fishnix commented Jan 25, 2018

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.
Copy link
Contributor

@fishnix fishnix left a 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": "",
Copy link
Contributor

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

@@ -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 {
Copy link
Contributor

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 :)

@@ -211,6 +234,49 @@ func (p *Provisioner) debug() string {
return ""
}

func (p *Provisioner) sslFlag(cmdType string) string {
if p.config.SkipSSLChk == true {
Copy link
Contributor

Choose a reason for hiding this comment

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

if p.config.SkipSSLChk {


// enable sudo if required
func (p *Provisioner) enableSudo() string {
if p.config.UseSudo == true {
Copy link
Contributor

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
@vamegh
Copy link
Contributor Author

vamegh commented Feb 11, 2018

Hi @fishnix should be fixed now, I've cleaned up all of the equal to true comparisons and fixed the readme as requested.

@michaelwittig
Copy link

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.

@fishnix fishnix merged commit 1f76056 into YaleUniversity:master Mar 2, 2018
@fishnix
Copy link
Contributor

fishnix commented Mar 2, 2018

Thanks for the ping @michaelwittig I didn't notice the update

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.

3 participants