Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

misc patches by rgevaert #4

Merged
merged 29 commits into from

4 participants

@KrisBuytaert

Rudy Gevaert did some work making it more debian friendly etc ...

root and others added some commits
root Initial project structure
git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@1 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
e72ac21
kbuytaert Initial commit of module rabbitmq
git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@2 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
da0c45a
jvansteenkiste Fix module structure
git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@3 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
ac19f15
@rgevaert rgevaert Fix
[default] err: /Stage[main]/Rabbitmq/Service[rabbitmq-server]/enable: change from false to true failed: Execution of '/usr/sbin/update-rc.d rabbitmq-server enable' returned 1: update-rc.d: error: rabbitmq-server Default-Start contains no runlevels, aborting.
update-rc.d: using dependency based boot sequencing
439b604
@rgevaert rgevaert Use for rabbitmq.config templating engine to configure the stomp list…
…ening host.
35ab8cf
@rgevaert rgevaert Defines to create/remove user and permission d4de222
@rgevaert rgevaert fix deleting user 0d2d515
@rgevaert rgevaert syntax fix d813cbc
@vStone vStone Fix formatting of init.pp
git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@4 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
4219710
@vStone vStone Fix formatting and add dependency so we dont try to put the configura…
…tion file in the folder while the package has not been installed yet

git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@5 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
a05e3e4
@vStone vStone Package needs to be installed before we put stuff in /etc/rabbitmq
git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@6 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
8172e2b
Kris Buytaert Fixed Syntax error in test 344f84b
Kris Buytaert Merged from upstream ( puppet-lint) and fixed test (puppet-lint) f1b53f5
@rgevaert rgevaert Merge remote branch 'kris/master'
Conflicts:
	manifests/init.pp
	manifests/stomp.pp
8b2fc9b
@rgevaert rgevaert Rakefile that runs puppet-lint 84d518d
@rgevaert rgevaert Make puppet-lint almost happy.
We can not get rid of the tabs because we need them in the shell command.
6379ea0
@rgevaert rgevaert Do not check long lines d9c69e8
@rgevaert rgevaert Fix
[default] err: /Stage[main]/Rabbitmq/Service[rabbitmq-server]/enable: change from false to true failed: Execution of '/usr/sbin/update-rc.d rabbitmq-server enable' returned 1: update-rc.d: error: rabbitmq-server Default-Start contains no runlevels, aborting.
update-rc.d: using dependency based boot sequencing
68c8037
@rgevaert rgevaert Use for rabbitmq.config templating engine to configure the stomp list…
…ening host.
aa3711e
@rgevaert rgevaert Defines to create/remove user and permission 2883b27
@rgevaert rgevaert fix deleting user f12e036
@rgevaert rgevaert Rakefile that runs puppet-lint 3afc5d2
@rgevaert rgevaert Make puppet-lint almost happy.
We can not get rid of the tabs because we need them in the shell command.
65869cf
@rgevaert rgevaert Do not check long lines 1c0ce39
@rgevaert rgevaert Make puppet lint happy a6afb89
@rgevaert rgevaert Fix adding of user.
The grep pattern was wrong.  Do not add the user when he
already present.
32c0689
@rgevaert rgevaert Deleting of permissions now works 2509f5d
@rgevaert rgevaert Merge branch 'mergekris' of github.com:rgevaert/puppet-rabbitmq into …
…mergekris

Conflicts:
	Rakefile
	manifests/permission.pp
	manifests/user.pp
f534526
@KrisBuytaert KrisBuytaert Merge pull request #1 from rgevaert/master
Nice work Rudy !
ce4b1a3
@rdegges
Owner

This looks totally awesome, thank you!

@rdegges rdegges merged commit d6774f5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2012
  1. Initial project structure

    root authored
    git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@1 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
  2. Initial commit of module rabbitmq

    kbuytaert authored
    git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@2 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
Commits on Jan 11, 2012
  1. Fix module structure

    jvansteenkiste authored
    git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@3 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
Commits on Jan 17, 2012
  1. @rgevaert

    Fix

    rgevaert authored
    [default] err: /Stage[main]/Rabbitmq/Service[rabbitmq-server]/enable: change from false to true failed: Execution of '/usr/sbin/update-rc.d rabbitmq-server enable' returned 1: update-rc.d: error: rabbitmq-server Default-Start contains no runlevels, aborting.
    update-rc.d: using dependency based boot sequencing
  2. @rgevaert
  3. @rgevaert
  4. @rgevaert

    fix deleting user

    rgevaert authored
