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

Please add more information to documentation #51

Open
sahaqaa opened this issue Apr 27, 2022 · 8 comments
Open

Please add more information to documentation #51

sahaqaa opened this issue Apr 27, 2022 · 8 comments

Comments

@sahaqaa
Copy link

sahaqaa commented Apr 27, 2022

Hello,
I want to configure Webhook for Puppet server. I'm new to your project and trying to configure it for the first time.
From README it's not exactly clear what is meant by "orchestration"?
For example If i have single Puppet master server, do I need to "enable" "orchestration"? What exactly it will do (or would not do when set to "false")?

orchestration:
enabled: true
type: bolt
user: webhook
password: password
bolt:
transport: local
targets:
- localhost

What I need is to run command on 1 single Puppet server:
r10k deploy environment XXXXXXX-vp
or
r10k deploy environment XXXXXXX-v

@sahaqaa
Copy link
Author

sahaqaa commented Apr 27, 2022

Also I'm trying to figure out why am I receiving 404 error.

On Nginx proxy:
"POST / HTTP/1.1" 404 18 "-" "Bitbucket-Webhooks/2.0"
"POST / HTTP/1.1" 404 18 "-" "Bitbucket-Webhooks/2.0"
"POST / HTTP/1.1" 404 18 "-" "Bitbucket-Webhooks/2.0"

On puppet server:

$ ./webhook-go
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

  • using env: export GIN_MODE=release
  • using code: gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET /health --> github.com/voxpupuli/webhook-go/api.HealthController.Status-fm (3 handlers)
[GIN-debug] POST /api/v1/r10k/module --> github.com/voxpupuli/webhook-go/api.ModuleController.DeployModule-fm (3 handlers)
[GIN-debug] POST /api/v1/r10k/environment --> github.com/voxpupuli/webhook-go/api.EnvironmentController.DeployEnvironment-fm (3 handlers)
[GIN-debug] Listening and serving HTTP on :8088

[GIN] 2022/04/27 - 13:25:18 | 404 | 1.144µs | 18.246.31.231 | POST "/"
[GIN] 2022/04/27 - 13:25:18 | 404 | 600ns | 18.246.31.231 | POST "/"
[GIN] 2022/04/27 - 13:25:19 | 404 | 668ns | 18.246.31.231 | POST "/"

Also tried:

[GIN] 2022/04/27 - 13:38:08 | 404 | 485ns | 18.246.31.229 | POST "/environment"
[GIN] 2022/04/27 - 13:38:09 | 404 | 567ns | 18.246.31.229 | POST "/environment"
[GIN] 2022/04/27 - 13:38:10 | 404 | 869ns | 18.246.31.229 | POST "/environment"

[GIN] 2022/04/27 - 13:40:19 | 404 | 1.04µs | 18.246.31.227 | POST "/api/v1"
[GIN] 2022/04/27 - 13:40:19 | 404 | 591ns | 18.246.31.227 | POST "/api/v1"
[GIN] 2022/04/27 - 13:40:20 | 404 | 705ns | 18.246.31.227 | POST "/api/v1"

@sahaqaa
Copy link
Author

sahaqaa commented Apr 27, 2022

Also when I have commented "orchestration" section i see next output:

`[GIN] 2022/04/27 - 14:03:41 | 500 | 409.155282ms | 18.246.31.227 | POST "/api/v1/r10k/environment"

2022/04/27 14:03:42 [Recovery] 2022/04/27 - 14:03:42 panic recovered:
POST /api/v1/r10k/environment HTTP/1.0
Host: puppet5-prod-webhook.XXXXXXXXXXXXXXXXXXXXX
Connection: close
Accept: /
Connection: close
Content-Length: 9196
Content-Type: application/json
User-Agent: Bitbucket-Webhooks/2.0
X-Attempt-Number: 3
X-B3-Sampled: 1
X-B3-Spanid: 6a8a7cdaa2999d6b
X-B3-Traceid: 6a8a7cdaa2999d6b
X-Event-Key: repo:push
X-Event-Time: Wed, 27 Apr 2022 14:03:37 GMT
X-Forwarded-For: 18.246.31.227
X-Forwarded-Proto: https
X-Hook-Uuid: 1f906304-2bfd-406c-b004-d2ce792ec155
X-Request-Uuid: 401cfdbd-db82-4517-8ef6-20bcfd0ef5d8

runtime error: invalid memory address or nil pointer dereference
/home/dhollinger/.asdf/installs/golang/1.17.5/go/src/runtime/panic.go:221 (0x448c46)
/home/dhollinger/.asdf/installs/golang/1.17.5/go/src/runtime/signal_unix.go:735 (0x448c16)
/home/dhollinger/dev/vox/apps/webhook-go/api/environment.go:82 (0x9d13a3)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x920b01)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x920aec)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x91fd66)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x91fd49)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x91f29d)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x91ef25)
/home/dhollinger/.asdf/installs/golang/1.17.5/packages/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x91ea84)
/home/dhollinger/.asdf/installs/golang/1.17.5/go/src/net/http/server.go:2879 (0x68d21a)
/home/dhollinger/.asdf/installs/golang/1.17.5/go/src/net/http/server.go:1930 (0x6888c7)
/home/dhollinger/.asdf/installs/golang/1.17.5/go/src/runtime/asm_amd64.s:1581 (0x463360)
`

@sahaqaa
Copy link
Author

sahaqaa commented Apr 27, 2022

Could someone provide information around usage of "orchestration" section?
How "webhook-go" actually doing "r10k deploy environment production" part? Is it only possible to do it via "bolt"?
Can't we just run command directly (without bolt)?

Also side question about running a Go binary as a systemd service - how to stop it / start it as regular systemd service?

@dhollinger
Copy link
Member

@sahaqaa I am working on updating the documentation.

@genebean
Copy link
Contributor

genebean commented May 7, 2024

@dhollinger Just curious if you ever made any headway on the docs. I, too, was wondering how Bolt fits into this project.

@dhollinger
Copy link
Member

@genebean sadly no. I have been limited on time. I'll take a look at it tonight

@genebean
Copy link
Contributor

genebean commented May 7, 2024

@genebean sadly no. I have been limited on time. I'll take a look at it tonight

No problem! I can totally relate

@dhollinger
Copy link
Member

@genebean Additionally, as of right now Bolt cannot be used with webhook go. The way the os/exec package in Go functions makes the complex/long commands with nested commands in quotes caused problems with os/exec and I haven't found a way around it at this time.

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

No branches or pull requests

3 participants