|
| 1 | +# Announce |
| 2 | + |
| 3 | +Long time no update. I'm back on this playbook again, I'll be merging fixes (url, |
| 4 | +key checking,...) in master and releasing a working tagged version. |
| 5 | + |
| 6 | +Then I'll focus on creating a next branche that will be the version 2.0 of this |
| 7 | +playbook. The main things I plan to do with the version 2 is going to separate |
| 8 | +the installation steps from the pure configuration. I don't want to support a |
| 9 | +gazillion OS in one playbook. Thus, you'll be able to make a |
| 10 | +ansible-playbook-rabbitmq-install-my-little-snowflak-os yourself :) |
| 11 | + |
| 12 | +Thank you all for all the participation! |
| 13 | + |
| 14 | +# Rabbitmq Playbook |
| 15 | + |
| 16 | +Playbook to install and configure rabbitmq. Will come with various |
| 17 | +configuration tweaking later on. |
| 18 | + |
| 19 | +If you wish to discuss modifications, or help to support more platforms, open |
| 20 | +an issue. |
| 21 | + |
| 22 | +## Installation |
| 23 | + |
| 24 | +Use Ansible galaxy to install this playbook: |
| 25 | + |
| 26 | + $ ansible-galaxy install Mayeu.RabbitMQ,1.4.0 |
| 27 | + |
| 28 | +The `master` branch should currently be considered instable. Please avoid using |
| 29 | +it for something else than test purpose :) |
| 30 | + |
| 31 | +## Supported system |
| 32 | + |
| 33 | +Currently only Debian Jessie and Wheezy on amd64 are supported. Patch welcome |
| 34 | +to support other distribution or OS. |
| 35 | + |
| 36 | +## Semantic versioning 2.0.0 |
| 37 | + |
| 38 | +Starting with the commit |
| 39 | +[67c608826a140868a71854ce3129b5f3d67ddcce](https://github.com/Mayeu/ansible-playbook-rabbitmq/commit/67c608826a140868a71854ce3129b5f3d67ddcce), |
| 40 | +this playbook use semantic versioning. Following the specification, and since |
| 41 | +the playbook is used in production and I want to avoid breaking the |
| 42 | +compatibility, the first version number is 1.0.0 |
| 43 | + |
| 44 | +The public API defined in the semantic versioning correspond to the settings |
| 45 | +available to the user. Breaking the API (incrementing from `X.Y.Z` to |
| 46 | +`(X+1).Y.Z`) in this context mean that the user need to change variable name |
| 47 | +for its playbook to run. |
| 48 | + |
| 49 | +Any new feature added (from `X.Y.Z` to `X.(Y+1).Z`) should have a working |
| 50 | +default value that need no user interaction by default. If a feature addition |
| 51 | +require user interaction, then it is not a minor upgrade, but a major one. |
| 52 | + |
| 53 | +## Role Variables |
| 54 | + |
| 55 | +### Installation |
| 56 | + |
| 57 | +|Name|Type|Description|Default| |
| 58 | +|----|----|-----------|-------| |
| 59 | +`rabbitmq_os_package`|Bool|When true uses the default package proposed by the OS or distribution instead of the one distributed by RabbitMQ.|`false`| |
| 60 | + |
| 61 | + |
| 62 | +### Environment |
| 63 | + |
| 64 | +|Name|Type|Description|Default| |
| 65 | +|----|----|-----------|-------| |
| 66 | +`rabbitmq_conf_env`|Hash|Set environment variable|undef| |
| 67 | + |
| 68 | +Exemple: |
| 69 | + |
| 70 | +```yaml |
| 71 | +rabbitmq_conf_env: |
| 72 | + RABBITMQ_ROCKS: correct |
| 73 | +``` |
| 74 | +
|
| 75 | +Will generate: |
| 76 | +
|
| 77 | +``` |
| 78 | +RABBITMQ_ROCKS="correct" |
| 79 | +``` |
| 80 | + |
| 81 | +### Certificate |
| 82 | + |
| 83 | +|Name|Type|Description|Default| |
| 84 | +|----|----|-----------|-------| |
| 85 | +`rabbitmq_cacert`|String|Path of the CA certificate file.|`files/rabbitmq_cacert.pem` |
| 86 | +`rabbitmq_server_key`|String|Path of the SSL key file.|`files/rabbitmq_server_key.pem` |
| 87 | +`rabbitmq_server_cert`|String|Path of the SSL certificate file.|`files/rabbitmq_server_cert.pem` |
| 88 | +`rabbitmq_ssl`|Boolean|Define if we need to use SSL|`true` |
| 89 | + |
| 90 | +### Default configuration file |
| 91 | + |
| 92 | +|Name|Type|Description|Default| |
| 93 | +|----|----|-----------|-------| |
| 94 | +`rabbitmq_conf_tcp_listeners_address`|String|listening address for the tcp interface|`''` |
| 95 | +`rabbitmq_conf_tcp_listeners_port`|Integer|listening port for the tcp interface|`5672` |
| 96 | +`rabbitmq_conf_ssl_listeners_address`|String|listening address for the ssl interface|`'0.0.0.0'` |
| 97 | +`rabbitmq_conf_ssl_listeners_port`|Integer|listening port for the ssl interface|`5671` |
| 98 | +`rabbitmq_conf_ssl_options_cacertfile`|String|Path the CA certificate|`"/etc/rabbitmq/ssl/cacert.pem"` |
| 99 | +`rabbitmq_conf_ssl_options_certfile`|String|Path to the server certificate|`"/etc/rabbitmq/ssl/server_cert.pem"` |
| 100 | +`rabbitmq_conf_ssl_options_keyfile`|String|Path to the private key file|`"/etc/rabbitmq/ssl/server_key.pem"` |
| 101 | +`rabbitmq_conf_ssl_options_fail_if_no_peer_cert`|Boolean|Value of the `fail_if_no_peer_cert` SSL option|`"true"` |
| 102 | + |
| 103 | +### Plugins |
| 104 | + |
| 105 | +|Name|Type|Description|Default| |
| 106 | +|----|----|-----------|-------| |
| 107 | +`rabbitmq_new_only`|String|Add plugins as new, without deactivating other plugins|`'no'` |
| 108 | +`rabbitmq_plugins`|String|List|List of plugins to activate|`[]` |
| 109 | + |
| 110 | +### Vhost |
| 111 | + |
| 112 | +|Name|Type|Description|Default| |
| 113 | +|----|----|-----------|-------| |
| 114 | +`rabbitmq_vhost_definitions`|List|Define the list of vhost to create|`[]` |
| 115 | +`rabbitmq_users_definitions`|List of hash|Define the users, and associated vhost and password (see below)|`[]` |
| 116 | + |
| 117 | +Defining the vhosts configuration |
| 118 | + |
| 119 | +```yaml |
| 120 | +rabbitmq_vhost_definitions: |
| 121 | + - name: vhost1 |
| 122 | + node: node_name #Optional, defaults to "rabbit" |
| 123 | + tracing: yes #Optional, defaults to "no" |
| 124 | +``` |
| 125 | +
|
| 126 | +Defining the users configuration: |
| 127 | +
|
| 128 | +```yaml |
| 129 | +rabbitmq_users_definitions: |
| 130 | + - vhost: vhost1 |
| 131 | + user: user1 |
| 132 | + password: password1 |
| 133 | + node: node_name # Optional, defaults to "rabbit" |
| 134 | + configure_priv: "^resource.*" # Optional, defaults to ".*" |
| 135 | + read_priv: "^$" # Disallow reading. |
| 136 | + write_priv: "^$" # Disallow writing. |
| 137 | + - vhost: vhost1 |
| 138 | + user: user2 |
| 139 | + password: password2 |
| 140 | + force: no |
| 141 | + tags: # Optional, user tags |
| 142 | + - administrator |
| 143 | +``` |
| 144 | +
|
| 145 | +## Cluster |
| 146 | +
|
| 147 | +# Limitations |
| 148 | +If you remove a node from inventory and node is still running it will not be removed |
| 149 | +
|
| 150 | +### Federation |
| 151 | +
|
| 152 | +|Name|Type|Description|Default| |
| 153 | +|----|----|-----------|-------| |
| 154 | +`rabbitmq_federation`|Boolean|Define if we need to setup federation|`false` |
| 155 | +`rabbitmq_federation_configuration`|List of hashes|Define all the federation we need to setup|Not defined |
| 156 | +`rabbitmq_policy_configuration`|List of hashes|Define all the federation we need to setup|Not defined |
| 157 | + |
| 158 | +Defining the federation upstream configuration: |
| 159 | + |
| 160 | +```yaml |
| 161 | +rabbitmq_federation_upstream: |
| 162 | + - name: upstream name |
| 163 | + vhost: local vhost to federate |
| 164 | + value: json description of the federation |
| 165 | + local_username: the local username for the federation |
| 166 | +``` |
| 167 | + |
| 168 | +See the [RabbitMQ documentation](http://www.rabbitmq.com/federation.html) for |
| 169 | +the possible JSON value. |
| 170 | + |
| 171 | +Defining the policy configuration: |
| 172 | + |
| 173 | +```yaml |
| 174 | +rabbitmq_policy_configuration: |
| 175 | + - name: name of the policy |
| 176 | + vhost: vhost where the policy will be applied |
| 177 | + pattern: pattern of the policy |
| 178 | + tags: description of the policy in dict form # exemple: "ha-mode=all" |
| 179 | +``` |
| 180 | + |
| 181 | +## Files required |
| 182 | + |
| 183 | +You have to put the needed certificates in your `files/` folder, for example: |
| 184 | + |
| 185 | + files/ |
| 186 | + |- cacert.crt |
| 187 | + |- myserver_key.key |
| 188 | + |- myserver_cert.crt |
| 189 | + |
| 190 | +And then configure the role: |
| 191 | + |
| 192 | +```yaml |
| 193 | + rabbitmq_cacert: files/cacert.crt |
| 194 | + rabbitmq_server_key: files/myserver_key.key |
| 195 | + rabbitmq_server_cert: files/myserver_cert.crt |
| 196 | +``` |
| 197 | + |
| 198 | +## Testing |
| 199 | + |
| 200 | +There is some tests that try to provision a VM using Vagrant. Just launch them |
| 201 | +with: |
| 202 | + |
| 203 | + $ vagrant up # for test with Debian jessie |
| 204 | + $ export VAGRANT_BOX_NAME='chef/centos-6.5' vagrant up # for test with Centos |
| 205 | + |
| 206 | +You can change the VM used during test by setting the `VAGRANT_BOX_NAME` env |
| 207 | +variable to something else than `deb/jessie`. |
| 208 | + |
| 209 | +## License |
| 210 | + |
| 211 | +BSD |
0 commit comments