Commits on Jan 25, 2012
  1. @rgevaert

    syntax fix

    rgevaert authored
Commits on Feb 23, 2012
  1. @vStone

    Fix formatting of init.pp

    vStone authored
    git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@4 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
  2. @vStone

    Fix formatting and add dependency so we dont try to put the configura…

    vStone authored
    …tion file in the folder while the package has not been installed yet
    
    git-svn-id: http://svn.dev.unifiedpost.com/repos/it/puppet/modules/rabbitmq/trunk@5 bbe7cd13-eaba-4a39-b44c-8eb27f83f0b5
Commits on Mar 1, 2012
  1. @vStone
Commits on Apr 6, 2012
  1. Fixed Syntax error in test

    Kris Buytaert authored
Commits on Apr 9, 2012
  1. @rgevaert

    Merge remote branch 'kris/master'

    rgevaert authored
    Conflicts:
    	manifests/init.pp
    	manifests/stomp.pp
Commits on Apr 17, 2012
  1. @rgevaert
  2. @rgevaert

    Make puppet-lint almost happy.

    rgevaert authored
    We can not get rid of the tabs because we need them in the shell command.
  3. @rgevaert

    Do not check long lines

    rgevaert authored
Commits on Apr 20, 2012
  1. @rgevaert

    Fix

    rgevaert authored
    [default] err: /Stage[main]/Rabbitmq/Service[rabbitmq-server]/enable: change from false to true failed: Execution of '/usr/sbin/update-rc.d rabbitmq-server enable' returned 1: update-rc.d: error: rabbitmq-server Default-Start contains no runlevels, aborting.
    update-rc.d: using dependency based boot sequencing
  2. @rgevaert
  3. @rgevaert
  4. @rgevaert

    fix deleting user

    rgevaert authored
  5. @rgevaert
  6. @rgevaert

    Make puppet-lint almost happy.

    rgevaert authored
    We can not get rid of the tabs because we need them in the shell command.
  7. @rgevaert

    Do not check long lines

    rgevaert authored rgevaert committed
  8. @rgevaert

    Make puppet lint happy

    rgevaert authored
  9. @rgevaert

    Fix adding of user.

    rgevaert authored
    The grep pattern was wrong.  Do not add the user when he
    already present.
  10. @rgevaert
  11. @rgevaert

    Merge branch 'mergekris' of github.com:rgevaert/puppet-rabbitmq into …

    rgevaert authored
    …mergekris
    
    Conflicts:
    	Rakefile
    	manifests/permission.pp
    	manifests/user.pp
Commits on Apr 26, 2012
  1. @KrisBuytaert

    Merge pull request #1 from rgevaert/master

    KrisBuytaert authored
    Nice work Rudy !
