Ask Your Question
0

r10k + webhook + atlassian stash

asked 2015-07-06 08:56:59 -0500

slk gravatar image

updated 2015-07-06 08:57:18 -0500

Hi,

I am having issues getting the webhook to work with Stash.

Below are the r10k and webhook configs. 


cat /etc/webhook.yaml

``` ---
 user: puppet

pass: puppet


bind_address: "0.0.0.0"


port: "15352"


certname: peadmin


client_timeout: "120"


discovery_timeout: "10"


certpath: /var/lib/peadmin/.mcollective.d

client_cfg: /var/lib/peadmin/.mcollective


usemcoruby: false


access_logfile: /var/log/webhook/access.log


mcologfile: /var/log/webhook/mcooutput.log


protected: true


prefix: false


prefix_command: "/bin/echo example"


enable_ssl: false


use_mcollective: true


r10kdeployarguments: "-pv"


publickeypath: !ruby/sym undef


privatekeypath: !ruby/sym undef ```

cat /etc/r10k.yaml


```

:cachedir: /var/cache/r10k


:sources:


control:


basedir: /etc/puppetlabs/puppet/environments


prefix: false


remote: ssh://git@stash.myhostname.org:7999/se/puppet-control.git

:purgedirs:


  • /etc/puppetlabs/puppet/environments

```

on the stash side I installed "Http Request Post Receive Hook"

(https://marketplace.atlassian.com/plu...)

( could it be i am using the wrong hook ?)

for the following url http://puppet:puppet@pm-01-p.myhostna... the 'GET' method. ( the choices are GET,POST and PUT )

in the /var/log/webhook.log I see :

``` 


[2015-07-01 16:17:12] DEBUG accept: stashServerIP:46854 


[2015-07-01 16:17:12] DEBUG Rack::Handler::WEBrick is invoked.


[2015-07-01 16:17:42] DEBUG close: stashServerIP:46854

```

but r10k is not being triggered by the webhook.


is there something I am missing or have misconfigured ?

PS: this is the puppet code i used to deploy the above

```

class { 'r10k':
        

    version => '1.5.1',
    

      sources => {
     

        'control' => {
     

          'remote' => 'ssh://git@stash.myhostname.org:7999/se/puppet-control.git',
 

          'basedir' => "${::settings::confdir}/environments",
      

          'prefix' => false,
       

  },
     


   },
  

purgedirs => [ "${::settings::confdir}/environments" ],
    

manage_modulepath => false,
    

mcollective => true,
   

notify => Service['pe-httpd'],
  

} ## r10k ends

include r10k::postrun_command


include r10k::webhook

class { 'r10k::webhook::config':


enable_ssl => false,


protected => true,


port => '15352',


user => 'puppet',


pass => 'puppet',


notify => Service['webhook'], # magic

} ## end r10k::webhook::config

```

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2015-07-16 14:50:59 -0500

acidprime gravatar image

It looks at first glance like it got invoked, if you only have on master you might bypass mcollective and have the hook run as root to see if that part of your problem

https://github.com/acidprime/r10k#run...

edit flag offensive delete link more
0

answered 2015-07-20 08:24:29 -0500

slk gravatar image

@acidprime thanks for advise !

In the end it was a either wrong or poorly functioning webhook plug in in stash.

I switched to "Post-Receive WebHooks" and things started working as expected.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-06 08:56:59 -0500

Seen: 688 times

Last updated: Jul 20 '15