Puppet class for Crossbar

#1

Hello,
I made a Puppet class that I used to deploy latest Crossbar on CentOS 7.x machines, it would be better to write a module supporting all platforms and upload to Puppetforge, but maybe just this could useful to someone.

The schema is:

  • crossbar.pp: Puppet class to init and run Crossbar from its Package

  • crossbar_repo.pp: Puppet class to add Crossbar repo, in the example there’s a check for CentOS with instructions to configure its Yum repo, and its GPG key RPM-GPG-KEY-crossbar

  • crossbar.service.erb: systemd template to start crossbar, can be used to have more things parametric, I put user name

I started from systemd example [1] using it as ERB template, and then in the class I simply create a system user that inits crossbar before running the daemon. I used the same strategy for an ERB template for config.json to be provisioned with other class parameters such as tls, port, ip, etc. it is not present in this sample but could be simply adapted using update instead of init in the “init_crossbar” Exec

Hope could be useful, other operating systems support is easy with package management in that way, but a good step would be a test-based Puppet module, with Hiera and other fun stuff :slight_smile:

Cheers

Natale

[1] http://crossbar.io/docs/Automatic-startup-and-restart/

crossbar.pp (1.07 KB)

crossbar.service.erb (311 Bytes)

crossbar_repo.pp (1.15 KB)

RPM-GPG-KEY-crossbar (1.71 KB)

0 Likes

#2

Hi Natale,

nice, nice!

Thanks a lot for posting here. This is appreciated!

I have filed an issue to add it to the docs

https://github.com/crossbario/crossbar/issues/742

Note: we've just recently moved the docs for Crossbar.io itself (back) into the main repo here https://github.com/crossbario/crossbar/tree/master/docs

Contributions to the docs of course are always welcome;)

Cheers,
/Tobias

···

Am 27.04.2016 um 17:57 schrieb Natale Vinto:

Hello,
I made a Puppet class that I used to deploy latest Crossbar on CentOS 7.x
machines, it would be better to write a module supporting all platforms and
upload to Puppetforge, but maybe just this could useful to someone.
The schema is:

- crossbar.pp: Puppet class to init and run Crossbar from its Package
- crossbar_repo.pp: Puppet class to add Crossbar repo, in the example
there's a check for CentOS with instructions to configure its Yum repo,
and its GPG key RPM-GPG-KEY-crossbar
- crossbar.service.erb: systemd template to start crossbar, can be used to
have more things parametric, I put user name

I started from systemd example [1] using it as ERB template, and then in
the class I simply create a system user that inits crossbar before running
the daemon. I used the same strategy for an ERB template for config.json to
be provisioned with other class parameters such as tls, port, ip, etc. it
is not present in this sample but could be simply adapted using update
instead of init in the "init_crossbar" Exec

Hope could be useful, other operating systems support is easy with package
management in that way, but a good step would be a test-based Puppet
module, with Hiera and other fun stuff :slight_smile:

Cheers

Natale

[1] http://crossbar.io/docs/Automatic-startup-and-restart/

0 Likes

#3

Hi Tobias,
I’ve just made a PR for that issue, I thought that maybe it would be better to add a generic Deploying section for any configuration management tools as Puppet, Ansible, Saltstack, and starting adding the Puppet one.

I made this new tree:

Installation->Deploying Crossbar.io->Deploying Crossbar.io with Puppet

Would be fine?

And I was wondering if it is the case to add that crossbar-puppet repo into crossbar.io directly, right now I put the link on my repo, since it has a very basic support, but maybe then is better to add it to crossbar parent project on github , what do you think?

Also I would like to add Vagrantfile for it, so people can vagrant up a virtual machine provisioned by Puppet, just as example, in local installations always better a Container but Puppet can also provision them :slight_smile:

···

Il giorno giovedì 28 aprile 2016 08:32:24 UTC+2, Tobias Oberstein ha scritto:

Hi Natale,

nice, nice!

Thanks a lot for posting here. This is appreciated!

I have filed an issue to add it to the docs

https://github.com/crossbario/crossbar/issues/742

Note: we’ve just recently moved the docs for Crossbar.io itself (back)
into the main repo here
https://github.com/crossbario/crossbar/tree/master/docs

Contributions to the docs of course are always welcome;)

Cheers,

/Tobias

Am 27.04.2016 um 17:57 schrieb Natale Vinto:

Hello,

