--- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Usage: # To use this common task to create to create the user and vhost (if # needed for the messaging backend configured for RPC communications. # To used this common task, the variables "rpc_user", "rpc_password" and # "rpc_vhost" must be set. - name: Ensure RPC Rabbitmq vhost rabbitmq_vhost: name: "{{ rpc_vhost }}" state: "present" delegate_to: "{{ groups[oslomsg_rpc_host_group][0] }}" tags: - common-rabbitmq when: - oslomsg_rpc_transport == "rabbit" - name: Ensure RPC Rabbitmq user rabbitmq_user: user: "{{ rpc_user }}" password: "{{ rpc_password }}" vhost: "{{ rpc_vhost }}" configure_priv: ".*" read_priv: ".*" write_priv: ".*" state: "present" force: true delegate_to: "{{ groups[oslomsg_rpc_host_group][0] }}" no_log: true tags: - common-rabbitmq when: - oslomsg_rpc_transport == "rabbit" - name: Ensure RPC qdrouterd vhost command: echo 'create rpc qdrouterd vhost' delegate_to: "{{ groups[oslomsg_rpc_host_group][0] }}" tags: - common-qdrouterd when: - oslomsg_rpc_transport == "amqp" - name: Ensure RPC qdrouterd user command: echo 'create rpc qdrouterd user' delegate_to: "{{ groups[oslomsg_rpc_host_group][0] }}" tags: - common-qdrouterd when: - oslomsg_rpc_transport == "amqp"