This page is out of date. Refresh to see the latest.
View
5 Rakefile
@@ -0,0 +1,5 @@
+require 'rake'
+require 'puppet-lint/tasks/puppet-lint'
+
+PuppetLint.configuration.send("disable_80chars")
+PuppetLint.configuration.send("disable_hard_tabs")
View
3  files/rabbitmq.config
@@ -1,3 +0,0 @@
-[
-{rabbitmq_stomp, [{tcp_listeners, [6163]} ]}
-].
View
18 manifests/init.pp
@@ -11,13 +11,17 @@
# Ensure rabbitmq is installed:
package { 'rabbitmq-server': ensure => present }
- # Ensure rabbitmq is running:
- service { 'rabbitmq-server':
- ensure => running,
- enable => true,
- hasrestart => true,
- hasstatus => true,
- require => Package['rabbitmq-server'],
+ $enable = $::operatingsystem ? {
+ 'Debian' => undef,
+ 'Ubuntu' => undef,
+ default => true
}
+ service { 'rabbitmq-server':
+ ensure => running,
+ enable => $enable,
+ hasrestart => true,
+ hasstatus => true,
+ require => Package['rabbitmq-server'],
+ }
}
View
54 manifests/permission.pp
@@ -0,0 +1,54 @@
+# Define: rabbitmq::permission
+#
+# Execute a rabbitmqctl command to create a permission.
+#
+# Usage:
+#
+# rabbitmq::permission { "myuser":
+# vhostpath => '/', #default
+# $conf => "^amq.gen-.*",
+# $write => ".*",
+# $read => ".*";
+# }
+# rabbitmq::permission { "myuser":
+# ensure => "absent",
+# vhostpath => '/', #default
+# $conf => "^amq.gen-.*",
+# $write => ".*",
+# $read => ".*";
+# }
+#
+#
+define rabbitmq::permission(
+ $conf, $write, $read,
+ $vhostpath = '/',
+ $user=$name,
+ $ensure='present')
+{
+
+ Exec {
+ path => '/usr/bin:/bin:/usr/sbin:/bin'
+ }
+
+ case $ensure {
+ 'present': {
+ exec { "rabbitmq_permission_${$user}":
+ command => "rabbitmqctl set_permissions -p ${vhostpath} ${user} \"${conf}\" \"${write}\" \"${read}\"",
+ # remark: below we have multiple tabs in the argument of grep
+ unless => "rabbitmqctl list_permissions -p ${vhostpath} | grep '^${user} ${conf} ${write} ${read}\$'",
+ require => Class['rabbitmq'],
+ }
+ }
+ 'absent' : {
+ exec { "rabbitmq_permission_${$user}":
+ command => "rabbitmqctl clear_permissions -p ${vhostpath} ${user}",
+ # remark: below we have a tab in the argument of grep
+ onlyif => "rabbitmqctl list_permissions -p ${vhostpath} | grep '^${user} '",
+ require => Class['rabbitmq'],
+ }
+ }
+ default: {
+ fail('use present or absent in rabbitmq::permission')
+ }
+ }
+}
View
16 manifests/stomp.pp
@@ -8,8 +8,10 @@
# Ugly hack using static files ..
# There most probably is a better approach to this
-class rabbitmq::stomp {
-
+class rabbitmq::stomp (
+ $stomp_tcp_listener_host = '127.0.0.1',
+ $stomp_tcp_listener_port = 6163)
+{
file { '/etc/rabbitmq/enabled_plugins':
group => '0',
@@ -19,11 +21,11 @@
}
file { '/etc/rabbitmq/rabbitmq.config':
- group => '0',
- mode => '0644',
- owner => '0',
- source => 'puppet:///modules/rabbitmq/rabbitmq.config';
+ group => '0',
+ mode => '0644',
+ owner => '0',
+ notify => Service['rabbitmq-server'],
+ content => template('rabbitmq/rabbitmq.config-stomp.erb');
}
-
}
View
43 manifests/user.pp
@@ -0,0 +1,43 @@
+# Define: rabbitmq::user
+#
+# Execute a rabbitmqctl command to create a user.
+#
+# Usage:
+#
+# rabbitmq::user { "myuser":
+# password => 'mypass';
+# }
+# rabbitmq::user { "myuser2":
+# ensure => "absent";
+# }
+#
+#
+define rabbitmq::user($password='', $ensure='present') {
+
+ Exec {
+ path => '/usr/bin:/bin:/usr/sbin:/bin'
+ }
+
+ case $ensure {
+ 'present': {
+ exec { "rabbitmq_user_${$name}":
+ command => "rabbitmqctl add_user ${name} ${password}",
+ # remark: below we have multiple tabs in the argument of grep
+ unless => "rabbitmqctl list_users | grep \"^${name}$\"",
+ require => Class['rabbitmq'],
+ }
+ }
+ 'absent' : {
+ exec { "rabbitmq_user_${$name}":
+ command => "rabbitmqctl delete_user ${name} ${password}",
+ # remark: below we have a tab in the argument of grep
+ onlyif => "rabbitmqctl list_users | grep \"^${name}$\"",
+ require => Class['rabbitmq'],
+ }
+ }
+ default: {
+ fail('use present or absent in rabbitmq::user')
+ }
+ }
+
+}
View
3  templates/rabbitmq.config-stomp.erb
@@ -0,0 +1,3 @@
+[
+{rabbitmq_stomp, [{tcp_listeners, [{"<%= stomp_tcp_listener_host %>", <%= stomp_tcp_listener_port %>}]} ]}
+].
View
4 tests/ctl.pp
@@ -1,4 +1,4 @@
rabbitmq::ctl{'stop_app':}
rabbitmq::ctl{'start_app':}
-rabbitmq::ctl{'add_user test test'}
-rabbitmq::ctl{'delete_user test'}
+rabbitmq::ctl{'add_user test test':}
+rabbitmq::ctl{'delete_user test':}
Something went wrong with that request. Please try again.