I made a Puppet class that I used to deploy latest Crossbar on CentOS 7.x

machines, it would be better to write a module supporting all platforms and

upload to Puppetforge, but maybe just this could useful to someone.

The schema is:

  • crossbar.pp: Puppet class to init and run Crossbar from its Package
  • crossbar_repo.pp: Puppet class to add Crossbar repo, in the example

there’s a check for CentOS with instructions to configure its Yum repo,

and its GPG key RPM-GPG-KEY-crossbar

  • crossbar.service.erb: systemd template to start crossbar, can be used to

have more things parametric, I put user name

I started from systemd example [1] using it as ERB template, and then in

the class I simply create a system user that inits crossbar before running

the daemon. I used the same strategy for an ERB template for config.json to

be provisioned with other class parameters such as tls, port, ip, etc. it

is not present in this sample but could be simply adapted using update

instead of init in the “init_crossbar” Exec

Hope could be useful, other operating systems support is easy with package

management in that way, but a good step would be a test-based Puppet

module, with Hiera and other fun stuff :slight_smile:

Cheers

Natale

[1] http://crossbar.io/docs/Automatic-startup-and-restart/

0 Likes

#4

Hi guys,
I think I’m done by my side with latest update on Crossbar puppet module which supports now either init then upgrade action while provisioning it, thus one can deploy its own config.json with any desired supported option:

https://forge.puppet.com/bluesman/crossbar

Example:

puppet module install bluesman-crossbar

puppet apply -e ‘include crossbar’

it inits and starts Crossbar listening on port 8080

then you may want to change port, realm etc

puppet apply -e ‘class {“crossbar”: config_json => “file:///home/foo/myconfig.json”}’

and it upgrade the config.json with your provided one and restart the service

I’ll push also a Vagrantfile to run and test it quickly

Cheers,

Natale

···

Il giorno domenica 1 maggio 2016 18:42:31 UTC+2, Natale Vinto ha scritto:

Hi Tobias,
I’ve just made a PR for that issue, I thought that maybe it would be better to add a generic Deploying section for any configuration management tools as Puppet, Ansible, Saltstack, and starting adding the Puppet one.

I made this new tree:

Installation->Deploying Crossbar.io->Deploying Crossbar.io with Puppet

Would be fine?

And I was wondering if it is the case to add that crossbar-puppet repo into crossbar.io directly, right now I put the link on my repo, since it has a very basic support, but maybe then is better to add it to crossbar parent project on github , what do you think?

Also I would like to add Vagrantfile for it, so people can vagrant up a virtual machine provisioned by Puppet, just as example, in local installations always better a Container but Puppet can also provision them :slight_smile:

Il giorno giovedì 28 aprile 2016 08:32:24 UTC+2, Tobias Oberstein ha scritto:

Hi Natale,

nice, nice!

Thanks a lot for posting here. This is appreciated!

I have filed an issue to add it to the docs

https://github.com/crossbario/crossbar/issues/742

Note: we’ve just recently moved the docs for Crossbar.io itself (back)
into the main repo here
https://github.com/crossbario/crossbar/tree/master/docs

Contributions to the docs of course are always welcome;)

Cheers,

/Tobias

Am 27.04.2016 um 17:57 schrieb Natale Vinto:

Hello,

I made a Puppet class that I used to deploy latest Crossbar on CentOS 7.x

machines, it would be better to write a module supporting all platforms and

upload to Puppetforge, but maybe just this could useful to someone.

The schema is:

  • crossbar.pp: Puppet class to init and run Crossbar from its Package
  • crossbar_repo.pp: Puppet class to add Crossbar repo, in the example

there’s a check for CentOS with instructions to configure its Yum repo,

and its GPG key RPM-GPG-KEY-crossbar

  • crossbar.service.erb: systemd template to start crossbar, can be used to

have more things parametric, I put user name

I started from systemd example [1] using it as ERB template, and then in

the class I simply create a system user that inits crossbar before running

the daemon. I used the same strategy for an ERB template for config.json to

be provisioned with other class parameters such as tls, port, ip, etc. it

is not present in this sample but could be simply adapted using update

instead of init in the “init_crossbar” Exec

Hope could be useful, other operating systems support is easy with package

management in that way, but a good step would be a test-based Puppet

module, with Hiera and other fun stuff :slight_smile:

Cheers

Natale

[1] http://crossbar.io/docs/Automatic-startup-and-restart/

0 Likes