Make concat::fragment order parameter be a string
[mirror/dsa-puppet.git] / modules / roles / manifests / pubsub / config.pp
1 # = Define: roles::pubsub::config
2 #
3 # Connection stanzas for pubsub clients
4 #
5 # === Parameters
6 #
7 # [*key*]
8 #   The lookup key for the ini file, ie:
9 #   [foo] <- this
10 #   a=b
11 #
12 # [*topic*]
13 #   The topic to send or receive on
14 #
15 # [*username*]
16 #   Authentication username for the connection
17 #   Defaults to $::fqdn
18 #
19 # [*password*]
20 #   Authentication password for the connection
21 #
22 # [*vhost*]
23 #   RabbitMQ vhost to use for the connection
24 #   Defaults to 'dsa'
25 #
26 # [*exchange*]
27 #   RabbitMQ exchange to use for the connection
28 #   Defaults to 'dsa'
29 #
30 # [*queue*]
31 #   RabbitMQ queue to use for the connection
32 #   Only necessary on connections where client is receiving messages
33 #
34 # [*order*]
35 #   Ordering hint for concat
36 #   Defaults to '00'
37 #
38 # == Sample Usage:
39 #
40 #       roles::pubsub::config { 'testme':
41 #               key      => 'test',
42 #               exchange => dsa,
43 #               topic    => 'dsa.git.test',
44 #               vhost    => dsa,
45 #               username => $::fqdn,
46 #               password => 1234,
47 #       order    => 00
48 #       }
49 #
50 define roles::pubsub::config (
51         $key,
52         $topic,
53         $password,
54         $vhost=dsa,
55         $exchange=dsa,
56         $username=$::fqdn,
57         $queue=undef,
58         $order='00'
59 ){
60         include roles::pubsub::config::setup
61
62         concat::fragment { "pubsub_conf_${name}":
63                 target  => '/etc/dsa/pubsub.conf',
64                 content => template('roles/pubsub/pubsub.conf.erb'),
65                 order   => $order,
66         }
67 }